public override IEnumerator Execute(UVNFManager managerCallback, UVNFCanvas canvas)
 {
     if (PauseBackgroundMusic)
     {
         if (Fade)
         {
             managerCallback.AudioManager.StopBackgroundMusic(FadeTime, false);
         }
         else
         {
             managerCallback.AudioManager.PauseBackgroundMusic();
         }
     }
     else
     {
         if (Fade)
         {
             managerCallback.AudioManager.StopBackgroundMusic(FadeTime);
         }
         else
         {
             managerCallback.AudioManager.StopBackgroundMusic();
         }
     }
     yield return(null);
 }
        public override IEnumerator Execute(UVNFManager managerCallback, UVNFCanvas canvas)
        {
            bool conditionTrue = false;

            switch (Variables.Variables[VariableIndex].ValueType)
            {
            case VariableTypes.Boolean:
                conditionTrue = BooleanValue == Variables.Variables[VariableIndex].BooleanValue; break;

            case VariableTypes.Number:
                conditionTrue = NumberValue >= Variables.Variables[VariableIndex].NumberValue; break;

            case VariableTypes.String:
                conditionTrue = TextValue == Variables.Variables[VariableIndex].TextValue; break;
            }

            if (conditionTrue)
            {
                managerCallback.AdvanceStoryGraph(GetOutputPort("NextNode").Connection.node as StoryElement);
            }
            else
            {
                managerCallback.AdvanceStoryGraph(GetOutputPort("ConditionFails").Connection.node as StoryElement);
            }
            yield return(null);
        }
 public override IEnumerator Execute(UVNFManager managerCallback, UVNFCanvas canvas)
 {
     if (WaitToFinish)
     {
         if (ShowLoadScreen)
         {
             return(managerCallback.Canvas.UnfadeCanvasGroup(managerCallback.Canvas.LoadingCanvasGroup, FadeOutTime));
         }
         else
         {
             return(managerCallback.Canvas.FadeCanvasGroup(managerCallback.Canvas.LoadingCanvasGroup, FadeOutTime));
         }
     }
     else
     {
         if (ShowLoadScreen)
         {
             managerCallback.Canvas.ShowLoadScreen(FadeOutTime, FadeOtherElements);
         }
         else
         {
             managerCallback.Canvas.HideLoadScreen(FadeOutTime, FadeOtherElements);
         }
         return(null);
     }
 }
        public override IEnumerator Execute(UVNFManager managerCallback, UVNFCanvas canvas)
        {
            float currentTime = 0f;

            while (currentTime < WaitTime)
            {
                currentTime += Time.deltaTime;
                yield return(null);
            }
        }
 public override IEnumerator Execute(UVNFManager managerCallback, UVNFCanvas canvas)
 {
     if (Beep)
     {
         return(canvas.DisplayText(Dialogue, CharacterName, BoopSoundEffect, managerCallback.AudioManager, MaxPitch, BeepOnVowel));
     }
     else
     {
         return(canvas.DisplayText(Dialogue, CharacterName, DialogueClip, managerCallback.AudioManager));
     }
 }
Beispiel #6
0
 public override IEnumerator Execute(UVNFManager managerCallback, UVNFCanvas canvas)
 {
     if (ObjectToSpawn != null)
     {
         _spawnedObject = Instantiate(ObjectToSpawn);
     }
     else
     {
         Debug.LogError("Spawn Object Element doesn't contain an element to Instantiate.");
     }
     return(null);
 }
Beispiel #7
0
 public override IEnumerator Execute(UVNFManager managerCallback, UVNFCanvas canvas)
 {
     if (Fade)
     {
         canvas.ChangeBackground(NewBackground, FadeTime);
     }
     else
     {
         canvas.ChangeBackground(NewBackground);
     }
     return(null);
 }
 public override IEnumerator Execute(UVNFManager managerCallback, UVNFCanvas canvas)
 {
     if (Crossfade)
     {
         managerCallback.AudioManager.CrossfadeBackgroundMusic(BackgroundMusic, CrossfadeTime);
     }
     else
     {
         managerCallback.AudioManager.PlayBackgroundMusic(BackgroundMusic);
     }
     yield return(null);
 }
