Exemplo n.º 1
0
        void Awake()
        {
            m_Jetpack = FindObjectOfType <Jetpack>();
            DebugUtility.HandleErrorIfNullFindObject <Jetpack, JetpackCounter>(m_Jetpack, this);

            FillBarColorChange.Initialize(1f, 0f);
        }
    private void Start()
    {
        m_PlayerController = FindObjectOfType <PlayerCharacterController>();
        DebugUtility.HandleErrorIfNullFindObject <PlayerCharacterController, EnemyManager>(m_PlayerController, this);

        enemies = new List <EnemyController>();
    }
Exemplo n.º 3
0
    void Awake()
    {
        PlayerWeaponsManager playerWeaponsManager = FindObjectOfType <PlayerWeaponsManager>();

        DebugUtility.HandleErrorIfNullFindObject <PlayerWeaponsManager, NotificationHUDManager>(playerWeaponsManager, this);
        playerWeaponsManager.onAddedWeapon += OnPickupWeapon;
    }
Exemplo n.º 4
0
    void Start()
    {
        m_PlayerInputsHandler = FindObjectOfType <PlayerInputHandler>();
        DebugUtility.HandleErrorIfNullFindObject <PlayerInputHandler, InGameMenuManager>(m_PlayerInputsHandler, this);

        m_PlayerHealth = m_PlayerInputsHandler.GetComponent <Health>();
        DebugUtility.HandleErrorIfNullGetComponent <Health, InGameMenuManager>(m_PlayerHealth, this, gameObject);

        m_FramerateCounter = FindObjectOfType <FramerateCounter>();
        DebugUtility.HandleErrorIfNullFindObject <FramerateCounter, InGameMenuManager>(m_FramerateCounter, this);

        menuRoot.SetActive(false);

        lookSensitivitySlider.value = m_PlayerInputsHandler.lookSensitivity;
        lookSensitivitySlider.onValueChanged.AddListener(OnMouseSensitivityChanged);

        shadowsToggle.isOn = QualitySettings.shadows != ShadowQuality.Disable;
        shadowsToggle.onValueChanged.AddListener(OnShadowsChanged);

        invincibilityToggle.isOn = m_PlayerHealth.invincible;
        invincibilityToggle.onValueChanged.AddListener(OnInvincibilityChanged);

        framerateToggle.isOn = m_FramerateCounter.uiText.gameObject.activeSelf;
        framerateToggle.onValueChanged.AddListener(OnFramerateCounterChanged);
    }
Exemplo n.º 5
0
    void Start()
    {
        // fetch components on the same gameObject
        m_Controller = GetComponent <CharacterController>();
        DebugUtility.HandleErrorIfNullGetComponent <CharacterController, PlayerCharacterController>(m_Controller, this, gameObject);

        m_InputHandler = GetComponent <PlayerInputHandler>();
        DebugUtility.HandleErrorIfNullGetComponent <PlayerInputHandler, PlayerCharacterController>(m_InputHandler, this, gameObject);

        m_WeaponsManager = GetComponent <PlayerWeaponsManager>();
        DebugUtility.HandleErrorIfNullGetComponent <PlayerWeaponsManager, PlayerCharacterController>(m_WeaponsManager, this, gameObject);

        m_Health = GetComponent <Health>();
        DebugUtility.HandleErrorIfNullGetComponent <Health, PlayerCharacterController>(m_Health, this, gameObject);

        m_Actor = GetComponent <Actor>();
        DebugUtility.HandleErrorIfNullGetComponent <Actor, PlayerCharacterController>(m_Actor, this, gameObject);

        m_Player = FindObjectOfType <PlayerCharacterController>();
        DebugUtility.HandleErrorIfNullFindObject <PlayerCharacterController, GameFlowManager>(m_Player, this);

        m_Controller.enableOverlapRecovery = true;

        m_Health.onDie       += OnDie;
        m_Health.onResurrect += OnResurrect;

        // force the crouch state to false when starting
        SetCrouchingState(false, true);
        UpdateCharacterHeight(true);
    }
