// Update is called once per frame void Update() { if (!isDead) { DecreaseStatus(); } interactTimer += Time.deltaTime; if (interactTimer > interactRate) { interactTimer = interactRate; } if (hasInputFocus && !isDead) { GetInputs(); } else { body.velocity = Vector2.zero; animator.SetBool("Movement", false); } if (isDead) { tooltipgui.text = "You're totally dying, press 'R' to give up."; if (Input.GetKeyDown(KeyCode.R)) { DOTween.KillAll(); SceneManager.LoadScene("Failed"); } } }
private void Jump() { if (_sprintPath.Count == 0) { return; } GameObject lastPlatform = _sprintPath[_sprintPath.Count - 1]; Vector3 jumpPosition = new Vector3(transform.position.x, transform.position.y, transform.position.z); if (_MoveonXDirection) { float posX = lastPlatform.transform.position.x + _sprintPath.Count + 1; jumpPosition = new Vector3(posX, jumpPosition.y, lastPlatform.transform.position.z); } else { float posZ = lastPlatform.transform.position.z + _sprintPath.Count + 1; jumpPosition = new Vector3(lastPlatform.transform.position.x, jumpPosition.y, posZ); } DOTween.KillAll(); transform.DOJump(jumpPosition, _force, 1, _jumpTime) .SetEase(Ease.Linear) .OnStart(() => { _inJump = true; }) .OnComplete(() => { _inJump = false; }); }
void OnSceneLoaded(Scene scene, LoadSceneMode mode) { StopAllCoroutines(); print(DOTween.KillAll()); if (!hasStarted || SceneManager.GetActiveScene().buildIndex != SceneManager.GetSceneByName("FinalPlat").buildIndex) { return; } isRecording = false; if (recordingTimeline != null && recordingTimeline.Count > 0) { allTimelines.Add(new List <Vector3>(recordingTimeline)); } SetupRecordingTimeline(); if (allTimelines.Count > maxTimelines) { bounceTimeline.RemoveAt(0); bouncePositions.RemoveAt(0); allTimelines.RemoveAt(0); } if (allTimelines != null && allTimelines.Count > 0) { FindObjectOfType <PlatformerReplayer>().LaunchReplay(allTimelines, bounceTimeline, bouncePositions); } }
public void OnClickHandle() { if (isMoveing) { return; } if (DOTween.TotalPlayingTweens() > 0) { DOTween.CompleteAll(); DOTween.KillAll(); return; } qy.config.StoryItem story = curDialogue.next; if (story != null) { ShowStory(story); } else { qy.config.QuestItem nextQuest = qy.GameMainManager.Instance.playerData.GetQuest(); if (nextQuest.type == qy.config.QuestItem.QuestType.Ending) { qy.GameMainManager.Instance.uiManager.OpenWindow(qy.ui.UISettings.UIWindowID.UIEndingWindow, nextQuest); } else { qy.GameMainManager.Instance.uiManager.OpenWindow(qy.ui.UISettings.UIWindowID.UITaskWindow, qy.GameMainManager.Instance.playerData); } qy.GameMainManager.Instance.weatherManager.StopAll(); OnClickClose(); } }
IEnumerator RestartScene() { yield return(new WaitForSeconds(5f)); DOTween.KillAll(false); SceneManager.LoadScene("main"); }
public override void finish(float duration) { alive = false; DOTween.KillAll(); Destroy(this.gameObject, duration); }
void EndGame() { DOTween.KillAll(); ball.DOLocalMoveY(-20f, 1f); doMovement = false; GameManager.Instance.EndGame(); }
// Update is called once per frame void Update() { keyCont(); //最初の一回で代入先のtextureを初期化 if (webcamTexture.width > 16 && webcamTexture.height > 16 && !webcamIsPlaying) { SetTextureInit(); webcamIsPlaying = true; } if (webcamIsPlaying) { if (Input.GetKeyDown(KeyCode.Return)) { isLate = !isLate; if (isLate) { DOTween.To(() => lateTime, x => lateTime = x, 0.0f, lateSpeed); } else { DOTween.To(() => lateTime, x => lateTime = x, lateSec, lateSpeed); } } if (Input.GetKeyDown(KeyCode.Backspace)) { DOTween.KillAll(); } Debug.Log(lateTime); StartCoroutine(MovieLateCoroutine(lateTime)); } }
void OnGUI() { if (GUILayout.Button("Tween")) { CreateTweens(); } if (GUILayout.Button("Kill All & Create Tweens")) { DOTween.KillAll(); CreateTweens(); } if (GUILayout.Button("Kill All & Create Tweens Combo")) { DOTween.KillAll(); CreateTweens(); DOTween.KillAll(); CreateTweens(); DOTween.KillAll(); CreateTweens(); DOTween.KillAll(); CreateTweens(); } if (GUILayout.Button("Kill All")) { DOTween.KillAll(); } }
void Update() { if (camera_moving_direction == LEFT) { /* Moving camera for left */ if (camera_transform.position.x > -1 * ViewWidth * 0.8f) { camera_transform.Translate(-1 * camera_transform.right * ViewMovingSpeed * Time.deltaTime); } } else if (camera_moving_direction == RIGHT) { /* Moving camera for right */ if (camera_transform.position.x < ViewWidth * 0.8f) { camera_transform.Translate(camera_transform.right * ViewMovingSpeed * Time.deltaTime); } } if (focused && CameraTargetPosition != CameraDomovePosition) { DOTween.KillAll(); CameraTargetPosition = CameraDomovePosition; //Debug.Log("Target = " + CameraTargetPosition); //Debug.Log("DOMove = " + CameraDomovePosition); camera_transform.DOMove(CameraTargetPosition, 1.5f); } }
/// <summary> /// 切换场景 /// </summary> /// <param PlayerName="sceneName"></param> private void SwitchScene(LoadSceneInfo info) { Timer.Instance.CancelAllTimer(); GameMgr.Instance.StopAllCoroutines(); ResourcesMgr.Instance.ClearPool(); AudioSystem.Instance.StopAllAudio(); DOTween.KillAll(true); switch (info.type) { case (LoadSceneType.SYNC): LoadSceneSync(info); break; case (LoadSceneType.ASYNC): if (SceneManager.GetActiveScene().buildIndex != ESceneID.SCENE_START.GetHashCode()) { UIManager.Instance.StartSaveScreen(UIManager.Instance.UpdateScreenBg); } GameMgr.Instance.StartCoroutine(LoadSceneAsync(info)); break; default: Debug.LogError("错误信息: SceneName:" + info.sceneID.ToString() + " Type:" + info.type.ToString() + " Model:" + info.mode.ToString()); break; } }
public void BackStage() { if (sceneManager.IsLoading) { return; } DOTween.KillAll(); sceneManager.UnloadAsyncAllSubScenes(() => { sceneManager.UnloadAsyncScene(GetStageName(), () => { if (CurrentStageCount <= 0) { CurrentStageCount = 0; } else { CurrentStageCount--; } if (ProgressCount <= 0) { ProgressCount = 0; } else { ProgressCount--; } UI.Initialize(); sceneManager.LoadAsyncScene(GetStageName(), null, (scene) => { SetStageName(ProgressCount); }); }); }); }
public void ProgressStage() { if (sceneManager.IsLoading) { return; } DOTween.KillAll(); sceneManager.UnloadAsyncAllSubScenes(() => { sceneManager.UnloadAsyncScene(GetStageName(), () => { if (CurrentStageCount >= StageMax - 1) { CurrentStageCount = 0; } else { CurrentStageCount++; } ProgressCount++; UI.Initialize(); sceneManager.LoadAsyncScene(GetStageName(), null, (scene) => { SetStageName(ProgressCount); }); }); }); }
void LoadPage3() { if (cur != 2) { //빠르게 클릭 했을 때 오류를 막기 위한 코딩 DOTween.KillAll(); //1와 3 dofade 0.3 & 1,3 move to thier each position CG_Page1.DOFade(0f, pagingDura).SetEase(pagingEase).OnComplete(() => { RT_Page1.DOAnchorPosX(nextOrg, 0); CG_Page1.DOFade(1f, 0f).SetDelay(0.1f); }); CG_Page2.DOFade(0f, pagingDura).SetEase(pagingEase).OnComplete(() => { RT_Page2.DOAnchorPosX(prevOrg, 0); CG_Page2.DOFade(1f, 0f).SetDelay(0.1f); }); //1 alpha = 0 and move to position 0 & 1 do fade to 1 0.2 CG_Page3.alpha = 0; RT_Page3.DOAnchorPosX(0, 0).SetDelay(0.2f).OnComplete(() => { CG_Page3.DOFade(1f, 0).SetEase(pagingEase); }); prev = 1; cur = 2; next = 0; //언더라인 DoUnderline(); ServiceSVHandler.isBarFixed = false; } }
private void FixedUpdate() { if (gameController.GameStatusEnum == GameStatus.JUMPSTAY) { anim.SetBool("Jump", true); animTimeControl = true; } if (animTimeControl) { animTime += Time.fixedDeltaTime; if (animTime > 0.25f) { anim.SetBool("Jump", false); if (Physics.Raycast(transform.GetChild(0).position, Vector3.down, out RaycastHit hit)) { ringCounter++; gameController.GameStatusEnum = GameStatus.EMPTY; } else { if (gameController.GameStatusEnum != GameStatus.FINISH) { gameController.GameStatusEnum = GameStatus.FINISH; DOTween.KillAll(); StartCoroutine(Finish()); } } animTime = 0; animTimeControl = false; } } }
// Use this for initialization IEnumerator Init() { while (true) { foreach (var s in additionalLines) { Text += s; if (currentPosition < Text.Length) { if (Text[currentPosition] == '<') { GetComponent <TextMeshProUGUI>().text += "<br>"; currentPosition += 4; } else if (Text[currentPosition] == '@') { canvas.GetComponent <CanvasGroup>().DOFade(0, 2f).OnComplete(() => { DOTween.KillAll(); SceneManager.LoadScene("LOGIN"); }); } else { GetComponent <TextMeshProUGUI>().text += Text[currentPosition]; currentPosition++; } } yield return(new WaitForSeconds(Delay)); } } }
void Reset() { DOTween.KillAll(); isMoving = false; State.DoReset(); Refresh(); }
void CheckRelease() { //全ての開放表示したあと if (modeNum.Count == 0) { //念の為Kill if (DOTween.instance != null) { DOTween.KillAll(); } clearMessage.SetActive(false); //移動 footerButton_1.OnFooterButton(); //レシピ集の開放 if (releaseRecipe) { tutorialNum = 1; ShowMissionTutorial(); } return; } ClearMissionAnimation(false, modeNum[0]); }
/// <summary> /// Restart the game. /// </summary> public void Restart() { DOTween.KillAll(); Time.timeScale = 1.0f; Application.LoadLevel("Game"); }
IEnumerator CheckAnimation() { foreach (int num in newCheckNum) { if (!MenuSetting.instance.cutMissionClear) { yield return(new WaitForSeconds(2)); } //checkerParentTransfrom.GetChild(num).GetComponent<CheckerButtonController>().clearNum = 1; checkerParentTransfrom.GetChild(num).GetComponent <CheckerButtonController>().OnCheckerButton(); checkerParentTransfrom.GetChild(num).GetComponent <CheckerButtonController>().ChangeClearView(); PlayerPrefs.SetInt("MISSION_" + num, 1); } PlayerPrefs.Save(); yield return(new WaitForSeconds(2)); //念の為Kill if (DOTween.instance != null) { DOTween.KillAll(); } clearMessage.SetActive(false); ReleaseMode(); }
public void ContinueCurrentLevel() { retryMenu.SetActive(false); DOTween.KillAll(); gameOver = false; waterLimit += 15; }
IEnumerator _TransitScene(int sceneIndex, float delay) { Transiting = true; _blockTouch.SetActive(true); yield return(new WaitForSeconds(delay)); _fadeBackg.DOFade(1, _transitTime); yield return(new WaitForSeconds(_transitTime)); DOTween.KillAll(); PreviousScene = CurrentScene; CurrentScene = sceneIndex; SceneManager.LoadScene(sceneIndex); _fadeBackg.DOFade(0, _transitTime); yield return(new WaitForSeconds(_transitTime)); _blockTouch.SetActive(false); Transiting = false; }
public void ShowLeave() { //if (surrender) //{ // surrenderTextObj.SetActive(true); //} //else //{ // resultTextImage.sprite = systemTextSprite[0]; //} if (DOTween.instance != null) { DOTween.KillAll(); } resultTextImage.transform.localPosition = new Vector2(0f, 0f); resultTextImage.transform.DOLocalMoveY(20f, 0.4f) .SetRelative(true) .SetEase(Ease.OutQuad) .SetLoops(-1, LoopType.Yoyo); resultTextImage.sprite = systemTextSprite[0]; roadingObj.SetActive(false); restartButtonObj.SetActive(false); quitButtonObj.SetActive(false); }
public override void OnEnter() { int numberOfTweensKilled = 0; if (idsToExclude.Length > 0) { string[] idList = new string[idsToExclude.Length]; for (int i = 0; i < idList.Length; i++) { idList[i] = idsToExclude[i].Value; } numberOfTweensKilled = DOTween.KillAll(complete.Value, idList); } else { numberOfTweensKilled = DOTween.KillAll(complete.Value); } if (debugThis.Value) { Debug.Log("GameObject [" + State.Fsm.GameObjectName + "] FSM [" + State.Fsm.Name + "] State [" + State.Name + "] - DOTween Control Methods Kill All - SUCCESS! - Killed " + numberOfTweensKilled + " tweens"); } Finish(); }
public void FinishRound(Round round) { if (round.WinnerTeam == PlayerManager.Team.None) { DOTween.KillAll(); LoadingScreen.Instance.LoadScene(gameSceneIndex); return; } FinishedRounds.Add(round); int leftWonRounds = WonRounds(PlayerManager.Team.Left); int rightWonRounds = WonRounds(PlayerManager.Team.Right); if (leftWonRounds < RequiredWinningRounds && rightWonRounds < RequiredWinningRounds) { DOTween.KillAll(); LoadingScreen.Instance.LoadScene(gameSceneIndex); } else { DOTween.KillAll(); Reset(); StartCoroutine(WinScreenAndMenu( leftWonRounds == RequiredWinningRounds ? PlayerManager.Team.Left : PlayerManager.Team.Right)); } }
private void Die() { if (isdying) { return; } isdying = true; GetComponent <BoxCollider2D>().isTrigger = false; DOTween.KillAll(); var seq = DOTween.Sequence(); seq .AppendCallback((() => { cams.Priority = 100; Destroy(HitpointsImage.rectTransform.parent.gameObject); anim.SetTrigger("Dead"); })) .AppendInterval(2.5f) .AppendCallback(() => { particlesystem.Play(); GetComponentsInChildren <SpriteRenderer>().ToList().ForEach(sr => sr.DOColor(Color.black, 0.25f)); }) .AppendInterval(3f) .Append(FindObjectOfType <BoidController>().DeathScreen.DOFade(1.0f, 4.0f)) .AppendCallback((() => SceneManager.LoadScene("WinEnd"))) .Play(); // Destroy(gameObject); }
void OnGUI() { if (GUILayout.Button("TogglePause")) { DOTween.TogglePauseAll(); } if (GUILayout.Button("Restart")) { DOTween.RestartAll(); } if (GUILayout.Button("Complete")) { DOTween.CompleteAll(); } if (GUILayout.Button("Rewind")) { DOTween.RewindAll(); } if (GUILayout.Button("Flip")) { DOTween.FlipAll(); } if (GUILayout.Button("Kill And Complete")) { DOTween.KillAll(true); } }
void Update() { if (flag) { DOTween.KillAll(); DOTween.To(() => 0, SetPortalRadius, currentPortalRadius, .0f).SetEase(Ease.InBack); flag = false; } //シーンからの合図で行動開始 if (PortalFlag) { material.SetTexture("_SubTex", text); var uv = camera.GetComponent <Camera>().WorldToViewportPoint(portalPos); //Debug.Log("半径" + + "半径"); material.SetVector("_Position", uv); material.SetFloat("_Aspect", Screen.height / (float)Screen.width); OpenPoral(); portalTime -= Time.deltaTime; } //現在の半径を入れる //if (Input.GetKeyDown(KeyCode.A)) //{ // Debug.Log("aa" + uv); // OpenPoral(); //} //else if (Input.GetKeyUp(KeyCode.A)) // ClosePortal(); }
void Update() { timer += Time.deltaTime; if (isCountdown) { timeToDeath -= Time.deltaTime; text.text = timeToDeath.ToString("0"); if ((int)timeToDeath != previousInt) { previousInt = (int)timeToDeath; rt.DOPunchScale(Vector3.one * 1.1f, 0.5f); } if (timeToDeath <= 0) { fadeImage.DOFade(1, 0.7f).onComplete += () => { DOVirtual.DelayedCall(2f, () => { DOTween.KillAll(); SceneManager.LoadScene(0); }); }; } } }
public void InitWinScren() { PlayerPrefs.SetInt("playerLevel", 2); _playerControlManager.canPlayerMakeMove = false; Camera.main.transform.DOMove(new Vector3(-0.1f, 1f, 0.54f), 0.5f); fruitParent.DOMoveY(0.3f, 0.5f).SetEase(Ease.OutBack).SetRelative(true).onComplete = () => { fruit.DORotateQuaternion(Quaternion.Euler(new Vector3(0, 0f, 180f)), 0.2f).SetRelative(true).SetEase(Ease.Linear); fruit.DORotateQuaternion(Quaternion.Euler(new Vector3(0, 0f, 180f)), 0.2f).SetRelative(true).SetDelay(0.19f).SetEase(Ease.Linear); fruit.DORotateQuaternion(Quaternion.Euler(new Vector3(0, 0f, 180f)), 0.2f).SetRelative(true).SetDelay(0.38f).SetEase(Ease.Linear); fruit.DORotateQuaternion(Quaternion.Euler(new Vector3(0, 0f, 180f)), 0.2f).SetRelative(true).SetDelay(0.57f).SetEase(Ease.Linear); fruit.DORotateQuaternion(Quaternion.Euler(new Vector3(0, 0f, 180f)), 0.2f).SetRelative(true).SetDelay(0.76f).SetEase(Ease.Linear); fruit.DORotateQuaternion(Quaternion.Euler(new Vector3(0, 0f, 180f)), 0.2f).SetRelative(true).SetDelay(0.95f).SetEase(Ease.Linear).onComplete = () => { fruitParent.gameObject.SetActive(false); }; }; DOVirtual.DelayedCall(0.7f, () => { winScreen.Init(); }); DOVirtual.DelayedCall(8f, () => { DOTween.KillAll(); DOTween.ClearCachedTweens(); SceneManager.LoadScene(SceneManager.GetActiveScene().name); }); }