Exemple #1
0
        public void Init(LevelGamePartID gamePartId, LevelPartID id)
        {
            SpawnEnemyManager spawnManager = AddScript <SpawnEnemyManager>(ConstValue.GAME_PART_SPWAN_POINT);

            spawnManager?.Init();

            AddScript <PartWall>(ConstValue.GAME_PART_WALL)?.Init(gamePartId, id, () => spawnManager.Spawn());
        }
Exemple #2
0
 // Use this for initialization
 void Start()
 {
     if (ins == null)
     {
         ins = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Exemple #3
0
 private void Awake()
 {
     if (!Instance)
     {
         Instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Exemple #4
0
 private void Awake()
 {
     if (EnemyForSpawn)
     {
         if (instance == null)
         {
             instance = this;
             DontDestroyOnLoad(this);
             checkSpawnPos.direction = Vector3.down * 10f;
             checkSpawnBounds        = EnemyForSpawn.GetComponent <Collider>().bounds;
         }
         else
         {
             Destroy(gameObject);
         }
     }
     else
     {
         throw new System.Exception("Enemy for spawn is not used");
     }
 }