IEnumerator LoadLevelCoroutine(int level) { EnableInput(false); _alreadyLoadingLevel = true; //Baja cortina FadeCurtain.Toggle(); yield return(new WaitForSeconds(0.5f)); //Player.gameObject.SetActive(true); GameManager.Instance.EnablePlayerNoDesactivate(true); if (CurrentlyLoadedLevel >= 0) { //Desactivar nivel previo Levels[CurrentlyLoadedLevel].gameObject.SetActive(false); } //Comprobar entrada if (Levels[level].Start == null) { Debug.LogError("No has asignado el punto de entrada del nivel " + level + ":" + Levels[level].name); yield break; } //Cargar el nivel pedido Levels[level].gameObject.SetActive(true); CurrentlyLoadedLevel = level; //Player al punto de salida Player.transform.position = Levels[level].Start.position; Player.transform.rotation = Levels[level].Start.rotation; //Cámara Camera.main.transform.position = Player.transform.position; Camera.main.transform.position -= Camera.main.transform.forward * 25; //yield return new WaitForSeconds(0.5f); //Otras cosas al principio del nivel //... //Arriba cortina FadeCurtain.Toggle(); yield return(new WaitForSeconds(0.5f)); EnableInput(true); //letrerico de nivel por el que vas EnterLevelLabel.text = "Entering Level " + (level + 1); EnterLevelLabelTween.Toggle(); //yield return new WaitForSeconds(5f); _alreadyLoadingLevel = false; }
public void CollapseMe() { scaleTweener.Toggle(); posTweener.Toggle(); eqButtonGO.GetComponentInChildren <TweenScale> ().Toggle(); //MiddleWindowCollapser.Instance.currentContentSprite.spriteName = "ic_" + eqIconNum; Debug.Log("collapse mee"); }
// 训练场 private void TestScene() { CameraScript cs = Camera.main.GetComponent <CameraScript> (); cs.enabled = false; TweenPosition tp = GetComponent <TweenPosition>(); tp.Toggle(); EventDelegate.Add(tp.onFinished, GameOver); WheelRot [] wheel = gameObject.GetComponentsInChildren <WheelRot> (); foreach (WheelRot w in wheel) { w.carStatus = WheelRot.CarStatus.forward; } }
public override void OnBegin(Clip clip) { base.OnBegin(clip); if (Tweener == null) { m_Status = Status.Error; return; } if (TweenEndCallback == null) { TweenEndCallback = new EventDelegate() { methodName = "OnTweenEnd" }; } Tweener.AddOnFinished(TweenEndCallback); Tweener.ResetToBeginning(); Tweener.Toggle(); }
// Update is called once per frame void OnClick() { cameraTweener.Toggle(); }
public void MoveItem() { tweenPosition.Toggle(); itemListTweenPosition.Toggle(); }
/// <summary> /// Show / hide the list of players. /// </summary> void ToggleList(GameObject go) { mShown = !mShown; tween.Toggle(); mPlayer.UpdateInfo(mShown); }