Example #1
0
    // Use this for initialization
    void Start()
    {
        state = DuckStates.Flying;
        ChangeMovement();

        flySpeed = Random.Range(flyMinSpeed, flyMaxSpeed);
    }
        public void Act(DuckStates state)
        {
            switch (state)
            {
            case DuckStates.Flying:
                Flying();
                break;

            case DuckStates.Landing:
                Landing();
                break;

            case DuckStates.OnGround:
                OnGround();
                break;

            case DuckStates.OnWater:
                OnWater();
                break;

            case DuckStates.TakingOff:
                TakeOff();
                break;

            default:
                Console.WriteLine("The Crazy Duck is in a state of limbo. Neither here nor there. Neither coming or going. But this is it's normal state...");
                break;
            }
        }
        public void Act(DuckStates state)
        {
            switch (state)
            {
            case DuckStates.Flying:
                Flying();
                break;

            case DuckStates.Landing:
                Landing();
                break;

            case DuckStates.OnGround:
                OnGround();
                break;

            case DuckStates.OnWater:
                OnWater();
                break;

            case DuckStates.TakingOff:
                TakeOff();
                break;

            default:
                Console.WriteLine("The Sickly Duck is in a state of limbo. Neither here nor there. Neither coming or going. What are you doing, Mallard?");
                break;
            }
        }
Example #4
0
        public void Act(DuckStates state)
        {
            switch (state)
            {
            case DuckStates.Flying:
                Flying();
                break;

            case DuckStates.Landing:
                Landing();
                break;

            case DuckStates.OnGround:
                OnGround();
                break;

            case DuckStates.OnWater:
                OnWater();
                break;

            case DuckStates.TakingOff:
                TakeOff();
                break;

            default:
                Console.WriteLine("The Rubber Duck is a rubber duck. It doesn't know of it's own existence.");
                break;
            }
        }
Example #5
0
    public void Hit()
    {
        // remove the collider component
        Destroy(GetComponent <Collider>());

        animator.Play("Hit");
        Invoke("Fall", 1);
        state = DuckStates.Hit;
    }
Example #6
0
    public void FlyAway()
    {
        // can't fly away if wasn't flying
        if (state != DuckStates.Flying)
        {
            return;
        }

        state    = DuckStates.FlyAway;
        movement = new Vector3(0, 1);
        UpdateAnimator(movement);

        Invoke("DestroySelf", 3);
    }
 public void Act(DuckStates state)
 {
     switch (state) {
         case DuckStates.Flying:
             Flying();
             break;
         case DuckStates.Landing:
             Landing();
             break;
         case DuckStates.OnGround:
             OnGround();
             break;
         case DuckStates.OnWater:
             OnWater();
             break;
         case DuckStates.TakingOff:
             TakeOff();
             break;
         default:
             Console.WriteLine("The Crazy Duck is in a state of limbo. Neither here nor there. Neither coming or going. But this is it's normal state...");
             break;
     }
 }
 public void Act(DuckStates state)
 {
     switch (state) {
         case DuckStates.Flying:
             Flying();
             break;
         case DuckStates.Landing:
             Landing();
             break;
         case DuckStates.OnGround:
             OnGround();
             break;
         case DuckStates.OnWater:
             OnWater();
             break;
         case DuckStates.TakingOff:
             TakeOff();
             break;
         default:
             Console.WriteLine("The Mallard is in a state of limbo. Neither here nor there. Neither coming or going. What are you doing, Mallard?");
             break;
     }
 }
 public void Act(DuckStates state)
 {
     switch (state) {
         case DuckStates.Flying:
             Flying();
             break;
         case DuckStates.Landing:
             Landing();
             break;
         case DuckStates.OnGround:
             OnGround();
             break;
         case DuckStates.OnWater:
             OnWater();
             break;
         case DuckStates.TakingOff:
             TakeOff();
             break;
         default:
             Console.WriteLine("The Rubber Duck is a rubber duck. It doesn't know of it's own existence.");
             break;
     }
 }
Example #10
0
 public void ChangeState(DuckStates state)
 {
     DuckStates = state;
     Notify();
 }
Example #11
0
 public override void Update()
 {
     DuckStates = Flock.DuckStates;
     Behavior.Act(DuckStates);
 }
Example #12
0
 public override void Update()
 {
     DuckStates = Flock.DuckStates;
     Behavior.Act(DuckStates);
 }
Example #13
0
 public void Fall()
 {
     animator.Play("Die");
     state = DuckStates.Falling;
 }
Example #14
0
 public void ChangeState(DuckStates state)
 {
     DuckStates = state;
     Notify();
 }