//Perform whatever operation is needed on the VisualNovelSystem/VisualNovel. public bool execute(VisualNovelSystem vns, VisualNovel vn) { if (text.Equals("~")) { vns.clearText(); } else { vns.setText(text); } return(halt); }
//Perform whatever operation is needed on the VisualNovelSystem/VisualNovel. public override bool execute(VisualNovelSystem vns, VisualNovel vn) { if (resourcePath.Equals("~")) { vns.stopMusic(); } else { Debug.Log("Playing music " + this.resourcePath); music = resourceStream.GetAudioClip(true); music.LoadAudioData(); vns.playMusic(music); } return(false); }
//Perform whatever operation is needed on the VisualNovelSystem/VisualNovel. public override bool execute(VisualNovelSystem vns, VisualNovel vn) { if (resourcePath.Equals("~")) { vns.stopMusic(); } else { Debug.Log("Playing audio " + this.resourcePath); //sound = resourceStream.GetAudioClip(false, false, AudioType.OGGVORBIS); sound = resourceStream.GetAudioClip(true); sound.LoadAudioData(); vns.playMusic(sound); } return(false); }
public void executeReadyOperation(VisualNovelSystem vns, VisualNovel vn) { if (this.ready() && currentOperation < operations.Count && operations[currentOperation].isReady() && !halt) { Debug.Log("Attempting to execute operation " + currentOperation + " which is a " + operations[currentOperation].GetType() + " pointing to " + operations[currentOperation].getResourcePath()); try { halt = operations[currentOperation].execute(vns, vn); } catch (System.Exception e) { Debug.LogError("Could not execute operation " + currentOperation + " in " + this.pathToScript); } currentOperation++; //Prepare the next operation if (currentOperation < operations.Count) { operations[currentOperation].prepare(vns.getVariables()); } } }
//Perform whatever operation is needed on the VisualNovelSystem/VisualNovel. public bool execute(VisualNovelSystem vns, VisualNovel vn) { if (inputVariable != null) { value = vns.getVariable(inputVariable); } if (operation.Equals("=")) { Debug.Log("Setting " + outputVariable + " to " + value); vns.setVariable(outputVariable, value); } else if (operation.Equals("+")) { Debug.Log("Adding " + value + " to the current value of " + outputVariable); vns.setVariable(outputVariable, vns.getVariable(outputVariable) + value); } return(false); }
//Perform whatever operation is needed on the VisualNovelSystem/VisualNovel. public bool execute(VisualNovelSystem vns, VisualNovel vn) { bool haltingOperation = false; Debug.Log("Attempting to evaluate variable with name " + variable); try { int storedValue = vns.getVariable(variable); bool evaluates = false; if (equalityOperator.Equals("==")) { evaluates = storedValue == value; } else if (equalityOperator.Equals("!=")) { evaluates = storedValue != value; } //TODO there are probably some more cases that are easy to nix when you get a chance if (evaluates) { foreach (VisualNovelOperation operation in operations) { operation.prepare(vns.getVariables()); bool eachOperation = operation.execute(vns, vn); //one-way switch for halting operations if (eachOperation == true) { haltingOperation = true; } } } } catch (KeyNotFoundException knfe) { Debug.Log("no key found for " + variable + " in dictionary. Assuming false"); } return(haltingOperation); }
//Perform whatever operation is needed on the VisualNovelSystem/VisualNovel. public override bool execute(VisualNovelSystem vns, VisualNovel vn) { vns.prepareBackgroundImage(resourceStream); return(false); }
//Perform whatever operation is needed on the VisualNovelSystem/VisualNovel. public abstract bool execute(VisualNovelSystem vns, VisualNovel vn);
//Perform whatever operation is needed on the VisualNovelSystem/VisualNovel. public bool execute(VisualNovelSystem vns, VisualNovel vn) { vns.wait(wait); return(true); }
//Perform whatever operation is needed on the VisualNovelSystem/VisualNovel. public bool execute(VisualNovelSystem vns, VisualNovel vn) { vns.jump(resourcePath); return(false); }
//Perform whatever operation is needed on the VisualNovelSystem/VisualNovel. public bool execute(VisualNovelSystem vns, VisualNovel vn) { vns.choice(choices); return(true); }
//Perform whatever operation is needed on the VisualNovelSystem/VisualNovel. public override bool execute(VisualNovelSystem vns, VisualNovel vn) { vns.prepareForegroundImage(this); return(false); }
public void update(VisualNovelSystem vns) { currentScript.executeReadyOperation(vns, this); }