Exemplo n.º 6
0
    void Start()
    {
        m_Objective = GetComponent <Objective>();
        DebugUtility.HandleErrorIfNullGetComponent <Objective, ObjectiveSurviveRounds>(m_Objective, this, gameObject);

        m_EnemyManager = FindObjectOfType <EnemyManager>();
        DebugUtility.HandleErrorIfNullFindObject <EnemyManager, ObjectiveSurviveRounds>(m_EnemyManager, this);
        m_EnemyManager.onRemoveEnemy += OnKillEnemy;

        if (mustKillAllEnemiesToAdvance)
        {
            killsToCompleteRound = m_EnemyManager.numberOfEnemiesTotal;
        }


        // set a title and description specific for this type of objective, if it hasn't one
        if (string.IsNullOrEmpty(m_Objective.title))
        {
            m_Objective.title = "Eliminate " + (mustKillAllEnemiesToAdvance ? "all the" : killsToCompleteRound.ToString()) + " enemies";
        }

        if (string.IsNullOrEmpty(m_Objective.description))
        {
            m_Objective.description = GetUpdatedCounterAmount();
        }
    }
Exemplo n.º 7
0
    void Start()
    {
        m_PlayerWeaponsManager = FindObjectOfType <PlayerWeaponsManager>();
        DebugUtility.HandleErrorIfNullFindObject <PlayerWeaponsManager, WeaponHUDManager>(m_PlayerWeaponsManager, this);

        WeaponController activeWeapon = m_PlayerWeaponsManager.GetActiveWeapon();
    }
    private void Start()
    {
        m_GameFlowManager = FindObjectOfType <GameFlowManager> ();
        DebugUtility.HandleErrorIfNullFindObject <GameFlowManager, PlayerInputHandler> (m_GameFlowManager, this);

        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible   = false;
    }
Exemplo n.º 9
0
 private void Awake()
 {
     m_PlayerWeaponsManager = FindObjectOfType <PlayerWeaponsManager>();
     DebugUtility.HandleErrorIfNullFindObject <PlayerWeaponsManager, WeaponHUDManager>(m_PlayerWeaponsManager, this);
     m_PlayerWeaponsManager.onAddedWeapon      += AddWeapon;
     m_PlayerWeaponsManager.onRemovedWeapon    += RemoveWeapon;
     m_PlayerWeaponsManager.onSwitchedToWeapon += ChangeWeapon;
 }
Exemplo n.º 10
0
    private void Start()
    {
        character = FindObjectOfType <PlayerCharacterController> ();
        DebugUtility.HandleErrorIfNullFindObject <PlayerCharacterController, StanceHUD> (character, this);
        walkController = FindObjectOfType <PlayerWalkController> ();

        character.onStanceChanged += OnStanceChanged;
        OnStanceChanged();
    }
Exemplo n.º 11
0
        void Start()
        {
            PlayerCharacterController character = FindObjectOfType <PlayerCharacterController>();

            DebugUtility.HandleErrorIfNullFindObject <PlayerCharacterController, StanceHUD>(character, this);
            character.OnStanceChanged += OnStanceChanged;

            OnStanceChanged(character.IsCrouching);
        }
