private void Awake() { _magnetic = GetComponent <Magnetic>(); _magnetic.OnPull += _onPlayerPull_Magnetic; _currentState = KlunkState.None; _currentFuel = _maxFuel; OnCurrentFuelChange?.Invoke((float)_currentFuel / _maxFuel); _currentEnergy = _maxEnergy; OnCurrentEnergyChange?.Invoke((float)_currentEnergy / _maxEnergy); _fuelPerSecond = (float)_maxFuel / _fuelTimeDuration; _rechargePerSecond = (float)_maxEnergy / _totalTimeToReloadFullEnergy; _frontAttack = GetComponentInChildren <FrontAttack>(); _frontAttack.gameObject.SetActive(false); _frontAttack.OnTriggerEnterEvent += _frontAttackChecker_OnTriggerEnterEvent; _characterController = GetComponent <KlunkCharController>(); _frictionController = GetComponent <FrictionController>(); var playerInput = GetComponent <PlayerInput>(); _actionMove = playerInput.actions["Move"]; _actionJump = playerInput.actions["Jump"]; _actionJump.performed += _actionJump_performed; _actionJump.canceled += _actionJump_canceled; _actionMov1 = playerInput.actions["Mov1"]; _actionMov2 = playerInput.actions["Mov2"]; _actionMov2.performed += _actionMov2_performed; _actionMov2.canceled += _actionMov2_canceled; inGameUIController = FindObjectOfType <InGameUIController>(); }
public void Enter() { tetrisController = MonoBehaviour.FindObjectOfType <TetrisController>(); gameUIController = MonoBehaviour.FindObjectOfType <InGameUIController>(); tetrisController.Init(); gameUIController.Init(StoreManager.Instance); tetrisController.OnFinished = () => { // TODO: データの保存 SceneManager.LoadScene("Result"); }; // シーン遷移後にステートを変更 SceneManager.activeSceneChanged += OnSceneChanged; gameUIController.OnPaused = () => { }; gameUIController.OnInGamed = () => { }; gameUIController.OnTitled = () => { }; }
public override IEnumerator OnEnter() { yield return(StartCoroutine(base.OnEnter())); // search controllers var rootObjects = GetRootObjects().ToArray(); var entities = rootObjects.First(e => e.name == "Entities"); var ui = rootObjects.First(e => e.name == "UICanvas"); enemyController = entities.GetComponentInChildren <EnemyController>(); playerController = entities.GetComponentInChildren <PlayerController>(); uiController = ui.GetComponent <InGameUIController>(); // only this class uses MaterialManager materialController = new MaterialController(); // init own class Initialize(); // player process InitializePlayerController(); // enemy process InitializeEnemyController(); // ui process uiController.Initialize(GlobalStore.Instance); materialController.Add(uiController.Texts); yield return(null); }
public void SetInGameUI(bool _isContinue = false) { if (createIngameUI == null) { Debug.LogError("UIManager CreateIngameUI is Null !!"); return; } if (inGameUI == null) { GameObject go = Instantiate(createIngameUI, transform); inGameUI = go.GetComponent <InGameUIController>(); } if (lobbyUI != null) { lobbyUI.gameObject.SetActive(false); } if (loadingUI != null) { loadingUI.gameObject.SetActive(false); } inGameUI.gameObject.SetActive(true); inGameUI.OnInitialized(_isContinue); SetMainCanvasScale(inGameUI.GetComponent <CanvasScaler>()); }
private void InGameEvents_OnMainMenuButtonPressed() { MainMenuController.GetComponentInChildren <Canvas>().enabled = true; FadeSceneController.GetComponentInChildren <Canvas>().enabled = false; InGameUIController.GetComponentInChildren <Canvas>().enabled = false; AudioManager.Instance.Stop(MyAudioType.InGame_Level1, fade: true); AudioManager.Instance.Play(MyAudioType.Main_Menu1, fade: true, delay: 0.5f); InputManager.Instance.IsInGame = false; }
void Awake() { UIController = GameObject.Find("InGameUI").GetComponent <InGameUIController>(); if (Game.GameOption.IsMultiplayer && isServer) { server = GameObject.Find("Server").GetComponent <Server>(); } board = GameObject.Find("Board").GetComponent <Board>(); _visualizer = GameObject.Find("Visualizer").GetComponent <BoardVisualizer>(); }
public override void Enter() { inGameUiController = MonoBehaviour.FindObjectOfType <InGameUIController>(); // シーンをロードしたときのイベントを登録 SceneManager.activeSceneChanged += OnActiveSceneChanged; // ゲームステートの初期化 ChangeState(new GS_Countdown(inGameUiController)); }
// Start is called before the first frame update void Start() { captureZone = GameObject.FindGameObjectWithTag("Capture Zone").GetComponent <CaptureZoneController>(); gameUI = GameObject.FindGameObjectWithTag("HUD").GetComponent <InGameUIController>(); playStats = GameObject.FindGameObjectWithTag("PlayerStats").GetComponent <PlayerStats>(); if (gameUI) { gameUI.objective1Text.text = objective1; } }
public override void Enter() { inGameUiController = MonoBehaviour.FindObjectOfType <InGameUIController>(); // カウントダウンが終了したら次のステートへ遷移する inGameUiController.OnCountdownFinished = () => { OnStateChanged(new GS_Play(inGameUiController)); }; // カウントダウンの開始 inGameUiController.CountdownView(); }
void Start() { if (!inGarage) { currentAmmo = maxAmmo; playerHUD = GameObject.FindGameObjectWithTag("HUD").GetComponent <InGameUIController>(); stats = GameObject.FindGameObjectWithTag("PlayerStats").GetComponent <PlayerStats>(); } sourceSound = GetComponent <AudioSource>(); sourceSound.clip = weaponSound; sourceSound.pitch = soundPitch; }
// Start is called before the first frame update void Start() { gameUI = GameObject.FindGameObjectWithTag("HUD").GetComponent <InGameUIController>(); playStats = GameObject.FindGameObjectWithTag("PlayerStats").GetComponent <PlayerStats>(); if (GameObject.FindGameObjectWithTag("Core")) { core = GameObject.FindGameObjectWithTag("Core").GetComponent <CoreGame>(); } if (gameUI && gameUI.objective1Text.text != objective1) { gameUI.objective1Text.text = objective1; } }
public void Awake() { uiCtrl = gameObject.AddComponent <InGameUIController>(); uiCtrl.TutorialInit(); cookingCtrl = gameObject.AddComponent <InGameCookingController>(); cookingCtrl.TutorialInit(); nyangCtrl = gameObject.AddComponent <InGameNyangController>(); nyangCtrl.Initialize(cookingCtrl); tutoManager = TutorialManager.getInstance; tutoManager.StartTutorial(cookingCtrl, nyangCtrl); StartCoroutine("UpdateFrame"); }
void Start() { playerHUD = GameObject.FindGameObjectWithTag("HUD").GetComponent <InGameUIController>(); }
public GameStateBase(InGameUIController uIController) { }
public GS_Countdown(InGameUIController uIController) : base(uIController) { inGameUiController = uIController; }
private void InGameEvents_OnGameStart() { MainMenuController.GetComponentInChildren <Canvas>().enabled = false; FadeSceneController.GetComponentInChildren <Canvas>().enabled = false; InGameUIController.GetComponentInChildren <Canvas>().enabled = true; }
protected override void Initialize() { uiCtrl = GameObject.Find("Controller").GetComponent <InGameUIController>(); cookingCtrl = FindObjectOfType <InGameCookingController>(); }
public GS_Play(InGameUIController uIController) : base(uIController) { inGameUiController = uIController; }