Beispiel #1
0
    public override void HandleEvent(string eventName, object data)
    {
        switch (eventName)
        {
        case Consts.E_EnterScene:
            SceneArgs e0 = data as SceneArgs;
            if (e0.SceneIndex == 2)
            {
                Game.Instance.Sound.PlayBGM("Game");
            }
            StartCoroutine(RandomSpawnEnemyCoroutine());
            break;

        case Consts.E_SpawnSoldier:
            SpawnSoldierArgs e1 = data as SpawnSoldierArgs;
            SpawnSoldier(e1.arm, e1.camp, e1.pos);
            break;

        case Consts.E_SpawnSkill:
            SpawnSkillArgs e2 = data as SpawnSkillArgs;
            SpawnSkill(e2.skillType, e2.camp, e2.pos);
            break;

        case Consts.E_ShowSHop:
            MVC.GetView <UIShop>().Show();
            break;

        case Consts.E_Win:
            MVC.GetView <UIWin>().Show();
            break;

        case Consts.E_Lose:
            MVC.GetView <UILose>().Show();
            break;

        default:
            break;
        }
    }