Ejemplo n.º 1
0
 public void AddFunctionsFromScript(AmiScript amiScript)
 {
     foreach (AmiClass amiClass in amiScript.classes)
     {
         AddFunction(amiClass, functionLineContainer);
     }
 }
Ejemplo n.º 2
0
    public AmiScript CreateScriptFromLines(AmiScript amiScript, List <UIFunctionLine> uifl)
    {
        amiScript.classes = new List <AmiClass>();
        int sequenceID = -1;

        foreach (UIFunctionLine line in uifl)
        {
            if (!line.isParallel)
            {
                print("::::::::::::");
                sequenceID++;
            }
            AmiClass newClass = new AmiClass();
            newClass.className      = line.field.text;
            newClass.argumentValues = new List <AmiArgument>();
            newClass.sequenceID     = sequenceID;
            foreach (UIFunctionVarButton b in line.functionVarButtons)
            {
                AmiArgument arg = new AmiArgument();
                arg.type  = b.arg;
                arg.value = b.GetValue();
                newClass.argumentValues.Add(arg);
            }
            amiScript.classes.Add(newClass);
        }
        return(amiScript);
    }
Ejemplo n.º 3
0
    void UpdateScript(AmiScript originalScript, AmiScript.categories category, string scriptName, List <UIFunctionLine> uifl)
    {
        AmiScript amiScript = CreateScriptFromLines(originalScript, uifl);

        amiScript.Init(scriptName);
        amiScript.category = category;
        Events.SetScriptSelected(amiScript);
    }
Ejemplo n.º 4
0
 void CreateNewEmptyScript(AmiScript.categories _category, string _scriptName)
 {
     edittingScript = null;
     title.text     = _category.ToString() + "->" + _scriptName;
     this.panel.SetActive(true);
     this.category   = _category;
     this.scriptName = _scriptName;
 }
Ejemplo n.º 5
0
    void SaveNewScript(AmiScript.categories category, string scriptName, List <UIFunctionLine> uifl)
    {
        AmiScript amiScript = CreateScriptFromLines(new AmiScript(), uifl);

        amiScript.Init(scriptName);
        amiScript.category = category;
        Events.SetScriptSelected(amiScript);
        scripts.Add(amiScript);
    }
Ejemplo n.º 6
0
    void OnEditScript(AmiScript amiScript)
    {
        this.edittingScript = amiScript;
        title.text          = amiScript.category.ToString() + "->" + amiScript.scriptName;
        this.panel.SetActive(true);
        this.category   = amiScript.category;
        this.scriptName = amiScript.scriptName;

        GetComponent <UiClassManager>().AddFunctionsFromScript(amiScript);
    }
Ejemplo n.º 7
0
    void OnDebug(bool _isPlaying)
    {
        this.isPlaying = _isPlaying;
        allFunctions.Clear();

        if (isPlaying)
        {
            Events.OnUIFunctionChangeIconColor(Color.grey);
            CatchFunctions();
            amiScript = characterScripts.CreateScriptFromLines(new AmiScript(), allFunctions);
            character.scriptsProcessor.ProcessScript(amiScript);
        }
    }
Ejemplo n.º 8
0
 void OnEditScript(AmiScript script)
 {
     UiPlaying.SetActive(false);
 }
Ejemplo n.º 9
0
 public void Init(UIButtonsInGame uiButtonsInGame, AmiScript _script)
 {
     this.uiButtonsInGame = uiButtonsInGame;
     this.script          = _script;
 }
Ejemplo n.º 10
0
 void Reset()
 {
     allFunctions.Clear();
     Utils.RemoveAllChildsIn(functionsLineContainer.transform);
     amiScript = null;
 }
Ejemplo n.º 11
0
 void SetScriptSelected(AmiScript _script)
 {
     this.script = _script;
 }
Ejemplo n.º 12
0
 void SetInvoked()
 {
     script = uiButtonsInGame.GetScriptSelected();
 }
Ejemplo n.º 13
0
 public void ProcessScript(AmiScript _script)
 {
     //Reset();
     this.script  = _script;
     isProcessing = true;
 }