Exemple #1
0
 public void DoAction(LegacyEditorAction act)
 {
     //Once we do a new thing, our redo list blows the hell up
     redoList.Clear();
     //Then actually do the thing
     act.execute();
     //This is a special tool that will help us later
     undoList.Push(act);
 }
Exemple #2
0
 public void Redo()
 {
     //If we have nothing to redo then we just quietly don't do anything
     if (redoList.Count > 0)
     {
         LegacyEditorAction act = redoList.Pop();
         act.execute();
         undoList.Push(act);
         FireModelChange();
     }
 }
Exemple #3
0
 public void Undo()
 {
     //If we have no history we don't have anything to undo and just quietly don't do anything
     if (undoList.Count > 0)
     {
         LegacyEditorAction act = undoList.Pop();
         act.undo();
         redoList.Push(act);
         FireModelChange();
     }
 }
    public void OnAction(bool inputData)
    {
        LegacyEditorAction action = null;

        if (varSource == ActionVarType.FIELD)
        {
            action = ScriptableObject.CreateInstance <ChangeActionField>();
            ((ChangeActionField)action).init(varName, inputData);
        }
        else if (varSource == ActionVarType.VARIABLE)
        {
            action = ScriptableObject.CreateInstance <ChangeActionField>();
            ((ChangeActionField)action).init(varName, inputData);
        }
        LegacyEditorData.instance.DoAction(action);
    }
Exemple #5
0
    public void OnAction()
    {
        string inputData = input.value;

        //If we have a filter object, make sure to filter the incoming text before we do anything with it.
        if (filter != null)
        {
            inputData = filter.filterText(inputData);
        }

        LegacyEditorAction action = null;

        if (varSource == DataInputVarSource.FIELD)
        {
            if (source == DataInputSource.FIGHTER)
            {
                action = ScriptableObject.CreateInstance <ChangeFighterInfoField>();
                ((ChangeFighterInfoField)action).init(varName, inputData);
            }
            else if (source == DataInputSource.ACTION)
            {
                action = ScriptableObject.CreateInstance <ChangeActionField>();
                ((ChangeActionField)action).init(varName, stringToObjectType(inputData));
            }
        }
        else if (varSource == DataInputVarSource.VARIABLE)
        {
            if (source == DataInputSource.FIGHTER)
            {
                action = ScriptableObject.CreateInstance <ChangeFighterInfoVar>();
                ((ChangeFighterInfoVar)action).init(varName, inputData);
            }
            else if (source == DataInputSource.ACTION)
            {
                action = ScriptableObject.CreateInstance <ChangeActionField>();
                ((ChangeActionField)action).init(varName, stringToObjectType(inputData));
            }
        }
        LegacyEditorData.instance.DoAction(action);
    }
Exemple #6
0
 public void SetAction(LegacyEditorAction legacyAction)
 {
     action = legacyAction;
 }