예제 #1
0
    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);
    }
예제 #2
0
 public virtual void PlayAction(UActionBase uaction)
 {
     if (crtAction != null)
     {
         if (!crtAction.CanSwitch(uaction))
         {
             return;
         }
         else
         {
             crtAction.Stop();
         }
     }
     StopAllCoroutines();
     crtAction = uaction;
     crtAction.Active();
 }
예제 #3
0
 public string GetActionName(UActionBase uaction)
 {
     return(uaction.reference.name);
 }
예제 #4
0
    public void AddAction(UActionBase uaction)
    {
        var temp = GetActionReference(uaction);

        this.uaction.Add(GetActionName(temp), temp);
    }
예제 #5
0
 public override bool CanSwitch(UActionBase other)
 {
     return(true);
 }
예제 #6
0
 public virtual bool CanSwitch(UActionBase other)
 {
     return(false);
 }