public Thug createThug(float stunPower) { this.thug = Object.Instantiate(Thug, new Vector2(6f + this.hero.transform.position.x, -0.5f), Quaternion.identity).GetComponent <Thug>(); this.thug.gameObject.name = "Thug" + Random.Range(100, 999); this.thug.modifySpeed(stunPower); return(this.thug); }
public void punch() { AudioSource a = GameObject.Find("World").GetComponent <AudioSource>(); a.PlayOneShot(attackSFX); this.state = "endlag"; Thug thug = manager.getThug(); thug.tryToDie(); timeInEndlag = 0; VOSFX = Random.Range(0, VOSFXList.Length); source.PlayOneShot(VOSFXList[VOSFX]); Time.timeScale = 1f; manager.tutorialMessage.text = ""; animator.Play("HeroWalk"); }