示例#1
0
    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>();
    }
示例#2
0
    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 = () =>
        {
        };
    }
示例#3
0
    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);
    }
示例#4
0
    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>());
    }
示例#5
0
 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;
 }
示例#6
0
 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>();
 }
示例#7
0
    public override void Enter()
    {
        inGameUiController = MonoBehaviour.FindObjectOfType <InGameUIController>();

        // シーンをロードしたときのイベントを登録
        SceneManager.activeSceneChanged += OnActiveSceneChanged;

        // ゲームステートの初期化
        ChangeState(new GS_Countdown(inGameUiController));
    }
示例#8
0
    // 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;
        }
    }
示例#9
0
    public override void Enter()
    {
        inGameUiController = MonoBehaviour.FindObjectOfType <InGameUIController>();

        // カウントダウンが終了したら次のステートへ遷移する
        inGameUiController.OnCountdownFinished = () =>
        {
            OnStateChanged(new GS_Play(inGameUiController));
        };

        // カウントダウンの開始
        inGameUiController.CountdownView();
    }
示例#10
0
    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;
    }
示例#11
0
    // 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;
        }
    }
示例#12
0
    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");
    }
示例#13
0
 void Start()
 {
     playerHUD = GameObject.FindGameObjectWithTag("HUD").GetComponent <InGameUIController>();
 }
示例#14
0
 public GameStateBase(InGameUIController uIController)
 {
 }
示例#15
0
 public GS_Countdown(InGameUIController uIController) : base(uIController)
 {
     inGameUiController = uIController;
 }
示例#16
0
 private void InGameEvents_OnGameStart()
 {
     MainMenuController.GetComponentInChildren <Canvas>().enabled  = false;
     FadeSceneController.GetComponentInChildren <Canvas>().enabled = false;
     InGameUIController.GetComponentInChildren <Canvas>().enabled  = true;
 }
示例#17
0
 protected override void Initialize()
 {
     uiCtrl      = GameObject.Find("Controller").GetComponent <InGameUIController>();
     cookingCtrl = FindObjectOfType <InGameCookingController>();
 }
示例#18
0
 public GS_Play(InGameUIController uIController) : base(uIController)
 {
     inGameUiController = uIController;
 }