public void UpdateJelly(float deltaTime)
        {
            if (this.state == JellyState.ObstacleCollisionEffectState)
            {
                this.bounceEffectTimer -= deltaTime;

                if (this.bounceEffectTimer <= 0)
                {
                    this.state = JellyState.NormalState;
                }
            }
        }
        private void OnTriggerEnter(Collider other)
        {
            if (other.GetComponent <Finish>() != null)
            {
                this.state = JellyState.WinState;
            }

            else if (other.GetComponent <Gap>() != null)
            {
                this.state = JellyState.LoseState;
            }
        }
        private void OnCollisionEnter(Collision collision)
        {
            if (collision.gameObject.layer == (int)Layers.Obstacle)
            {
                this.collisionObstacleOfJellyReaction
                .OnCollisionEnter(collision.gameObject, this.gameObject, collision);

                if (this.state != JellyState.NormalState)
                {
                    return;
                }

                this.collisionJellyOfObstacleReaction
                .OnCollisionEnter(this.gameObject, collision.gameObject, collision);
                this.state = JellyState.ObstacleCollisionEffectState;
            }
        }
Exemple #4
0
 public void Reached()
 {
     state = JellyState.Reached;
 }
Exemple #5
0
 private void Start()
 {
     state = JellyState.Idle;
 }