void UpdateState(ScanSceneState s) { state = s; if (s == ScanSceneState.FuShown) { //state = ScanSceneState.FuShown; qifuPanel.SetActive(false); fuPanel.SetActive(true); int year = DateTime.Now.Year; //Text yTxt = fuPanel.GetChildByNameInChildren ("Year").GetComponent<Text> (); //Text yTxt2 = fuPanel.GetChildByNameInChildren ("Year2").GetComponent<Text> (); GameObject yearObj = fuPanel.GetChildByNameInChildren("YearImg"); yearObj.ShowChildByName(year.ToString()); // if (year == 2018) { // yTxt.text = "二零一八"; // yTxt2.text = "戊戌年"; // } else if (year == 2019) { // yTxt.text = "二零一九"; // yTxt2.text = "己亥年"; // } else { // yTxt.text = "二零一七"; // yTxt2.text = "丁酉年"; // } GetRandomFu(); } else if (s == ScanSceneState.EnterName) { //sceneComponents["scroll"].Reset(); qifuButton.SetActive(false); namePanel.SetActive(true); namePanel.GetComponent <Scroll> ().Play(); Invoke("SelectInputField", 1); //inputField.Select (); inputField.ActivateInputField(); } else if (s == ScanSceneState.AnimationAfterName) { namePanel.SetActive(false); btnBack.SetActive(true); guanyinAnimator.Play("Play"); sceneComponents ["falun"].Play(); raysContainer.SetActive(true); delayCall.Call(3f, () => { qifuPanel.SetActive(true); qifuPanel.GetComponent <Scroll> ().Play(); }); fuPanel.SetActive(false); //delayCall.Call (10f, ()=>UpdateState (ScanSceneState.FuShown)); qifuText.text = inputField.text; AudioSource audio = GetAudioSource(); audio.clip = dabeizhouClip; if (!audio.isPlaying) { audio.Play(); audio.volume = 0; audioVolume = -.2f; } } }
//if forceOverride prev state = prev state return function; public void SetState(string name, Hashtable args = null, bool forceOverride = true) { if (state != null && state.name == name && !forceOverride) { return; } if (state != null) { state.OnExit(); Logger.Log("leaving scene: " + state.ToString(), "green"); } Logger.Log("scene: " + name, "green"); state = ScanSceneState.GetState(name); state.scene = this; state.OnEnter(args); }
public void PlayAnimation() { Debug.Log("PlayAnimation"); btnBack.SetActive(false); infoPanel.SetActive(false); btnInfo.SetActive(false); scanner.SetActive(false); //StartCoroutine(startLightController.ShowLight()); playing = true; //state = ScanSceneState.AnimationAfterTrack; delayCall.Call(1f, () => { //startLightController.Play (); sceneComponents ["sparkle"].Play(); }); delayCall.Call(3.5f, () => { state = ScanSceneState.GuanyinShow; guanyin.SetActive(true); guanyin.transform.position = guanyinPath.transform.position; // - new Vector3(0, .1f, 0); guanyin.transform.localScale = Vector3.zero; guanyin.transform.DOScale(3, 3f).SetEase(Ease.OutQuad); }); //dizuo.transform.localPosition = new Vector3 (dizuoPosition.x, dizuoPosition.y - 0.5f, dizuoPosition.z); Vector3 cameraDir = Camera.main.transform.forward; //guanyin.transform.parent.LookAt (new Vector3(-cameraDir.x, 0, -cameraDir.z)); delayCall.Call(4f, () => { headLight.enabled = true; state = ScanSceneState.GuanyinMove; ParticleSystem guanyinCloudParticle = guanyinCloud.GetComponent <ParticleSystem> (); guanyinCloudParticle.Play(); //guanyinCloud = guanyin.GetChildByNameInChildren ("Cloud_GuanYin"); //this.guanyinMoving = true; Debug.Log("delayCall guanyin"); //tweener = guanyin.transform.DOLocalMove(guanyinPosition, 5f).SetEase(Ease.OutQuad); //guanyin.transform.DOLocalMove(guanyinPosition, 5f).SetEase(Ease.Linear); /////////////////////wo xie de /*List<GameObject> pathPointList = guanyinPathData.pathPointData; * int pathPointIndex = 0; * foreach(GameObject pathPoint in pathPointList){ * // delayCall.Call(pathPointIndex, ()=>{ * guanyin.transform.DOLocalMove(pathPoint.transform.localPosition, 1f).SetEase(Ease.Linear); * }); * pathPointIndex++; * }*/ /////////////////////wo xie de guanyin.transform.DOScale(guanyinScale, 5f).SetEase(Ease.OutQuad); guanyin.transform.DOLocalRotate(new Vector3(0, 180, 0), 5f).SetEase(Ease.OutQuad); }); // delayCall.Call (2f, () => { // dizuo.transform.DOScale (Vector3.one, 2f).SetEase (Ease.OutQuart); // }); // inputDelayCall.Call(9f, ()=>{ // canvas.SetActive (true); // }); // delayCall.Call(5f, ()=>{ // falun.transform.SetParent(ARCamera.gameObject.transform); // falun.transform.DOLocalMove( ARCamera.gameObject.transform.InverseTransformPoint(ARCamera.gameObject.transform.forward) * .1f, 5f).SetEase(Ease.OutQuad); // }); delayCall.Call(8f, () => { qifuButton.SetActive(true); //enterNameMoving = true; //state = ScanSceneState.ShowScroll; //sceneComponents["scroll"].Play(); // }); cloudMoving = true; }