public void FadeAndLoadScene(SceneReaction sceneReaction) { if (!isFading) { StartCoroutine(FadeAndSwitchScenes(sceneReaction.sceneName)); } }
///////////////// END USING ZEBEDEE SDK //////////////////////////////////////////////// // This is the main external point of contact and influence from the rest of the project. // This will be called by a SceneReaction when the player wants to switch scenes. public void FadeAndLoadScene(SceneReaction sceneReaction) { // If a fade isn't happening then start fading and switching scenes. if (!isFading) { StartCoroutine(FadeAndSwitchScenes(sceneReaction.sceneName)); } }
// Called by SceneReaction (when Player switches Scenes) // Main External Point of Contact and Influence from rest of Project public void FadeAndLoadScene(SceneReaction sceneReaction) { // If Not Fading-to-Black yet if (!isFading) { // Start Fading to Black StartCoroutine(FadeAndSwitchScene(sceneReaction.sceneName)); } }
// This is the main external point of contact and influence from the rest of the project. // This will be called by a SceneReaction when the player wants to switch scenes. public void FadeAndLoadScene(SceneReaction sceneReaction) { // If a fade isn't happening then start fading and switching scenes. if (!sceneScreenFader.isFading) { if (playerSaveData && !initialStartingPositionName.Equals("")) { // Save the StartingPosition's name to the data asset. playerSaveData.Save(StartingPosition.startingPositionKey, sceneReaction.startingPointInLoadedScene); } StartCoroutine(FadeAndSwitchScenes(sceneReaction.sceneName)); startingSceneName = sceneReaction.name; initialStartingPositionName = sceneReaction.startingPointInLoadedScene; } }
public void FadeAndLoadScene(SceneReaction sceneReaction) { StartCoroutine(SwitchScenes(sceneReaction.sceneName)); }
public static Dictionary <string, ConditionCollection> nodeA() { GameObject nodeAgo = nodes.GetNode("A"); SceneSounds ss = FindObjectOfType <SceneSounds> (); AudioReaction whoosh_sound = new AudioReaction(); whoosh_sound.audioSource = nodeAgo.GetComponent <AudioSource>() as AudioSource; whoosh_sound.audioClip = ss.getSceneSoundByName("movewhoosh").clip; whoosh_sound.delay = 0.0f; //float right ConditionCollection cc = new ConditionCollection(); ReactionCollection temp_react_collection = new ReactionCollection(); MoveReaction temp_react = new MoveReaction(); temp_react.destination = "B"; temp_react_collection.reactions = new Reaction[] { temp_react, whoosh_sound }; cc.reactionCollection = temp_react_collection; Condition temp_cond = new Condition(); temp_cond.toEval = () => { return(true); }; cc.requiredConditions = new Condition[] { temp_cond }; //float left ConditionCollection floatleftcc = new ConditionCollection(); ReactionCollection floatleft_react_collection = new ReactionCollection(); ReactionCollection floatleft_negreact_collection = new ReactionCollection(); PlayerTextReaction floatleft_react = new PlayerTextReaction(); floatleft_react.message = "I'm outta here."; floatleft_react.delay = 0f; SceneReaction win_reaction = new SceneReaction(); win_reaction.delay = 0; win_reaction.toLoad = 3; floatleft_react_collection.reactions = new Reaction[] { floatleft_react, win_reaction }; PlayerTextReaction floatleft_neg_react = new PlayerTextReaction(); floatleft_neg_react.message = "I can't get out ... London La Croix will see."; floatleft_neg_react.delay = 0f; AudioReaction nooutside_react_sound = new AudioReaction(); nooutside_react_sound.audioSource = nodeAgo.GetComponent <AudioSource>() as AudioSource; nooutside_react_sound.audioClip = ss.getSceneSoundByName("nooutside").clip; nooutside_react_sound.delay = 0.0f; floatleft_negreact_collection.reactions = new Reaction[] { floatleft_neg_react, nooutside_react_sound }; floatleftcc.reactionCollection = floatleft_react_collection; floatleftcc.negReactionCollection = floatleft_negreact_collection; Condition floatleft_cond = new Condition(); floatleft_cond.toEval = () => { return((bool)GameData.GlobalBools["can_exit_tent"]); }; floatleftcc.requiredConditions = new Condition[] { floatleft_cond }; floatleftcc.reactionCollection.DoInit(); floatleftcc.negReactionCollection.DoInit(); //look ConditionCollection cclook = new ConditionCollection(); ReactionCollection look_react_collection = new ReactionCollection(); PlayerTextReaction look_react = new PlayerTextReaction(); look_react.message = "UGH! this music... gotta break out of here."; look_react.delay = 0.0f; AudioReaction concert_react_sound = new AudioReaction(); concert_react_sound.audioSource = nodeAgo.GetComponent <AudioSource>() as AudioSource; concert_react_sound.audioClip = ss.getSceneSoundByName("concert").clip; concert_react_sound.delay = 0.0f; look_react_collection.reactions = new Reaction[] { look_react, concert_react_sound }; Condition always_true_cond = new Condition(); always_true_cond.toEval = () => { return(true); }; cclook.reactionCollection = look_react_collection; cclook.requiredConditions = new Condition[] { always_true_cond }; cclook.reactionCollection.DoInit(); Dictionary <string, ConditionCollection> htm = new Dictionary <string, ConditionCollection>(); htm.Add("float right", cc); htm.Add("float left", floatleftcc); htm.Add("look", cclook); return(htm); }
protected override void Init() { targetReaction = target as SceneReaction; }
SceneReaction sceneReaction; // Esto habría que cribarlo... private void Start() { sceneReaction = FindObjectOfType <SceneReaction>(); }
public void FadeAndLoadScene(SceneReaction sceneReaction) { }