예제 #1
0
 //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);
 }
예제 #2
0
    //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);
    }
예제 #3
0
    //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);
    }
예제 #4
0
    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());
            }
        }
    }
예제 #5
0
    //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);
    }
예제 #6
0
    //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);
    }
예제 #7
0
 //Perform whatever operation is needed on the VisualNovelSystem/VisualNovel.
 public override bool execute(VisualNovelSystem vns, VisualNovel vn)
 {
     vns.prepareBackgroundImage(resourceStream);
     return(false);
 }
예제 #8
0
 //Perform whatever operation is needed on the VisualNovelSystem/VisualNovel.
 public abstract bool execute(VisualNovelSystem vns, VisualNovel vn);
예제 #9
0
 //Perform whatever operation is needed on the VisualNovelSystem/VisualNovel.
 public bool execute(VisualNovelSystem vns, VisualNovel vn)
 {
     vns.wait(wait);
     return(true);
 }
예제 #10
0
 //Perform whatever operation is needed on the VisualNovelSystem/VisualNovel.
 public bool execute(VisualNovelSystem vns, VisualNovel vn)
 {
     vns.jump(resourcePath);
     return(false);
 }
예제 #11
0
 //Perform whatever operation is needed on the VisualNovelSystem/VisualNovel.
 public bool execute(VisualNovelSystem vns, VisualNovel vn)
 {
     vns.choice(choices);
     return(true);
 }
예제 #12
0
 //Perform whatever operation is needed on the VisualNovelSystem/VisualNovel.
 public override bool execute(VisualNovelSystem vns, VisualNovel vn)
 {
     vns.prepareForegroundImage(this);
     return(false);
 }
예제 #13
0
파일: VisualNovel.cs 프로젝트: rDarge/VRNDS
 public void update(VisualNovelSystem vns)
 {
     currentScript.executeReadyOperation(vns, this);
 }