Exemplo n.º 12
0
    private void Start()
    {
        PlayerCharacterController playerCharacterController = GameObject.FindObjectOfType <PlayerCharacterController> ();

        DebugUtility.HandleErrorIfNullFindObject <PlayerCharacterController, PlayerHealthBar> (playerCharacterController, this);

        m_PlayerHealth = playerCharacterController.GetComponent <Health> ();
        DebugUtility.HandleErrorIfNullGetComponent <Health, PlayerHealthBar> (m_PlayerHealth, this, playerCharacterController.gameObject);
    }
    void Start()
    {
        mainAudio        = GetComponent <AudioSource>();
        mm_audio         = GetComponent <AudioSource>();
        mainAudio.clip   = bazzi;
        mainAudio.volume = 0.5F;
        mainAudio.loop   = true;
        mainAudio.Play();

        Player();
        if (PhotonNetwork.IsMasterClient)
        {
            Debug.Log("IsMasterClient");
        }
        boosterItem1.enabled = false;
        boosterItem2.enabled = false;
        boosterItem3.enabled = false;
        boosterState.enabled = false;
        cloudItem.enabled    = false;
        rocketBar.SetActive(false);

        itemBox.sprite = emptyItem;

        if (autoFindKarts)
        {
            karts = FindObjectsOfType <ArcadeKart>();
            if (karts.Length > 0)
            {
                if (!playerPrefab)
                {
                    playerPrefab = karts[0];
                }
            }
            DebugUtility.HandleErrorIfNullFindObject <ArcadeKart, photonManager>(playerPrefab, this);
        }
        m_ObjectiveManager = FindObjectOfType <ObjectiveManager>();
        DebugUtility.HandleErrorIfNullFindObject <ObjectiveManager, photonManager>(m_ObjectiveManager, this);
        m_TimeManager = FindObjectOfType <TimeManager>();
        DebugUtility.HandleErrorIfNullFindObject <TimeManager, photonManager>(m_TimeManager, this);
        AudioUtility.SetMasterVolume(1);
        winDisplayMessage.gameObject.SetActive(false);
        loseDisplayMessage.gameObject.SetActive(false);
        m_TimeManager.StopRace();
        foreach (ArcadeKart k in karts)
        {
            Debug.Log("StopRace()");
            k.SetCanMove(false); // 못 움직이이게 함
            map1BoostCanStart = false;
        }

        //startButton
        if (!PhotonNetwork.IsMasterClient)
        {
            startButton.gameObject.SetActive(false);
        }
        startButton.onClick.AddListener(clickStartButton);
    }
    void Start()
    {
        m_WeaponsManager = GameObject.FindObjectOfType <PlayerWeaponsManager>();
        DebugUtility.HandleErrorIfNullFindObject <PlayerWeaponsManager, CrosshairManager>(m_WeaponsManager, this);

        OnWeaponChanged(m_WeaponsManager.GetActiveWeapon());

        m_WeaponsManager.onSwitchedToWeapon += OnWeaponChanged;
    }
Exemplo n.º 15
0
    void Start()
    {
        //m_WeaponsManager = GetComponentInParent<IS_PlayerWeaponsManager>();
        DebugUtility.HandleErrorIfNullFindObject <IS_PlayerWeaponsManager, CrosshairManager>(m_WeaponsManager, this);

        OnWeaponChanged(m_WeaponsManager.GetActiveWeapon());

        m_WeaponsManager.onSwitchedToWeapon += OnWeaponChanged;
    }
Exemplo n.º 16
0
    void OnEnable()
    {
        m_InitTime = Time.time;
        if (m_DisplayMessageManager == null)
        {
            m_DisplayMessageManager = FindObjectOfType <DisplayMessageManager>();
        }

        DebugUtility.HandleErrorIfNullFindObject <DisplayMessageManager, DisplayMessage>(m_DisplayMessageManager, this);
    }
Exemplo n.º 17
0
    void Start()
    {
        m_PlayerHealth = playerLife;

        m_GameFlowManager = FindObjectOfType <GameFlowManager>();
        DebugUtility.HandleErrorIfNullFindObject <GameFlowManager, FeedbackFlashHUD>(m_GameFlowManager, this);

        m_PlayerHealth.onDamaged += OnTakeDamage;
        m_PlayerHealth.onHealed  += OnHealed;
    }
Exemplo n.º 18
0
    void Awake()
    {
        IS_PlayerCharacterController IS_PlayerCharacterController = FindObjectOfType <IS_PlayerCharacterController>();

        DebugUtility.HandleErrorIfNullFindObject <IS_PlayerCharacterController, Compass>(IS_PlayerCharacterController, this);
        m_PlayerTransform = IS_PlayerCharacterController.transform;

        m_WidthMultiplier = compasRect.rect.width / visibilityAngle;
        m_heightOffset    = -compasRect.rect.height / 2;
    }
