Exemplo n.º 1
0
    void FixedUpdate()
    {
        if (_isFrozen)
        {
            if (_pusher != null)
            {
                //_pusher.agent.speed = 0.0f;
                //_pusher.agent.isStopped = true;
            }

            if (_ticker != null)
            {
                //_ticker.agent.speed = 0.0f;
            }

            _timer += Time.deltaTime;

            if (_timer > freezeTime)
            {
                _isFrozen = false;
            }
        }
        else
        {
            _pusher = null;
            _ticker = null;
        }
    }
Exemplo n.º 2
0
    void onTriggerEnter(Collision collider)
    {
        if (!_isFrozen)
        {
            if (collider.gameObject.name == "PusherEnemy")
            {
                _pusher   = collider.gameObject.GetComponentInChildren <PusherAI>();
                _isFrozen = true;
            }
            else if (collider.gameObject.name == "TickEnemy")
            {
                _ticker   = collider.gameObject.GetComponentInChildren <TickAI>();
                _isFrozen = true;
            }
        }

        _renderer.enabled = true;
    }