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()); }
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(); }
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++; } }
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); }
public void Init(LevelGamePartID id) { InitPart(id); }
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)); }
private bool JudgeOpenState(LevelGamePartID gamePartId, LevelPartID id) { return(gamePartId <= DataManager.Single.LevelGamePartIndex && id <= DataManager.Single.LevelPartIndex); }