public void StartAttack(GameObject targets) { missesAmount = 0; currentAction = PlayerAction.Attack; anim.SetTrigger("Attack"); GameObject attackTargets = Instantiate(targets, transform.position, Quaternion.identity) as GameObject; newBar = attackTargets.GetComponent <BattleBarTargetController>(); newBar.SetBar(this); attackTargets.transform.SetParent(bar, false); attackTargets.transform.localPosition = Vector3.zero; attackTargets.transform.SetAsFirstSibling(); }
public void StartDefence(GameObject targets) { missesAmount = 0; currentAction = PlayerAction.Defence; anim.SetTrigger("Defence"); GameObject defenceTargets = Instantiate(targets, transform.position, Quaternion.identity) as GameObject; newBar = defenceTargets.GetComponent <BattleBarTargetController>(); newBar.SetBar(this); defenceTargets.transform.SetParent(bar, false); defenceTargets.transform.localPosition = Vector3.zero; defenceTargets.transform.localScale = new Vector3(-1, 1, 1); defenceTargets.transform.SetAsFirstSibling(); }