An open API service indexing awesome lists of open source software.

https://github.com/nejcc/unityscripts

Helpfull unity scripts
https://github.com/nejcc/unityscripts

Last synced: 8 months ago
JSON representation

Helpfull unity scripts

Awesome Lists containing this project

README

          

# UnityScripts
Helpfull unity scripts

## Get tag
```cs
if( hit.transform.gameObject.tag == "Interact"){
Debug.Log("Colide with interact tile");
}
```
## Get dropdown in inspector
```cs
public enum TileSetType {Forest,Grassland,Housing};

[SerializeField] public TileSetType tileType;
```

## Spawn items in the world with X and z cordinats
```cs
private Dictionary hexToGameObjectMap;

public void SpawnUnitAt(GameObject PlayerUnitPrefab, int q, int r)
{
GameObject myHex = hexToGameObjectMap[GetHexAt(q,r)];
//Spawn player in
Instantiate(PlayerUnitPrefab, myHex.transform.position, Quaternion.identity, myHex.transform);
}
```