private void Start() { playerActions = PlayerControlActions.CreateWithGamePadBindings(); gameObject.transform.position = startPosition; gradient = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>().GetComponent <GradientImageEffect>(); menuManager = GetComponentInChildren <AbstractMenuManager>(); menuManager.enabled = false; menuManager.SetMenuInputActive(false); LevelEndManager.levelExitEvent += DeRegister; playerActionList = new List <PlayerControlActions>(); GameObject g = GameObject.FindGameObjectWithTag("GlobalScripts"); if (g != null) { playerSelectionContainer = g.GetComponent <PlayerSelectionContainer>(); if (playerSelectionContainer != null) { for (int i = 0; i < playerSelectionContainer.playerInputDevices.Length; i++) { if (playerSelectionContainer.playerInputDevices[i] != null) { PlayerControlActions p = PlayerControlActions.CreateWithGamePadBindings(); p.Device = playerSelectionContainer.playerInputDevices[i]; playerActionList.Add(p); } } } } steamManager = SteamManager.Instance; if (steamManager != null) { steamManager.OnOverlayActivated += OnOverlayActivated; } PlayerManager.AllPlayersDeadEventHandler += () => { gameEnded = true; }; }
private void PauseTween(bool animateIn) { Vector3 first = startPosition; Vector3 second = Vector3.zero; if (!animateIn) { first = Vector3.zero; second = startPosition; } menuManager.enabled = animateIn; menuManager.SetMenuInputActive(animateIn); // SetMenuActive(animateIn); LeanTween.value(gameObject, first, second, tweenTime).setOnUpdate( (Vector3 pos) => { gameObject.transform.position = pos; } ).setEase(LeanTweenType.easeInQuad).setUseEstimatedTime(true).setOnComplete(() => TweenCameraEffect(animateIn)); }