Example #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());
        }
Example #2
0
        private void StartPartGame(WallCollider[] walls, ZamekEffect[] zameks, LevelGamePartID gamePartId, LevelPartID id, Action spawnEnemy)
        {
            SetOpenState(false, zameks);
            SetWallState(false, walls);
            DataManager.Single.LevelGamePartIndex = gamePartId;
            DataManager.Single.LevelPartIndex     = id;

            spawnEnemy?.Invoke();
        }
Example #3
0
        private void InitPart(LevelGamePartID id)
        {
            Part partTemp = null;
            int  index    = 1;

            foreach (Transform trans in transform)
            {
                partTemp = trans.gameObject.AddComponent <Part>();
                partTemp.Init(id, (LevelPartID)index);
                index++;
            }
        }
Example #4
0
        public void Init(LevelGamePartID gamePartId, LevelPartID id, Action spawnEnemy)
        {
            ZamekEffect[] zameks = InitZamek(transform);

            bool isOpen = JudgeOpenState(gamePartId, id);

            SetOpenState(isOpen, zameks);

            WallCollider[] walls = InitWallCollider(transform);
            SetWallState(isOpen, walls);

            InitStartPartTrigger(walls, zameks, gamePartId, id, spawnEnemy);
        }
Example #5
0
 public void Init(LevelGamePartID id)
 {
     InitPart(id);
 }
Example #6
0
        private void InitStartPartTrigger(WallCollider[] walls, ZamekEffect[] zameks, LevelGamePartID gamePartId, LevelPartID id, Action spawnEnemy)
        {
            StartPartTrigger trigger = transform.parent.gameObject.AddComponent <StartPartTrigger>();

            trigger.Init(() => StartPartGame(walls, zameks, gamePartId, id, spawnEnemy));
        }
Example #7
0
 private bool JudgeOpenState(LevelGamePartID gamePartId, LevelPartID id)
 {
     return(gamePartId <= DataManager.Single.LevelGamePartIndex &&
            id <= DataManager.Single.LevelPartIndex);
 }