Ejemplo n.º 1
0
    private void AddPlantCommand()
    {
        PlantCommandArgs args = new PlantCommandArgs(node, seed);
        Step             step = new Step(typeof(PlantCommand), args);

        stepList.Add(step);
    }
Ejemplo n.º 2
0
    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);
    }