void OnTriggerStay2D(Collider2D coll) { GameObject obj = coll.gameObject; if (obj.tag == "Bear") { BearMovement bm = obj.GetComponent <BearMovement>(); bm.BearHasBeenHit(); } }
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"); } }
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(); } } } }
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); } }
private void Awake() { skeleton = GetComponentsInChildren <Skeleton>(); bossAnimationController = GetComponent <BossAnimationController>(); bearMovement = GetComponent <BearMovement>(); }
private void Start() { cc = player.gameObject.GetComponent <CharacterMovement>(); bcc = bear.gameObject.GetComponent <BearMovement>(); //print(cc.gravity); }