Beispiel #9
0
 public override IEnumerator Execute(UVNFManager managerCallback, UVNFCanvas canvas)
 {
     if (WaitForAudio)
     {
         Task task = new Task(managerCallback.AudioManager.PlaySoundCoroutine(AudioClip, Volume), true);
         while (task.Running)
         {
             yield return(null);
         }
     }
     else
     {
         managerCallback.AudioManager.PlaySound(AudioClip, Volume);
     }
 }
Beispiel #10
0
        public override IEnumerator Execute(UVNFManager managerCallback, UVNFCanvas canvas)
        {
            switch (Variables.Variables[VariableIndex].ValueType)
            {
            case VariableTypes.Number:
                switch (MathType)
                {
                case MathAffectTypes.Add:
                    Variables.Variables[VariableIndex].NumberValue += NumberValue; break;

                case MathAffectTypes.Subtract:
                    Variables.Variables[VariableIndex].NumberValue -= NumberValue; break;

                case MathAffectTypes.Divide:
                    Variables.Variables[VariableIndex].NumberValue /= NumberValue; break;

                case MathAffectTypes.Multiply:
                    Variables.Variables[VariableIndex].NumberValue *= NumberValue; break;
                }
                break;

            case VariableTypes.String:
                switch (StringType)
                {
                case StringAffectTypes.Add:
                    Variables.Variables[VariableIndex].TextValue += TextValue; break;

                case StringAffectTypes.Remove:
                    Variables.Variables[VariableIndex].TextValue = Variables.Variables[VariableIndex].TextValue.Replace(TextValue, ""); break;

                case StringAffectTypes.Replace:
                    Variables.Variables[VariableIndex].TextValue = TextValue; break;
                }
                break;

            case VariableTypes.Boolean:
                Variables.Variables[VariableIndex].BooleanValue = BooleanValue; break;
            }
            return(null);
        }
Beispiel #11
0
        public override IEnumerator Execute(UVNFManager managerCallback, UVNFCanvas canvas)
        {
            List <string> choiceList = Choices;

            if (ShuffleChocies)
            {
                choiceList.Shuffle();
            }

            canvas.DisplayChoice(choiceList.ToArray(), HideDialogue);
            while (canvas.ChoiceCallback == -1)
            {
                yield return(null);
            }

            if (DynamicPorts.ElementAt(canvas.ChoiceCallback).IsConnected)
            {
                int choice = canvas.ChoiceCallback;
                canvas.ResetChoice();
                managerCallback.AdvanceStoryGraph(DynamicPorts.ElementAt(choice).Connection.node as StoryElement);
            }
        }
 public override IEnumerator Execute(UVNFManager managerCallback, UVNFCanvas canvas)
 {
     managerCallback.CharacterManager.ChangeCharacterSprite(CharacterName, NewSprite);
     return(null);
 }
Beispiel #13
0
 public override IEnumerator Execute(UVNFManager gameManager, UVNFCanvas canvas)
 {
     return(canvas.DisplayText(Dialogue, CharacterName));
 }
Beispiel #14
0
 public override IEnumerator Execute(UVNFManager managerCallback, UVNFCanvas canvas)
 {
     managerCallback.CharacterManager.MoveCharacterTo(Character, CharacterToMoveTo, MoveTime);
     return(null);
 }
Beispiel #15
0
 public override IEnumerator Execute(UVNFManager managerCallback, UVNFCanvas canvas)
 {
     managerCallback.CharacterManager.RemoveCharacter(CharacterName, ExitPosition, ExitTime);
     return(null);
 }
Beispiel #16
0
 public override IEnumerator Execute(UVNFManager managerCallback, UVNFCanvas canvas)
 {
     Debug.Log(LogText);
     return(null);
 }
Beispiel #17
0
 public abstract IEnumerator Execute(UVNFManager managerCallback, UVNFCanvas canvas);
Beispiel #18
0
 public override IEnumerator Execute(UVNFManager managerCallback, UVNFCanvas canvas) { return null; }
Beispiel #19
0
 public override IEnumerator Execute(UVNFManager managerCallback, UVNFCanvas canvas)
 {
     managerCallback.CharacterManager.AddCharacter(CharacterName, Character, Flip, EnterFromDirection, FinalPosition, EnterTime);
     return(null);
 }