public static CCCatchUpAction getAction(GameObject target, float speed) { CCCatchUpAction action = ScriptableObject.CreateInstance <CCCatchUpAction>(); action.target = target; action.speed = speed; return(action); }
public void CatchUp(GameObject patrol, GameObject player) { if (actions.ContainsKey(patrol.GetComponent <Patrol>().area)) { actions[patrol.GetComponent <Patrol>().area].destroy = true; } CCCatchUpAction action = CCCatchUpAction.getAction(player, 1.5f); addAction(patrol.gameObject, action, this); }