Esempio n. 1
0
    void OnTriggerStay2D(Collider2D coll)
    {
        GameObject obj = coll.gameObject;

        if (obj.tag == "Bear")
        {
            BearMovement bm = obj.GetComponent <BearMovement>();
            bm.BearHasBeenHit();
        }
    }
Esempio n. 2
0
    void OnTriggerEnter2D(Collider2D coll)
    {
        GameObject obj = coll.gameObject;

        if (goatState == (int)GoatMoveState.bashing &&
            obj.transform.position.x >= transform.position.x)
        {
            goatState = (int)GoatMoveState.returning;
            BearMovement bm = obj.GetComponent <BearMovement>();
            if (bm.BearHasBeenHit())
            {
                gameObject.GetComponent <AudioSource>().Play();
            }

            // obj.SendMessage("HandleCollisionWithGoat");
        }
    }
Esempio n. 3
0
    void OnTriggerStay2D(Collider2D coll)
    {
        GameObject obj = coll.gameObject;

        if (goatState == (int)GoatMoveState.bashing &&
            obj.transform.position.x >= transform.position.x)
        {
            goatState = (int)GoatMoveState.returning;
            BearMovement bm = obj.GetComponent <BearMovement>();
            if (bm != null)
            {
                if (bm.BearHasBeenHit())
                {
                    gameObject.GetComponent <AudioSource>().Play();
                }
            }
        }
    }
Esempio n. 4
0
 public void SetInterruptableActionToState(BearMovement bm)
 {
     if (bm.jumping)
     {
         bossAnimationController.SetInterruptableActions(jump);
     }
     else if (bm.falling)
     {
         bossAnimationController.SetInterruptableActions(fall);
     }
     else if (bm.sprinting)
     {
         bossAnimationController.SetInterruptableActions(run);
     }
     else if (bm.walking)
     {
         bossAnimationController.SetInterruptableActions(walk);
     }
     else
     {
         bossAnimationController.SetInterruptableActions(idle);
     }
 }
Esempio n. 5
0
 private void Awake()
 {
     skeleton = GetComponentsInChildren <Skeleton>();
     bossAnimationController = GetComponent <BossAnimationController>();
     bearMovement            = GetComponent <BearMovement>();
 }
Esempio n. 6
0
 private void Start()
 {
     cc  = player.gameObject.GetComponent <CharacterMovement>();
     bcc = bear.gameObject.GetComponent <BearMovement>();
     //print(cc.gravity);
 }