Exemplo n.º 19
0
    void Start()
    {
        PlayerCharacterController playerCharacterController = GameObject.FindObjectOfType <PlayerCharacterController>();

        DebugUtility.HandleErrorIfNullFindObject <PlayerCharacterController, FollowPlayer>(playerCharacterController, this);

        m_PlayerTransform = playerCharacterController.transform;

        m_OriginalOffset = transform.position - m_PlayerTransform.position;
    }
Exemplo n.º 20
0
    private void Start()
    {
        m_PlayerCharacterController = GetComponent <PlayerCharacterController>();
        DebugUtility.HandleErrorIfNullGetComponent <PlayerCharacterController, PlayerInputHandler>(m_PlayerCharacterController, this, gameObject);
        m_GameFlowManager = FindObjectOfType <GameFlowManager>();
        DebugUtility.HandleErrorIfNullFindObject <GameFlowManager, PlayerInputHandler>(m_GameFlowManager, this);

        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible   = false;
    }
Exemplo n.º 21
0
    void Start()
    {
        m_Player = FindObjectOfType <PlayerCharacterController>();
        DebugUtility.HandleErrorIfNullFindObject <PlayerCharacterController, GameFlowManager>(m_Player, this);

        m_ObjectiveManager = FindObjectOfType <ObjectiveManager>();
        DebugUtility.HandleErrorIfNullFindObject <ObjectiveManager, GameFlowManager>(m_ObjectiveManager, this);

        AudioUtility.SetMasterVolume(1);
    }
Exemplo n.º 22
0
    void Start()
    {
        m_Compass = FindObjectOfType <Compass>();
        DebugUtility.HandleErrorIfNullFindObject <Compass, CompassElement>(m_Compass, this);

        var markerInstance = Instantiate(compassMarkerPrefab);

        markerInstance.Initialize(this, textDirection);
        m_Compass.RegisterCompassElement(transform, markerInstance);
    }
Exemplo n.º 23
0
    private void LateUpdate()
    {
        m_PlayerCharacterController = GetComponent <PlayerCharacterController>();
        DebugUtility.HandleErrorIfNullGetComponent <PlayerCharacterController, PlayerInputHandler>(m_PlayerCharacterController, this, gameObject);
        m_GameFlowManager = FindObjectOfType <GameFlowManager>();
        DebugUtility.HandleErrorIfNullFindObject <GameFlowManager, PlayerInputHandler>(m_GameFlowManager, this);


        m_FireInputWasHeld = GetFireInputHeld();
    }
Exemplo n.º 24
0
    private void Start()
    {
        m_ActorsManager = GameObject.FindObjectOfType <ActorsManager>();
        DebugUtility.HandleErrorIfNullFindObject <ActorsManager, Actor>(m_ActorsManager, this);

        //アクターとして登録します
        if (!m_ActorsManager.actors.Contains(this))
        {
            m_ActorsManager.actors.Add(this);
        }
    }
