public void AddFunctionsFromScript(AmiScript amiScript) { foreach (AmiClass amiClass in amiScript.classes) { AddFunction(amiClass, functionLineContainer); } }
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); }
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); }
void CreateNewEmptyScript(AmiScript.categories _category, string _scriptName) { edittingScript = null; title.text = _category.ToString() + "->" + _scriptName; this.panel.SetActive(true); this.category = _category; this.scriptName = _scriptName; }
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); }
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); }
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); } }
void OnEditScript(AmiScript script) { UiPlaying.SetActive(false); }
public void Init(UIButtonsInGame uiButtonsInGame, AmiScript _script) { this.uiButtonsInGame = uiButtonsInGame; this.script = _script; }
void Reset() { allFunctions.Clear(); Utils.RemoveAllChildsIn(functionsLineContainer.transform); amiScript = null; }
void SetScriptSelected(AmiScript _script) { this.script = _script; }
void SetInvoked() { script = uiButtonsInGame.GetScriptSelected(); }
public void ProcessScript(AmiScript _script) { //Reset(); this.script = _script; isProcessing = true; }