public void Behit(int power) { GetComponent <AudioSource>().PlayOneShot(audioclip); int score = int.Parse(ScoreBoard.text); if (Health < power) { score += Health; } else { score += power; } ScoreBoard.text = score.ToString(); GameControl.Instance.score = score; Health -= power; if (Health <= 0) { Health = 0; AimerControl.Upgrade(); Instantiate(BoomVFX, transform.position, transform.rotation); Destroy(Healthtxtins.gameObject); Destroy(gameObject); } }
// Use this for initialization void Start() { Screen.lockCursor = false; this.ccontroller = this.GetComponent<CharacterController>(); this.ceditor = this.GetComponent<CharacterEditor>(); this.anim = this.GetComponent<Animator>(); this.SkillPanelManager = GameObject.Find("BasicSkillPanel").GetComponent<BasicSkillPanelManager>(); this.SwitchBomb(0); this.aimer = this.GetComponent<AimerControl>(); }