Exemplo n.º 25
0
    private void Start()
    {
        m_TimeManager = FindObjectOfType <TimeManager>();
        DebugUtility.HandleErrorIfNullFindObject <TimeManager, ObjectiveReachTargets>(m_TimeManager, this);


        if (m_TimeManager.IsFinite)
        {
            timerText.text = "";
        }
    }
    public void HandleGameStart(float time)
    {
        _isPlaying     = true;
        gameIsEnding   = false;
        currentRound   = 0;
        _gameStartTime = Time.time;
        _gameEndTime   = 0;
        _roundOngoing  = true;
        //set roundendtime to curr time so that first round is started after timebetweenrounds seconds
        _roundEndTime = Time.time;
        difficulty    = 0;

        if (!m_Player)
        {
            m_Player = FindObjectOfType <PlayerCharacterController>();
            DebugUtility.HandleErrorIfNullFindObject <PlayerCharacterController, GameFlowManager>(m_Player, this);
        }
        // if(!_towerDirector)
        // {
        //     _towerDirector = GameObject.Find("Tower Director").GetComponent<Director>();
        //     if(!_towerDirector)
        //         Debug.LogWarning("[GameFlowManager] Could not find tower director");
        // }
        // if(!_golemDirector)
        // {
        //     _golemDirector = GameObject.Find("Golem Director").GetComponent<Director>();
        //     if(!_golemDirector)
        //         Debug.LogWarning("[GameFlowManager] Could not find golem director");
        // }
        if (!_smallEnemyDirector)
        {
            _smallEnemyDirector = GameObject.Find("Small Enemy Director").GetComponent <Director>();
            if (!_smallEnemyDirector)
            {
                Debug.LogWarning("[GameFlowManager] Could not find Small Enemy director");
            }
            _smallEnemyDirector.canGenerateCredits = true;
        }
        if (!_bigEnemyDirector)
        {
            _bigEnemyDirector = GameObject.Find("Big Enemy Director").GetComponent <Director>();
            if (!_bigEnemyDirector)
            {
                Debug.LogWarning("[GameFlowManager] Could not find Big Enemy director");
            }
            _bigEnemyDirector.canGenerateCredits = true;
        }
        // if(!_chestDirector)
        // {
        //     _chestDirector = GameObject.Find("Chest Director").GetComponent<Director>();
        //     if(!_chestDirector)
        //         Debug.LogWarning("[GameFlowManager] Could not find chest director");
        // }
    }
Exemplo n.º 27
0
    void Awake()
    {
        PlayerWeaponsManager playerWeaponsManager = FindObjectOfType <PlayerWeaponsManager>();

        DebugUtility.HandleErrorIfNullFindObject <PlayerWeaponsManager, NotificationHUDManager>(playerWeaponsManager, this);
        playerWeaponsManager.onAddedWeapon += OnPickupWeapon;

        //Jetpack jetpack = FindObjectOfType<Jetpack>();
        //DebugUtility.HandleErrorIfNullFindObject<Jetpack, NotificationHUDManager>(jetpack, this);
        //jetpack.onUnlockJetpack += OnUnlockJetpack;
    }
Exemplo n.º 28
0
        void Awake()
        {
            PlayerCharacterController playerCharacterController = FindObjectOfType <PlayerCharacterController>();

            DebugUtility.HandleErrorIfNullFindObject <PlayerCharacterController, Compass>(playerCharacterController,
                                                                                          this);
            m_PlayerTransform = playerCharacterController.transform;

            m_WidthMultiplier = CompasRect.rect.width / VisibilityAngle;
            m_HeightOffset    = -CompasRect.rect.height / 2;
        }
Exemplo n.º 29
0
    private void Start()
    {
        m_ActorsManager = GameObject.FindObjectOfType <ActorsManager>();
        DebugUtility.HandleErrorIfNullFindObject <ActorsManager, Actor>(m_ActorsManager, this);

        // Register as an actor
        // Agregar un actor
        if (!m_ActorsManager.actors.Contains(this))
        {
            m_ActorsManager.actors.Add(this);
        }
    }
    void Awake()
    {
        PlayerWeaponsManager playerWeaponsManager = FindObjectOfType <PlayerWeaponsManager>();

        DebugUtility.HandleErrorIfNullFindObject <PlayerWeaponsManager, NotificationHUDManager>(playerWeaponsManager, this);
        playerWeaponsManager.onAddedWeapon += OnPickupWeapon;
        StartCoroutine(OnSceneLoad(SceneManager.GetActiveScene().name));

        /* Jetpack jetpack = FindObjectOfType<Jetpack>();
         * DebugUtility.HandleErrorIfNullFindObject<Jetpack, NotificationHUDManager>(jetpack, this);
         * jetpack.onUnlockJetpack += OnUnlockJetpack; */
    }