Exemplo n.º 1
0
    public void StartAchieve()
    {
        if (!this._isActive)
        {
            return;
        }
        AchieveManager._mGameState = GamePhaseState.Phase1;
        Singleton <TriggerManager> .Instance.SendGameStateEvent(GameEvent.BattlePhase1);

        Units player = PlayerControlMgr.Instance.GetPlayer();

        this._triggerList.Add(TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.KillHero), -1, "Hero"));
        this._triggerList.Add(TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.KillHero), -1, "Player"));
        this._triggerList.Add(TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.MonsterKilling), -1, "Monster"));
        this._triggerList.Add(TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.PlayerDeath), player.unique_id));
        this._triggerList.Add(TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.TowerDestroyed), -1, "Building"));
        Units home = MapManager.Instance.GetHome(TeamType.BL);

        if (home != null)
        {
            this._triggerList.Add(TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.HomeDestroyed), home.unique_id));
        }
        IList <Units> tower = MapManager.Instance.GetTower(TeamType.LM);

        if (tower != null && tower.Count > 0)
        {
            this._triggerList.Add(TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.TowerDestroyed), 0, "Building"));
        }
        this._tr1 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.HeroDeath), -1, "Hero");
        this._triggerList.Add(this._tr1);
        this._tr2 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.MonsterDeath), -1, "Monster");
        this._triggerList.Add(this._tr2);
    }
Exemplo n.º 2
0
    private void EndAchieve()
    {
        this._isActive             = false;
        AchieveManager._mGameState = GamePhaseState.None;
        Singleton <TriggerManager> .Instance.SendGameStateEvent(GameEvent.BattlePhase0);

        this._mCoroutineManager.StopCoroutine(this._checkConditionTask);
        for (int i = 0; i < this._triggerList.Count; i++)
        {
            TriggerManager.DestroyTrigger(this._triggerList[i]);
        }
        this._triggerList.Clear();
        this.ResetData();
        foreach (BattleAttrGrowth.KillData current in this._killDataDict.Values)
        {
            current.ResetData();
        }
    }