public UActionBase GetActionReference(UActionBase uaction) { var temp = Instantiate(uaction) as UActionBase; temp.unitBehaviour = this; temp.reference = uaction; temp.transform.SetParent(this.transform); temp.transform.localPosition = Vector3.zero; temp.transform.localRotation = Quaternion.identity; return(temp); }
public virtual void PlayAction(UActionBase uaction) { if (crtAction != null) { if (!crtAction.CanSwitch(uaction)) { return; } else { crtAction.Stop(); } } StopAllCoroutines(); crtAction = uaction; crtAction.Active(); }
public string GetActionName(UActionBase uaction) { return(uaction.reference.name); }
public void AddAction(UActionBase uaction) { var temp = GetActionReference(uaction); this.uaction.Add(GetActionName(temp), temp); }
public override bool CanSwitch(UActionBase other) { return(true); }
public virtual bool CanSwitch(UActionBase other) { return(false); }