Example #1
0
 public void CallAction_Defend()
 {
     if (HeldObject != null)
     {
         print("Object not null");
         if (HeldObject.GetComponent <UnitActions>() == true)
         {
             print("Script not null");
             UnitActions actions = HeldObject.GetComponent <UnitActions>();
             if (actions.ActionAvailable)
             {
                 Debug.Log("DEFEND!!!");
                 actions.Action_Defend();
                 Cancel();
             }
         }
     }
     else
     {
         print("Object is null");
     }
 }