Beispiel #1
0
    public bool CallbackPerFrame(ActivedTriggerInfo info)
    {
        IsAllDead = _callback.OnCallback(info);

        bool isSummonPass = true;

        if (null != summonTriggers)
        {
            foreach (BornPoint bp in summonTriggers)
            {
                if ((bp.Triggered && !bp.IsAllDead))
                {
                    isSummonPass = false;
                }
            }
        }

        if (IsAllDead && isSummonPass)
        {
            _myCollider.enabled = false;

            //broadcast myself to clients, remove myself and active next triggers

            foreach (BornPoint bp in _nextTriggers)
            {
                bp.Active();
            }

            // Deactive the next gates.
            foreach (AirGate ag in _deactiveBlockades)
            {
                ag.Deactive();
            }

#if PVP_ENABLED
            if (GameManager.Instance.IsPVPMode)
            {
            }
            else
            {
#endif
            // Next trigger is null, so the player passes the level.



            if (TriggerManager.Singleton._endBornPoint == this)
            {
                FinishLevel();
            }

#if PVP_ENABLED
        }
#endif
            return(true);
        }
        return(false);
    }
Beispiel #2
0
    void OnTriggerEnter(Collider other)
    {
        ActionController ac = ActionControllerManager.Instance.GetACByCollider(other);

        // some hero steps into the trap.
        if (ac != null)
        {
            if (!_triggered)
            {
                ActivedTriggerInfo info = new ActivedTriggerInfo();
                info._trigger = this;

                info._alived = _endEnemyIndex - _startEnemyIndex;

                Debug.Log(string.Format("Trigger activated. Name = {0}, enemy index range = {1}, {2} live enemy count = {3}", this.name, _startEnemyIndex, _endEnemyIndex, info._alived));

                LevelManager.Singleton.AddActivedTrigger(info);

                _triggered = true;

                StartCoroutine(ActivateEnemy());

                if (UIManager.Instance != null && UIManager.Instance._indicatorManager != null)
                {
                    UIManager.Instance._indicatorManager.DeactiveTriggerIndicator();
                }
            }

            if (ac.IsPlayerSelf && !_doorTriggered)
            {
                SetTickets();

                // Active the air gate.
                foreach (AirGate ag in _activeBlockades)
                {
                    ag.Active();
                }

                _doorTriggered = true;
                Deactive();
            }
        }
    }
Beispiel #3
0
 public override bool OnCallback(ActivedTriggerInfo info)
 {
     return(info._alived == 0);
 }
Beispiel #4
0
 virtual public bool OnCallback(ActivedTriggerInfo info)
 {
     return(false);
 }