public void setTalking() { currentScene = sceneState.talking; setted = true; count = 0; //Debug.Log ("call the function"); }
void camEnabled() { if (wait() <= 4.4) { currentState = sceneState.standUp; cam [0].enabled = true; cam [1].enabled = false; cam [2].enabled = false; cam [3].enabled = false; } else if (wait() <= 25) { currentState = sceneState.walk; cam [0].enabled = false; cam [1].enabled = true; cam [2].enabled = false; cam [3].enabled = false; } else if (wait() <= 70) { currentState = sceneState.sitDown; cam [0].enabled = false; cam [1].enabled = false; cam [2].enabled = true; cam [3].enabled = false; } else { currentState = sceneState.fireplace; cam [0].enabled = false; cam [1].enabled = false; cam [2].enabled = false; cam [3].enabled = true; } }
void sceneSet() { if (wait() <= 14) { currentScene = sceneState.laying; cam [0].enabled = true; cam [1].enabled = false; cam [2].enabled = false; cam [3].enabled = false; } else if (wait() <= 37) { currentScene = sceneState.crying; cam [0].enabled = false; cam [1].enabled = true; cam [2].enabled = false; cam [3].enabled = false; } else if (setted == false) { cam [0].enabled = false; cam [1].enabled = false; cam [2].enabled = true; isHide = true; cam [3].enabled = false; currentScene = sceneState.walking; } }
//private GameObject Granny1Ref; //private GraController GraControllerRef; //private GameObject Granny2Ref; //private GrannController GrannControllerRef; void Start() { anim = GetComponent <Animator> (); anim.SetBool("standUp", false); anim.SetBool("isWalk", false); anim.SetBool("isIdle", false); currentState = sceneState.standUp; title.text = ""; buttonStart.SetActive(false); music.isFade = false; //Granny1Ref = GameObject.Find ("Granny1"); //GraControllerRef = Granny1Ref.GetComponent<GraController> (); //Granny2Ref = GameObject.Find ("Granny2"); //GrannControllerRef = Granny2Ref.GetComponent<GrannController> (); }
public void returnTalk() { currentScene = sceneState.talking; }
public void setDepature() { currentScene = sceneState.departure; }
public void setGameOver() { currentScene = sceneState.gameover; }
// Update is called once per frame void OnGUI() { bool loadNextScene = false; sceneState nextState = sceneState.SCENESTATE_EMPTY; int yPos = 100; int height = 30; int width = 150; if (GUI.Button(new Rect(10, yPos += height, width, height), "ResetCar")) { GameObject.FindObjectOfType <extCarMotionController>().CalibrateCar(); ControllerInfo += "Resetting CarPosition"; } if (GUI.Button(new Rect(10, yPos += height, width, height), "Callibrate Seat")) { GameObject.FindObjectOfType <seatCallibration>().reCallibrate(); ControllerInfo += "Callibrating Seat"; } if (GUI.Button(new Rect(10, yPos += height, width, height), "findGPSPosition")) { GameObject.FindObjectOfType <extCarMotionController>().estimateCarPositionWithGPS = true; ControllerInfo += "find GPS Position"; } if (GUI.Button(new Rect(10, yPos += height, width, height), "Change to: " + Normal)) { loadNextScene = true; nextState = sceneState.SCENESTATE_NORMAL; } if (GUI.Button(new Rect(10, yPos += height, width, height), "Change to: " + Condition1)) { loadNextScene = true; nextState = sceneState.SCENESTATE_CON1; } if (GUI.Button(new Rect(10, yPos += height, width, height), "Change to: " + Condition2)) { loadNextScene = true; nextState = sceneState.SCENESTATE_CON2; } if (updController.forward) { if (GUI.Button(new Rect(10, yPos += height, width, height), "Go Backwards")) { updController.forward = false; } } else { if (GUI.Button(new Rect(10, yPos += height, width, height), "Go Forwards")) { updController.forward = true; } } if (GUI.Button(new Rect(10, yPos += height, width, height), "Control Speed")) { overWriteSpeed = !overWriteSpeed; if (overWriteSpeed) { speedValue = (float)updController.speed; } } if (overWriteSpeed) { GUIStyle style = new GUIStyle(); style.alignment = TextAnchor.MiddleCenter; style.fontSize = 16; GUI.Label(new Rect(10, yPos += height, width, height), (speedValue * 3.6f).ToString("F2") + "km/h", style); speedValue = GUI.HorizontalSlider(new Rect(10, yPos += height, width, height), speedValue, 0.0F, 22.0F); updController.speed = (double)speedValue; } if (GUI.Button(new Rect(10, yPos += height, width, height), "Open Door")) { GameObject.FindObjectOfType <interactingObjectDoor>().openDoor(); } if (GUI.Button(new Rect(10, yPos += height, width, height), "Close Door")) { GameObject.FindObjectOfType <interactingObjectDoor>().closeDoor(); } if (GUI.Button(new Rect(10, yPos += height, width, height), "Reset Door")) { GameObject.FindObjectOfType <interactingObjectDoor>().resetDoor(); } if (loadNextScene) { // first we unload switch (currentState) { case sceneState.SCENESTATE_EMPTY: break; case sceneState.SCENESTATE_NORMAL: SceneManager.UnloadSceneAsync(Normal); break; case sceneState.SCENESTATE_CON1: SceneManager.UnloadSceneAsync(Condition1); break; case sceneState.SCENESTATE_CON2: SceneManager.UnloadSceneAsync(Condition2); break; } log_message sceneUpdateMessage = new log_message(); sceneUpdateMessage.origin = transform.name; sceneUpdateMessage.time = Time.time; sceneUpdateMessage.valueName = "loadScene"; AsyncOperation currentOpperation; switch (nextState) // then we load the next one { case sceneState.SCENESTATE_EMPTY: sceneUpdateMessage.value = 0; sceneFinishedLoading(); break; case sceneState.SCENESTATE_NORMAL: sceneUpdateMessage.value = 1; currentOpperation = SceneManager.LoadSceneAsync(Normal, LoadSceneMode.Additive); coroutine = reportFinished(currentOpperation); StartCoroutine(coroutine); break; case sceneState.SCENESTATE_CON1: sceneUpdateMessage.value = 2; currentOpperation = SceneManager.LoadSceneAsync(Condition1, LoadSceneMode.Additive); coroutine = reportFinished(currentOpperation); StartCoroutine(coroutine); break; case sceneState.SCENESTATE_CON2: sceneUpdateMessage.value = 3; currentOpperation = SceneManager.LoadSceneAsync(Condition2, LoadSceneMode.Additive); coroutine = reportFinished(currentOpperation); StartCoroutine(coroutine); break; } transform.GetComponent <logger>().LogMessage(sceneUpdateMessage); // last step is remebering our new state currentState = nextState; } }
void Start() { currentState = sceneState.SCENESTATE_EMPTY; ControllerInfo = ""; updController = GameObject.FindObjectOfType <UDPReceive>(); }
// Update is called once per frame void Update() { switch (currentScene) { case sceneState.heal: cam [0].enabled = true; cam [1].enabled = false; anna1.SetActive(true); anna2.SetActive(false); anna3.SetActive(false); anna4.SetActive(false); granny.SetActive(true); effect.SetActive(true); cam3.SetActive(false); timer += Time.deltaTime; if (timer <= 17) { granny.GetComponent <Animator> ().SetBool("isHeal", true); if (timer <= 8.5) { textD.text = "Granny healed the girl with magic."; } else { textD.text = "Then, they lived a happy life together."; } } else { timer = 0; currentScene = sceneState.run; } break; case sceneState.run: textD.text = ""; timer += Time.deltaTime; cam [0].enabled = false; cam [1].enabled = true; cam [1].GetComponent <Animator> ().SetBool("isMove", true); anna1.SetActive(false); anna2.SetActive(true); anna4.SetActive(false); granny.SetActive(false); effect.SetActive(false); cam3.SetActive(false); if (timer <= 15) { anna3.SetActive(false); } else if (timer <= 30) { anna3.SetActive(true); } else { timer = 0; currentScene = sceneState.end; } break; case sceneState.end: timer += Time.deltaTime; cam [0].enabled = false; cam [1].enabled = false; cam3.SetActive(true); anna1.SetActive(false); anna2.SetActive(false); anna4.SetActive(false); granny.SetActive(false); effect.SetActive(false); anna4.SetActive(true); if (timer >= 20) { nextScene(); } break; } }
public void PlayNextScenario(Scenario scenario) { Buttons.Instance.ChangeStatusUI(false); SwipingObject.Instance.ReturnCameraToDefaultPosition(); Dialogues.Instance.PlayTransission(); StopAllAnimations(); currentSceneState = sceneState.transission; curScenario = scenario; base.GetData(scenario.groups, AnimationScenarioEnd); CallWorkWithScenario(); currStage++; ChameleonController.Instance.ChangeColorChamiDuringTransission(currStage); StoryDrawer.Instance.LoadText(); }