void Start() { attacc = false; if (boomarang == null) { boomarang = Instantiate(Boomerang, new Vector2(transform.position.x, transform.position.y), Quaternion.identity).GetComponent <Boomarang>(); boomarang.Setup(transform, 1, true); } animator = GetComponent <Animator>(); }
// Use this for initialization void Start() { if (maxHealth == 0) { FirstInit(); } health = maxHealth; canAttack = true; canBlock = true; heartUI.UpdateHealth(health, maxHealth); orientation = new Vector2(0, -1); sprite.material = new Material(spriteFlash); if (boomarang == null) { boomarang = Instantiate(boomarangPrefab, transform.position, Quaternion.identity).GetComponent <Boomarang> (); boomarang.Setup(transform, 1, false); } inventoryUI.Replace((int)equippedItem); }