41 lines
935 B
C#
41 lines
935 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class EffectOnOff : MapControlBase
|
|
{
|
|
public GameObject[] gos_effect;
|
|
public int onStage, onWave;
|
|
|
|
private void Awake()
|
|
{
|
|
enabled = gos_effect != null;
|
|
if (enabled)
|
|
{
|
|
DSUtil.InActivateGameObjects(gos_effect);
|
|
MobInfo.Ins.onInitStage += onInitStage;
|
|
MobInfo.Ins.onChangeWave += onChangeWave;
|
|
}
|
|
}
|
|
|
|
private void OnDestroy()
|
|
{
|
|
if (enabled)
|
|
{
|
|
MobInfo.Ins.onInitStage -= onInitStage;
|
|
MobInfo.Ins.onChangeWave -= onChangeWave;
|
|
}
|
|
}
|
|
|
|
private void onChangeWave(int stage, int wave)
|
|
{
|
|
if (onStage == stage && onWave - 1 == wave)
|
|
DSUtil.ActivateGameObjects(gos_effect);
|
|
}
|
|
|
|
private void onInitStage()
|
|
{
|
|
DSUtil.InActivateGameObjects(gos_effect);
|
|
}
|
|
} |