Exemplo n.º 1
0
    public void DestroyGameObject()
    {
        DestroyObjectCommand dc = new DestroyObjectCommand(currentObj);

        Operations.RegisterUndo(dc);
        currentObj.SetActive(false);
    }
Exemplo n.º 2
0
    /// <summary>
    /// Executes the destroy logic.
    /// </summary>
    public override void Execute()
    {
        if (_XYLogic.inputFieldX.text == "" || _XYLogic.inputFieldY.text == "")
        {
            return;
        }

        DestroyObjectCommand command = new DestroyObjectCommand(-15 + _XYLogic.x * 9, 5 + _XYLogic.y * 9);

        command.Execute();
    }