private void AddPlantCommand() { PlantCommandArgs args = new PlantCommandArgs(node, seed); Step step = new Step(typeof(PlantCommand), args); stepList.Add(step); }
public bool Initialize(ICommandArgs args) { PlantCommandArgs commandArgs = args as PlantCommandArgs; if (commandArgs == null) { Abort(); throw new UnityException("Wrong type of args"); } seed = commandArgs.seed; cultivable = commandArgs.node.GetBlock().GetComponent <Cultivable>(); if (!cultivable) { Abort(); Debug.LogError("Tried to plant a non cultivable object"); return(false); } TickSystem.Subscribe(Plant); return(true); }