void Start() { spawn = GameObject.FindGameObjectWithTag("Spawn").GetComponent <SpawnMap>(); bucket = Resources.Load("bucket") as GameObject; controller = GetComponent <CharacterController> (); InvokeRepeating("SpawnBucket", 2, 1.5f); playerController = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController> (); }
private Point3D FindSpawnLocation() { int x, y, z; do { x = Utility.Random(m_Top.X, (m_Bottom.X - m_Top.X)); y = Utility.Random(m_Top.Y, (m_Bottom.Y - m_Top.Y)); z = SpawnMap.GetAverageZ(x, y); }while (!SpawnMap.CanSpawnMobile(x, y, z)); return(new Point3D(x, y, z)); }
private Point3D FindSpawnLocation() { int x, y, z; var count = 100; do { x = Utility.Random(_Top.X, (_Bottom.X - _Top.X)); y = Utility.Random(_Top.Y, (_Bottom.Y - _Top.Y)); z = SpawnMap.GetAverageZ(x, y); }while (!SpawnMap.CanSpawnMobile(x, y, z) && --count >= 0); if (count < 0) { x = y = z = 0; } return(new Point3D(x, y, z)); }
private void OnDisable(SpawnMap map) { m_Tilemap = null; }
private void OnEnable(SpawnMap map) { m_Tilemap = map.tilemap; }
public SampleSet(Dictionary <String, SampleRegion> res) { results = res; spawnMap = new SpawnMap(Chunk.Size); }
private void Awake() { gm = transform.GetChild(0).GetComponent <GridMap>(); sm = transform.GetChild(1).GetComponent <SpawnMap>(); Instance = this; }