void Awake() { mybody = GetComponent <Rigidbody>(); playerAnim = GetComponent <PlayerAnimation>(); bgScroller = GameObject.Find(Tags.BACKGROUND_GAME_OBJ).GetComponent <BGScroller>(); playershoot = GetComponent <PlayerHealthDamage>(); jumpBtn = GameObject.Find(Tags.JUMP_BTN_OBJ).GetComponent <Button>(); jumpBtn.onClick.AddListener(() => Jump()); }
void playerDamageEventHandler(PlayerHealthDamage damage) { if (playerDamageTaken) { EventSound3D snd = Instantiate(eventSound3DPrefab, GameObject.Find("Soldier").transform.position, Quaternion.identity, null); snd.audioSrc.clip = this.playerDamageTaken; snd.audioSrc.minDistance = 5f; snd.audioSrc.maxDistance = 100f; snd.audioSrc.Play(); } }