private void Start() { GameModeManager _mode = FindObjectOfType <GameModeManager>(); switch (_mode.GetGameMode()) { case GameModes.Modes.NoneGame: break; case GameModes.Modes.Classic: gameManager = FindObjectOfType <ClassicGameManager>(); if (!gameManager) { Log.WriteLog("ClassicGameManager not set.", Log.LevelsOfLogs.ERROR, "SwipeManager"); } break; case GameModes.Modes.Challenge: gameManager = FindObjectOfType <ChallengeGameManager>(); if (!gameManager) { Log.WriteLog("ClassicGameManager not set.", Log.LevelsOfLogs.ERROR, "SwipeManager"); } break; default: break; } }
private void Awake() { if (instance != null) { Destroy(this); } instance = this; }
private static void Main() { Console.OutputEncoding = Encoding.UTF8; Screen.Initialize(); GameLoopManager.Start(new GameTitleLoop()); GameLoopManager.Start(new TestGameLoop()); }
// Start is called before the first frame update void Start() { button1.GoldWastedEvent += Button1IsPressed; button2.GoldWastedEvent += Button2IsPressed; SpawnTime = 0; _spawnInProgress = false; _playerSide = gameObject.GetComponent <OwnerComponent>().Player; _gameManager = FindObjectOfType <GameLoopManager>(); }
private void Start() { _gameLoopManager = ServiceLocator.Current.Get <GameLoopManager>(); _myButton = GetComponent <Button>(); _gameLoopManager.OnPreparation += DisableInteraction; _gameLoopManager.OnExecution += EnableInteraction; _gameLoopManager.OnComplete += DisableInteraction; DisableInteraction(); }
private void Start() { _gameLoopManager = ServiceLocator.Current.Get <GameLoopManager>(); _scoreManager = ServiceLocator.Current.Get <ScoreManager>(); _gameLoopManager.OnPreparation += Reset; Reset(); }
public SettingsManager(GameLoopManager loopManager) { Data = LoadSettings(); loopManager.OnLevelReady += OnLevelComplete; new GameObject("Audio Setter", typeof(AudioSetterController)); OnApplySettings += ApplySettings; ApplySettings(); }
private void Start() { _gameLoopManager = ServiceLocator.Current.Get <GameLoopManager>(); _gameLoopManager.OnExecution += MoveForward; _gameLoopManager.OnPreparation += Reset; _isMove = false; startPosition = transform.position; startRotation = transform.rotation; }
void Awake() { _gameLoopManager = ServiceLocator.Current.Get <GameLoopManager>(); _gameLoopManager.OnLevelReady += Play; _gameLoopManager.OnComplete += Pause; _gameLoopManager.OnComplete += Stop; _paused = false; _period = Random.Range(minPeriod, maxPeriod); _lastTime = spawnOnAwake ? -_period : 0; }
private void OnApplicationQuit() { if (PersistenSingleton <UIManager> .Instance.UnityScene != UIManager.Scene.Bundle && !quitConfirm) { Application.CancelQuit(); OnQuitCommandDetected(); } else { GameLoopManager.RaiseQuitEvent(); } }
private void Awake() { _rect = GetComponent <RectTransform>(); _gameLoopManager = ServiceLocator.Current.Get <GameLoopManager>(); _gameLoopManager.OnComplete += HideControlBar; defaultYPos = _rect.anchoredPosition.y; hideYPos = defaultYPos - _rect.rect.height; _rect.anchoredPosition += new Vector2(0f, hideYPos); SceneManager.activeSceneChanged += ShowControlBar; }
private void Start() { _gameLoopManager = ServiceLocator.Current.Get <GameLoopManager>(); _myButton = GetComponent <Button>(); _playMat = playImage.material; _stopMat = stopImage.material; _gameLoopManager.OnPreparation += PreparationState; _gameLoopManager.OnExecution += ExecutionState; _gameLoopManager.OnRestart += EnableInteraction; _gameLoopManager.OnComplete += DisableInteraction; EnableInteraction(); PreparationState(); }
void Start() { _gameManager = FindObjectOfType <GameLoopManager>(); _owner = gameObject.GetComponent <OwnerComponent>().Player; foreach (GameObject obj in _startingBuildings) { var tempOwner = obj.GetComponent <OwnerComponent>(); if (tempOwner != null) { tempOwner.Player = _owner; } } }
private void Start() { if (instance != null) { Destroy(gameObject); } instance = this; GameLoopManager gameManager = FindObjectOfType <GameLoopManager>(); gameManager.SetUIEvent += HideLosePanel; gameManager.SetUIEvent += ShowGameUI; }
private void Awake() { //シングルトン処理 //インスタンス作成時、既にインスタンスが作成されている場合はインスタンスを破壊する。 if (instance == null) { instance = this; DontDestroyOnLoad(this.gameObject); } else { Destroy(this.gameObject); } }
private void Start() { _gameLoopManager = ServiceLocator.Current.Get <GameLoopManager>(); _scoreManager = ServiceLocator.Current.Get <ScoreManager>(); _gameLoopManager.OnPreparation += Reset; _collider = GetComponentInChildren <Collider>(); _goal = GameObject.FindObjectOfType <Goal>(); if (_goal) { _goal.IncreaseObjectivesCount(); } }
protected new void Start() { base.Start(); if (!interactableController) { _gameLoopManager = ServiceLocator.Current.Get <GameLoopManager>(); if (_gameLoopManager != null) { _gameLoopManager.OnPreparation += ResetState; } } ResetState(); }
// Start is called before the first frame update void Start() { tileManager = ServiceLocator.Current.Get <TileManager>(); inputManager = ServiceLocator.Current.Get <InputManager>(); cameraManager = ServiceLocator.Current.Get <CameraManager>(); _gameLoopManager = ServiceLocator.Current.Get <GameLoopManager>(); tileManager.OnTileSelect += TileSelect; tileManager.OnTileDeselect += TileDeselect; // _gameLoopManager.OnRestart += ResetPosition; // _gameLoopManager.OnLevelReady += SetStartPosition; // SetStartPosition(); // ResetPosition(); }
// Start is called before the first frame update private void Awake() { _chapterTextTransform = chapterText.rectTransform; _levelTextTransform = levelText.rectTransform; chapterXPos = -1f * (_chapterTextTransform.anchoredPosition.x + _chapterTextTransform.rect.width); levelXPos = -1f * (_levelTextTransform.anchoredPosition.x + _levelTextTransform.rect.width); chapterText.text = "Chapter " + gameObject.scene.name.Split('-')[0].Last(); levelText.text = "Part " + gameObject.scene.name.Split('-')[1]; _gameLoopManager = ServiceLocator.Current.Get <GameLoopManager>(); _gameLoopManager.OnRestart += AnimateText; HideText(); }
public TileManager(CameraManager camMan, InputManager input, GameLoopManager gameLoopMan) { cameraManager = camMan; cameraManager.OnCameraRaycastHit += TileSelect; inputManager = input; inputManager.P_LeftClick.canceled += TileDeselect; _gameLoopManager = gameLoopMan; _gameLoopManager.OnPreparation += EnableTileMove; _gameLoopManager.OnExecution += DisableTileMove; _gameLoopManager.OnComplete += DisableTileMove; EnableTileMove(); SceneManager.activeSceneChanged += SceneChanged; }
private void Start() { _gameLoopManager = ServiceLocator.Current.Get <GameLoopManager>(); _tileManager = ServiceLocator.Current.Get <TileManager>(); _interactableManager = ServiceLocator.Current.Get <InteractableManager>(); _gameLoopManager.OnPreparation += StopSpawning; _gameLoopManager.OnExecution += StartSpawning; _gameLoopManager.OnComplete += StopSpawning; _gameLoopManager.OnExecution += BakeNavMesh; _tileManager.OnRebakeMesh += BakeNavMesh; _tileManager.OnUpdateMesh += UpdateNavMesh; BakeNavMesh(); }
public void OnCreate() { if (bCreated) { EnterState(State.Playing); return; } CMan = CameraManager.Instance; GMan = GameLoopManager.Instance; UIMan = UIManager.Instance; GMan.OnCreate(); UIMan.OnCreate(); bCreated = true; }
// Start is called before the first frame update void Start() { input = ServiceLocator.Current.Get <InputManager>(); input.P_LeftClick.performed += OnLeftClickDown; input.P_MouseDelta.performed += OnMouseMoved; input.P_MouseDelta.canceled += OnMouseMoved; input.P_RightClick.performed += OnRightClickDown; input.P_RightClick.canceled += OnRightClickDown; cameraManager = ServiceLocator.Current.Get <CameraManager>(); cam = GetComponent <Camera>(); _gameLoopManager = ServiceLocator.Current.Get <GameLoopManager>(); _gameLoopManager.OnComplete += ResetToInitialPosition; SetInitialValues(); }
protected void Start() { interactableManager = ServiceLocator.Current.Get <InteractableManager>(); inputManager = ServiceLocator.Current.Get <InputManager>(); cameraManager = ServiceLocator.Current.Get <CameraManager>(); _gameLoopManager = ServiceLocator.Current.Get <GameLoopManager>(); audioManager = ServiceLocator.Current.Get <AudioManager>(); interactableManager.OnInteractableSelect += InteractableSelect; interactableManager.OnInteractableDeselect += InteractableDeselect; // _gameLoopManager.OnPreparation += ResetInteractable; _gameLoopManager.OnRestart += ResetInteractable; audioManager.OnAudioStop += StopAudio; ResetInteractable(); }
void Start() { Transform[] toCopy = GameObject.FindGameObjectWithTag("Waypoint").GetComponent <WaypointList>().listWaypoint; Waypoints = new Transform[toCopy.Length]; System.Array.Copy(toCopy, 0, Waypoints, 0, toCopy.Length); _carryVisitor = transform.GetChild(0).GetComponent <CarryBehaviour>(); _manager = GameObject.FindObjectOfType <GameLoopManager>(); doors = GameObject.FindObjectsOfType <DoorsManagement>(); if (doors[0]._isEntrance) { indexEntrance = 0; indexExit = 1; } else { indexExit = 0; indexEntrance = 1; } }
// Start is called before the first frame update void Start() { _dotCheck = TILE_DOT_CHECK; _allTiles = GetComponentsInChildren <TileController>(); tileManager = ServiceLocator.Current.Get <TileManager>(); cameraManager = ServiceLocator.Current.Get <CameraManager>(); _gameLoopManager = ServiceLocator.Current.Get <GameLoopManager>(); _gameLoopManager.OnRestart += ResetPosition; _gameLoopManager.OnLevelReady += SetStartPosition; tileManager.OnTileSelect += TileSelect; tileManager.OnTileDeselect += TileDeselect; childRenderers = GetComponentsInChildren <Renderer>(); hightlightShader = Shader.Find("Environment/Mutable"); }
/// <summary> /// Main core of card manager /// Get card state and check that playrs move was correct /// </summary> /// <param name="newState"></param> /// <param name="gameManager"></param> public void CheckCorrectState(AllState.State newState, GameLoopManager gameManager) { bool stateOfCheck = false; if (newState == stateNeed[currentStateNeed]) { if (isNot) // wrong { stateOfCheck = false; SendResult(stateOfCheck, gameManager); } else // correct! { stateOfCheck = true; currentStateNeed++; if (currentStateNeed >= stateLength) { SendResult(stateOfCheck, gameManager); } } } else { if (isNot && newState != AllState.State.Touch) // correct { stateOfCheck = true; currentStateNeed++; if (currentStateNeed >= stateLength) { SendResult(stateOfCheck, gameManager); } } else // wrong { stateOfCheck = false; SendResult(stateOfCheck, gameManager); } } MoveCard(); }
// Start is called before the first frame update private void Awake() { _audioSource = GetComponent <AudioSource>(); _gameLoopManager = ServiceLocator.Current.Get <GameLoopManager>(); _gameLoopManager.OnComplete += LoadTransitionScene; _inputManager = ServiceLocator.Current.Get <InputManager>(); transitionScene = SceneManager.GetSceneByName("TransitionScene"); if (isLowerIntoFog) { if (!tilesTransform) { tilesTransform = GameObject.FindGameObjectWithTag("Pillar").transform.parent; } tilesTransform.position = new Vector3(0f, -20f, 0f); } }
private void Awake() { _rect = GetComponent <RectTransform>(); _gameLoopManager = ServiceLocator.Current.Get <GameLoopManager>(); _gameLoopManager.OnComplete += HideControlBar; defaultXPos = _rect.anchoredPosition.x; if (moveAmount.Equals(0f)) { hideXPos = defaultXPos + 100f; } else { hideXPos = defaultXPos + moveAmount; } _rect.anchoredPosition += new Vector2(hideXPos, 0f); print(_rect.anchoredPosition); SceneManager.activeSceneChanged += ShowControlBar; }
private void Update() { GameLoopManager.RaiseUpdateEvent(); if (UnityXInput.Input.GetAxis("Mouse X") < 1.0 / 1000.0 && UnityXInput.Input.GetAxis("Mouse Y") < 1.0 / 1000.0) { disableMouseCounter += Time.deltaTime; } else { disableMouseCounter = 0.0f; if (!UICamera.list[0].useMouse) { UICamera.list[0].useMouse = true; } } if (UnityXInput.Input.GetMouseButton(0) || UnityXInput.Input.GetMouseButton(1) || (UnityXInput.Input.GetMouseButton(2) || Mathf.Abs(UnityXInput.Input.GetAxis("Mouse ScrollWheel")) > 0.00999999977648258)) { disableMouseCounter = 0.0f; if (!UICamera.list[0].useMouse) { UICamera.list[0].useMouse = true; } } if (disableMouseCounter > 1.0 && UICamera.list[0].useMouse) { UICamera.list[0].useMouse = false; } if (!UnityXInput.Input.anyKey && !isLockLazyInput) { ResetKeyCode(); } AccelerateKeyNavigation(); if (handleMenuControlKeyPressCustomInput()) { return; } HandleBoosterButton(); handleDialogControlKeyPressCustomInput(); }