public void UseAbility() { countDownToComplete = TimeToComplete; countDownToFollowThrough = FollowThroughDelay; isInUse = true; //Update will detect this is true and run the StartUsingAbility function CharAbilityAction myAction = Instantiate(MyActionPrefab, new Vector3(0f, 0f, 0f), Quaternion.identity) as CharAbilityAction; myAction.transform.SetParent(myCharacter.transform, false); myAction.MyAnimator = myCharacter.GetMyAnimator(); myAction.MakeAction(); //The animation will begin }
public void SetCharAction(CharAbilityAction action) { MyActionPrefab = action; }