public void BreakCountDown() { StopAllCoroutines(); Debug.Log("running"); LeanTween.cancelAll(); }
//カウンター攻撃処理 void CounterAttack() { if (counterStart == false) { changeColor = true; //プレイヤーを向かせる this.transform.rotation = Quaternion.Slerp(this.transform.rotation, targetRotate, 1.0f); LeanTween.delayedCall(1.0f, () => { //レーザー発射 GameObject laser = Instantiate(laserPrefab, attackPos_Laser.position, attackPos_Laser.rotation, this.transform); Destroy(laser, 1.0f); counterEnd = true; }); counterStart = true; } if (bossState == BossState.Die) { LeanTween.cancelAll(); } if (counterEnd == true) { changeColor = false; counterEnd = false; counterStart = false; isCounter = false; attackStartTimeCount = 0.0f; isAttackStart = false; bossState = BossState.Move; } }
public void StopPlayGame() { SaveData(todayDateString); LeanTween.cancelAll(); StopGardenAnimate(); gameState = "AnimateGarden"; }
public void RetryGame() { retrySender.OnNext(Unit.Default); LeanTween.cancelAll(true); Pushvalue2DataHolder(); SceneManager.LoadScene(0); }
public void Show(string message) { LeanTween.cancelAll(); text.text = message; LeanTween.scale(text.gameObject, Vector3.one, 0); Invoke("Hide", 0.7f); }
private IEnumerator DeleteAll() { LeanTween.cancelAll(); Localization.onLanguageChange = null; Localization.onLocalize = null; foreach (GameObject go in FindObjectsOfType <GameObject>()) { if (go != gameObject) { if (go.name != "~LeanTween") { Destroy(go); } } } yield return(new WaitForFixedUpdate()); yield return(new WaitForFixedUpdate()); yield return(new WaitForFixedUpdate()); Resources.UnloadUnusedAssets(); yield return(new WaitForFixedUpdate()); yield return(new WaitForFixedUpdate()); yield return(new WaitForFixedUpdate()); GC.Collect(); SceneManager.LoadScene(SceneName.Splash); }
// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { Application.LoadLevel("mainmenu"); } // Show red vision overlay if player's moving too fast. var minRedScale = 0.75f; if (overspeedSeverity > 0f) { var scale = 1 - overspeedSeverity * (1 - minRedScale); RedOverlay.transform.localScale = Vector3.Lerp(RedOverlay.transform.localScale, Vector3.one * scale, 1f); redOverlayGroup.alpha = Mathf.Lerp(redOverlayGroup.alpha, overspeedSeverity, 1f); } else { redOverlayGroup.alpha = Mathf.Lerp(redOverlayGroup.alpha, 0f, 1f); RedOverlay.transform.localScale = Vector3.Lerp(RedOverlay.transform.localScale, Vector3.one, 1f); } if (isGameOver) { if (Input.anyKeyDown || InputManager.ActiveDevice.AnyButton.WasPressed) { LeanTween.cancelAll(false); Application.LoadLevel("mainmenu"); } } }
private IEnumerator WaitForUser() { LeanTween.alpha(endScreen, 0f, 0f); LeanTween.alpha((RectTransform)popup.transform, 0f, 0f); yield return(null); endScreen.gameObject.SetActive(true); LeanTween.alpha(endScreen, 1f, .2f).setRecursive(false); yield return(new WaitForSeconds(.6f)); LeanTween.alphaText((RectTransform)endScreen.GetChild(0), 1f, 0f); yield return(new WaitForSeconds(1.4f)); LeanTween.alphaText((RectTransform)endScreen.GetChild(1), 1f, 0f); yield return(new WaitForSeconds(.4f)); LeanTween.alphaText((RectTransform)endScreen.GetChild(2), 1f, 0f); yield return(new WaitForSeconds(.8f)); Color color = new Color(168f / 255f, 168f / 255f, 168f / 255f, 1); LeanTween.value(0, 1, 1.5f).setLoopClamp().setOnUpdate((float val) => endScreen.GetChild(3).GetComponent <Text>().color = color * Mathf.Round(val)); yield return(new WaitUntil(() => InputManager.GetButtonDown(Button.A))); LeanTween.alpha((RectTransform)curtain.transform, 1f, .2f).setOnComplete(() => { LeanTween.cancelAll(); SceneManager.LoadScene("StartScene"); }); }
void Movement() { for (int i = 0; i < path.Count; i++) { //Debug.Log(path[i].x + "_" + path[i].y); } if (path != null) { if (index < 1) { Debug.Log(index); Transform target = path[index].gameObject.transform; inAnimation = true; LeanTween.move(gameObject, target, .2f).setOnComplete(delegate() { x = path[index].x; y = path[index].y; //have to after refresh position Debug.Log("am i stand on question" + questionCheck()); index++; Movement(); }); } else { inAnimation = false; LeanTween.cancelAll(); index = 0; } } }
private void OnTriggerEnter2D(Collider2D collision) { collider.enabled = false; LeanTween.cancelAll(this.gameObject); if (collision.gameObject.tag == "playerHitBox" && hitShip == false) { hitShip = true; animator.SetTrigger("Pop"); popSound.Play(); bolaSpeed = 0; collider.enabled = false; transform.position = playerShip.transform.position; hitShipPos = playerShip.transform.position; hitPos = transform.position; StartCoroutine(slowShip(6)); } else { if (hitShip == false) { bolaSpeed = 0; animator.SetTrigger("Pop"); popSound.Play(); LeanTween.alpha(this.gameObject, 0, 0.5f); Destroy(this.gameObject, 6f / 12f); } } }
public void Die(string reason) { Debug.Log(reason); LeanTween.cancelAll(); GameEvents.instance.GameOver(reason); Destroy(gameObject); }
void TweenPlanets_Fever() { if (LeanTween.isTweening(leftPlanets[buttomNum])) { LeanTween.cancelAll(); ForcePlanets(); } int j = 0; leftPlanets[buttomNum].transform.localPosition = leftPosition[9]; // 맨밑 행성 맨위로, 사이즈 조절 rightPlanets[buttomNum].transform.localPosition = rightPosition[9]; leftPlanets[buttomNum].transform.localScale *= sizeDown; rightPlanets[buttomNum].transform.localScale *= sizeDown; rightPlanets[buttomNum].GetComponent <Planet>().setSprite(3); leftPlanets[buttomNum].GetComponent <Planet>().setSprite(3); for (int i = buttomNum + 1; i < 10; i++, j++) // 나머지는 한칸씩 아래로 { LeanTween.moveLocal(leftPlanets[i], leftPosition[j], moveTime); LeanTween.moveLocal(rightPlanets[i], rightPosition[j], moveTime); } for (int i = 0; i < buttomNum; i++, j++) { LeanTween.moveLocal(leftPlanets[i], leftPosition[j], moveTime); LeanTween.moveLocal(rightPlanets[i], rightPosition[j], moveTime); } buttomNum = ++buttomNum % 10; leftPlanets[buttomNum].transform.localScale *= sizeUp; rightPlanets[buttomNum].transform.localScale *= sizeUp; }
private IEnumerator Animate() { LeanTween.cancelAll(false); transform.position = _startPos; transform.rotation = Quaternion.identity; LeanTween.moveX(gameObject, 1.0f, 0.5f) .setOnComplete(() => { LeanTween.moveX(OtherChip, -0.05f, 0.1f) .setEase(LeanTweenType.easeOutSine) .setOnComplete(() => { LeanTween.moveX(OtherChip, 0.0f, 0.1f); }); LeanTween.moveX(gameObject, 0.0f, 0.4f) .setEase(LeanTweenType.easeOutSine); LeanTween.rotateY(gameObject, -180.0f, 0.4f) .setEase(LeanTweenType.easeOutSine); LeanTween.delayedCall(0.30f, () => { DropEffect.Play(); }); }); yield return(new WaitForSeconds(1.0f)); //transform.position = _startPos; }
public override void OnBeginDrag(PointerEventData eventData) { base.OnBeginDrag(eventData); LeanTween.cancelAll(); LeanTween.alphaCanvas(planetNameCanvasGroup, 0, .3f); planetInfo.Hide(); }
public void GoToWallScene() { LeanTween.cancelAll(); GlobalData.instance.SetTimer(9999); GlobalData.instance.StartTime(); GlobalData.instance.ChangeMap("level_wall"); }
public void OnDisable() { LeanTween.cancelAll(); virtualCam.m_Lens.OrthographicSize = firstSizeValue; Player.Instance.LockMovement = false; chooseBridgeUI.SetActive(false); }
void Init() { var debugCanvas = Instantiate(Resources.Load("Prefabs/DebugCanvas")) as GameObject; debugCanvas.GetComponent <Canvas>().worldCamera = Camera.main; foreach (var textComp in debugCanvas.GetComponentsInChildren <Text>()) { if (textComp.name == "debug_text") { debugText = textComp; } if (textComp.name == "level_name_text") { levelNameText = textComp; } } fadeScreen = debugCanvas.GetComponentInChildren <Image>(); Toolbox.Instance.Sfx.StopAll(); LeanTween.cancelAll(); debugLog = ""; if (SceneManager.GetActiveScene().name == "load-screen") { levelNameText.text = sceneNames[nextScene - 1]; FadeInLevelName(); } else { FadeIn(); } }
public void GoToKitchenScene() { LeanTween.cancelAll(); GlobalData.instance.SetTimer(9999); GlobalData.instance.StartTime(); GlobalData.instance.ChangeMap("level_kitchen"); }
public void DeActivateFog() { LeanTween.cancelAll(this.gameObject); foreach (ParticleSystemRenderer renderer in renderers) { LeanTween.value(0.05882353f * 2, 0.05882353f, 1f).setOnUpdate((float val) => renderer.sharedMaterial.color = new Color(0.6226415f, 0.8121411f, 0.8301887f, val)); } }
public void UpdateSubtitle(string sentence) { subtitle.text = ""; LeanTween.cancelAll(); LeanTween.alphaText(subtitle.gameObject.GetComponent <RectTransform>(), 1f, 0f); subtitle.text = sentence; Invoke("TextFadeOut", 3f); }
private void Update() { if (Input.GetKeyDown(KeyCode.Space)) { //loadSceneByClick (); LeanTween.cancelAll(); SceneManager.LoadScene(nextSceneName); } }
public void Clear() { LeanTween.cancelAll(false); this.node = null; this.icon = null; this.label = null; this.Num = null; Singleton <EventRouter> .get_instance().RemoveEventHandler(EventID.DropTreasure, new Action(this.onGetTreasure)); }
public void ReloadScene(Scene scene) { LeanTween.cancelAll(false); levelReady = false; OnLevelLoadedEvt = null; OnLevelEndEvt = null; GetComponent <FadeScreen> ().sceneLoaded = false; StartCoroutine(LoadYourAsyncScene(scene.buildIndex)); }
/// <summary> /// Delete the current level. /// </summary> public void ClearLevel() { LeanTween.cancelAll(); StopAllCoroutines(); Debug.Log("Level is not ready!"); LvlState = LevelState.NotReady; OnLevelNotReady?.Invoke(this, null); }
IEnumerator fogCycle() { while (EnemyPool.enemyPool.Count > 0) { float fogDurationToReduce = 0; foreach (Enemy enemy in EnemyPool.enemyPool) { fogDurationToReduce += enemy.fogStats.fogCoolDownDecrease; } while (fogCyclePeriod < fogCycleInBetweenDuration - fogDurationToReduce) { fogCyclePeriod += Time.deltaTime; if (EnemyPool.enemyPool.Count == 0) { break; } yield return(null); } fogCyclePeriod = 0; fogController.ActivateFog(); float totalDurationToAdd = 0; foreach (Enemy enemy in EnemyPool.enemyPool) { totalDurationToAdd += enemy.fogStats.fogDurationIncrease; } float totalDuration = fogCycleDuration + totalDurationToAdd; applyInvisStatusEffects(totalDuration); glowRunes(); while (fogCyclePeriod < totalDuration) { fogCyclePeriod += Time.deltaTime; if (EnemyPool.enemyPool.Count == 0) { break; } yield return(null); } fogController.DeActivateFog(); unGlowRunes(); fogCyclePeriod = 0; yield return(null); } LeanTween.cancelAll(this.gameObject); fogController.DeActivateFog(); unGlowRunes(); }
private void ApplyJumpForce() { if (_inputManager.SwipeDistance >= 0 || _inputManager.SwipeDistance / 100 > _deadZone || !_hasSticked) { return; } onRelase?.Invoke(); LeanTween.cancelAll(); _rb.AddForce(Vector3.up * Mathf.Abs(_inputManager.SwipeDistance / 5), ForceMode.Impulse); }
public void OpenMiniPortal(float time = 2f, Action callback = null) { Canvas canv = this.gameObject.GetComponent <Canvas>(); LeanTween.cancelAll(); LeanTween.size(canv.GetComponent <RectTransform>(), Vector2.one * 1, time).setOnComplete(() => { callback?.Invoke(); }); }
public void loadLoadingScene() { Time.timeScale = 1; UiManager.Instance.setActiveMainMenuCanvas(false); // Load Loading Scene LeanTween.cancelAll(); SceneManager.LoadScene(1); }
public void StopAllAnimation() { StopRotation(); // Animacion moneda if (posCoin.childCount > 0) { LeanTween.cancelAll(); } }
public void CloseCodeSlot() { if (previousAnimatedOne != null) { codeList.DOAnchorPos(new Vector2(1000, 0), 0.7f); //Closes List Panel LeanTween.cancelAll(); previousAnimatedOne.transform.localScale = new Vector2(1, 1); kyleOpenClose = 1; } }