public override void RightClickOnMine(GameObject TargetObject) { if (TargetObject.GetComponent <ResourceNode>().canmine()) { commandManager.AddCommand(Cmd_Gather.New(gameObject, TargetObject)); } }
public static Cmd_Gather New(GameObject prGameObject, GameObject prMine) { Cmd_Gather newcommand = prGameObject.AddComponent <Cmd_Gather>(); newcommand.initialMine = prMine; newcommand.resourceDepot = prMine.GetComponent <ResourceNode>().depot; return(newcommand); }