private void Awake() { if (instance == null) { instance = this; } }
void Start() { Transform cameraPivotPoint = GameObject.FindGameObjectWithTag("CameraPivotPoint").transform; CameraMovementManager = new CameraMovementManager(cameraPivotPoint, CameraMovementManagerComponent); StepManager = new StepManager(this); }
private void Awake() { cam = GetComponent <Camera>(); cameraMovementManager = gameObject.GetComponent <CameraMovementManager>(); gameManager = GameObject.FindWithTag("GameController").GetComponent <GameManager>(); cubeletLayer = LayerMask.GetMask("Cubelet"); actionCatcherLayer = LayerMask.GetMask("ActionCatcher"); }
private void ToggleCameraMovement() { if (cameraMovementManager == null) { cameraMovementManager = Camera.main.gameObject.GetComponent <CameraMovementManager>(); } if (cameraMovementManager != null) { cameraMovementManager.ToggleCameraMovement(); } }
// Player HUD - Camera Control public void SwitchCameraMode() { if (CameraMovementManager.mode == CameraMovementManager.ViewMode.Top) { cameraModeButtonText.text = "Iso"; CameraMovementManager.SwitchToIsoView(); } else { cameraModeButtonText.text = "Top"; CameraMovementManager.SwitchToTopView(); } }
/// <summary> /// Processing performed by Unity when an instance is created. /// </summary> void Start() { camManager = cameraManaged.GetComponent<CameraMovementManager>(); camManager.enabled = false; Toggle t = GetComponent<Toggle> (); if (t == null) Debug.LogError ("CameraChackBoxOnEditor doit etre associƩ a un Toggle (UI)"); t.onValueChanged.AddListener((isCheck) => { if(isCheck) OnToggleCheck(); else OnToggleUnCheck(); }); }
private void Start() { OnStart(); RangeObjectV2Manager.Get().Init(); GroundEffectsManagerV2.Get().Init(LevelManagementConfigurationGameObject.Get().LevelConfiguration.ConfigurationInherentData[LevelManager.Get().GetCurrentLevel()].LevelRangeEffectInherentData); InteractiveObjectV2Manager.Get().Init(); CameraMovementManager.Get().Init(); CircleFillBarRendererManager.Get().Init(); TutorialManager.Get().Init(); SelectableObjectManagerV2.Get().Init(GameInputManager.Get()); PlayerActionEntryPoint.Get().Init(); #if UNITY_EDITOR EditorOnlyManagers = new EditorOnlyManagers(); EditorOnlyManagers.Init(); #endif }
private void Update() { var d = Time.deltaTime; BeforeTick(d); TutorialManager.Get().Tick(d); PuzzleTutorialEventSenderManager.Get().Tick(d); BlockingCutscenePlayerManager.Get().Tick(d); PlayerActionEntryPoint.Get().Tick(d); PlayerInteractiveObjectManager.Get().Tick(d); PlayerInteractiveObjectManager.Get().AfterTicks(d); CameraMovementManager.Get().Tick(d); ObstacleOcclusionCalculationManagerV2.Get().Tick(d); RangeIntersectionCalculationManagerV2.Get().Tick(d); RangeObjectV2Manager.Get().Tick(d); InteractiveObjectV2Manager.Get().Tick(d); InteractiveObjectV2Manager.Get().AfterTicks(d); GroundEffectsManagerV2.Get().Tick(d); DottedLineRendererManager.Get().Tick(); SelectableObjectManagerV2.Get().Tick(d); CircleFillBarRendererManager.Get().Tick(d); #if UNITY_EDITOR EditorOnlyManagers.Tick(d); #endif }
private void Awake() { int size = GameSessionManager.Instance.CubeSize; SaveManager.Instance.PreLoadSavedGame(); historyManager = GetComponent <RotationsHistoryManager>(); bool loaded = false; if (!GameSessionManager.Instance.NewGame && SaveManager.Instance.SavedGameExists) { SaveManager.Instance.LoadCurrentSavedGame(out size, out List <List <List <int> > > stickers, out List <RotationAction> history, out timer); cubeManager = GetComponent <CubeBuilder>().LoadCube(size, stickers); historyManager.LoadRotationHistory(history); loaded = true; } else { cubeManager = GetComponent <CubeBuilder>().CreateCube(size); } playerInputManager.SetCubeManager(cubeManager); cameraMovementManager = playerInputManager.gameObject.GetComponent <CameraMovementManager>(); cameraMovementManager.SetUpInitialTargets(size); playerInputManager.gameObject.GetComponent <LevelBGManager>().SetLvlBG(size); hudManager = GameObject.FindWithTag("HUD").GetComponent <HUDManager>(); hudManager.ShowGameHUDAtStart(); SceneFader.Instance.FadeNow(0.25f, true, loaded ? (Action)(() => StartCoroutine(FromLoadedGame())) : (Action)(() => StartCoroutine(ScramblingCube()))); }