Beispiel #1
0
 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> ();
 }
Beispiel #2
0
        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));
        }
Beispiel #3
0
        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));
        }
Beispiel #4
0
 private void OnDisable(SpawnMap map)
 {
     m_Tilemap = null;
 }
Beispiel #5
0
 private void OnEnable(SpawnMap map)
 {
     m_Tilemap = map.tilemap;
 }
Beispiel #6
0
 public SampleSet(Dictionary <String, SampleRegion> res)
 {
     results  = res;
     spawnMap = new SpawnMap(Chunk.Size);
 }
Beispiel #7
0
 private void Awake()
 {
     gm       = transform.GetChild(0).GetComponent <GridMap>();
     sm       = transform.GetChild(1).GetComponent <SpawnMap>();
     Instance = this;
 }