// Use this for initialization
 private void Start()
 {
     _characterController = GetComponent <CharacterController>();
     _camera = Camera.main;
     _originalCameraPosition = _camera.transform.localPosition;
     _mouseLook.Init(transform, _camera.transform);
     _fovKick.Setup(_camera);
     _headBob.Setup(_camera, _stepInterval);
     _stepCycle   = 0f;
     _nextStep    = _stepCycle / 2f;
     _stamina     = GetComponent <Stamina>();
     _jumping     = false;
     _audioSource = GetComponent <AudioSource>();
     _underWater  = FindObjectOfType <UnderWater>();
     _mana        = FindObjectOfType <Mana>();
 }
Example #2
0
 // Use this for initialization
 private void Start()
 {
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
     gameController       = GameObject.Find("Game Controller");
     gameControllerScript = gameController.GetComponent <GameController>();
     isPlayerAlive        = true;
 }
    //public int m_iScore = 0;

    // Use this for initialization
    private void Start()
    {
        //m_iHP = 100;
        //m_iBullet = 100;
        //m_iScore = 0;

        m_CharacterController = GetComponent <CharacterController>();
        m_Camera = Camera.main;
        m_OriginalCameraPosition = m_Camera.transform.localPosition;
        m_FovKick.Setup(m_Camera);
        m_HeadBob.Setup(m_Camera, m_StepInterval);
        m_StepCycle   = 0f;
        m_NextStep    = m_StepCycle / 2f;
        m_Jumping     = false;
        m_AudioSource = GetComponent <AudioSource>();
        m_MouseLook.Init(transform, m_Camera.transform);
    }
Example #4
0
 private void Start()
 {
     #region StandardFPS
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
     m_WalkSpeedStore = m_WalkSpeed;
     #endregion
     PlayerInit();
 }
 /// <summary>
 ///
 /// </summary>
 protected override void Awake()
 {
     base.Awake();
     m_CharacterController = GetComponent <CharacterController>();
     RoomMenu   = FindObjectOfType <bl_RoomMenu>();
     GunManager = GetComponentInChildren <bl_GunManager>();
     m_Camera   = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     defaultCameraRPosition   = CameraRoot.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, HeatRoot, RoomMenu, GunManager);
 }
Example #6
0
    // Use this for initialization
    public void Start()
    {
        m_CharacterController = GetComponent <CharacterController>();
        m_Camera = Camera.main;
        m_OriginalCameraPosition = m_Camera.transform.localPosition;
        m_HeadBob.Setup(m_Camera, m_StepInterval);
        m_StepCycle   = 0f;
        m_NextStep    = m_StepCycle / 2f;
        m_AudioSource = GetComponent <AudioSource>();
        m_MouseLook.Init(transform, m_Camera.transform);

        //Crouching
        m_StandardHeight = m_CharacterController.height;
        m_CrouchHeight   = m_CharacterController.height / 2;
        m_Crouching      = false;
        yes = true;
    }
Example #7
0
 // Use this for initialization
 private void Start()
 {
     m_Camera = Camera.main;
     m_CharacterController    = GetComponent <CharacterController>();
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     SetCursorLockState(false);
     m_MouseLook.Init(transform, m_Camera.transform);
     SetCursorLockState(true);
     _RotateCamera = true;
     SetGameRunning(true);
 }
Example #8
0
    // Use this for initialization
    private void Start()
    {
        m_CharacterController = GetComponent <CharacterController>();
        m_Camera = Camera.main;
        m_OriginalCameraPosition = m_Camera.transform.localPosition;
        m_FovKick.Setup(m_Camera);
        m_HeadBob.Setup(m_Camera, m_StepInterval);
        m_StepCycle   = 0f;
        m_NextStep    = m_StepCycle / 2f;
        m_Jumping     = false;
        m_AudioSource = GetComponent <AudioSource>();
        m_MouseLook.Init(transform, m_Camera.transform);


        m_vingette = GetComponentInChildren <Vingette>();
        //  m_CharacterController.material.dynamicFriction = 0.9f;
    }
Example #9
0
 // Use this for initialization
 private void Start()
 {
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
     m_Anim          = GetComponent <Animator>();
     m_PlayerManager = GetComponent <PlayerManager>();
     // Crouch
     playerHeight = m_CharacterController.height;
 }
 public void Start()
 {
     _audioSource             = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <AudioSource>();
     LooseSound               = (AudioClip)Resources.Load("Sounds/Loose");
     HitSound                 = (AudioClip)Resources.Load("Sounds/Hit");
     m_CharacterController    = GetComponent <CharacterController>();
     m_Camera                 = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
     UIManager.Instance.UpdateLives(Lives);
 }
    // Use this for initialization
    private void Start()
    {
        if (isLocalPlayer)
        {
            m_CharacterController = GetComponent <CharacterController>();
            m_Camera = Camera.main;
            m_OriginalCameraPosition = m_Camera.transform.localPosition;
            m_FovKick.Setup(m_Camera);
            m_HeadBob.Setup(m_Camera, m_StepInterval);
            m_StepCycle = 0f;
            m_NextStep  = m_StepCycle / 2f;
            m_Jumping   = false;
            m_MouseLook.Init(transform, m_Camera.transform);

            currentPower = PowerUp.NONE;
            health       = gameObject.GetComponent <Health>();
            inventory    = gameObject.GetComponent <Inventory>();
            powerActive  = false; doubleDamageVar = false;
            pistol.SetActive(true); SMG.SetActive(false);
            chatUp = false;

            //Attaches the gun to the camera
            foreach (Transform child in transform)
            {
                if (child.CompareTag("Rifle"))
                {
                    child.SetParent(Camera.main.transform, false);
                    Vector3 newPos = child.position;
                    newPos.y      -= 0.5f;
                    newPos.z      -= 0.05f;
                    child.position = newPos;
                    break;
                }
            }

            powerUpTimerText      = GameObject.FindGameObjectWithTag("Timer").GetComponent <Text>();
            powerUpTimerText.text = "";

            powerEffect.Add(PowerUp.DOUBLE_DAMAGE, doubleDamage);
            powerEffect.Add(PowerUp.FAST_FIRE, fastFire);
            powerEffect.Add(PowerUp.FAST_MOVE, fastWalk);
            powerEffect.Add(PowerUp.JUMP_HIGH, jumpHigh);
            powerEffect.Add(PowerUp.INVINCIBLE, invincible);
        }
    }
Example #12
0
 // Use this for initialization
 private void Start()
 {
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook   = new MouseLook
     {
         smooth     = true,
         smoothTime = 2f
     };
     m_MouseLook.Init(transform, m_Camera.transform);
 }
 // Use this for initialization
 private void Start()
 {
     if (!instantiated)
     {
         m_CharacterController = GetComponent <CharacterController>();
         m_Camera = Camera.main;
         m_OriginalCameraPosition = m_Camera.transform.localPosition;
         m_FovKick.Setup(m_Camera);
         m_HeadBob.Setup(m_Camera, m_StepInterval);
         m_StepCycle   = 0f;
         m_NextStep    = m_StepCycle / 2f;
         m_Jumping     = false;
         m_AudioSource = GetComponent <AudioSource>();
         //m_AudioSource.volume = PlayerPrefs.GetFloat("Sound");
         m_AudioSource.enabled = false;
         instantiated          = true;
     }
 }
Example #14
0
    public void Start()
    {
        _networkView = GetComponent <NetworkView>();

        if (_networkView.isMine)
        {
            m_CharacterController = GetComponent <CharacterController>();
            m_Camera = this.gameObject.GetComponentInChildren <Camera>();

            m_OriginalCameraPosition = m_Camera.transform.localPosition;
            m_FovKick.Setup(m_Camera);
            m_HeadBob.Setup(m_Camera, m_StepInterval);
            m_StepCycle = 0f;
            m_NextStep  = m_StepCycle / 2f;
            m_Jumping   = false;
            m_MouseLook.Init(transform, m_Camera.transform);
        }
    }
Example #15
0
 // Use this for initialization
 protected virtual void Start()
 {
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_HeadBob.HorizontalBobRange        = 0.03f;
     m_HeadBob.VerticalBobRange          = 0.03f;
     m_HeadBob.VerticaltoHorizontalRatio = 2;
     m_JumpBob.BobAmount   = 0.1f;
     m_JumpBob.BobDuration = 0.2f;
     m_StepCycle           = 0f;
     m_NextStep            = m_StepCycle / 2f;
     m_Jumping             = false;
     m_AudioSource         = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
 }
Example #16
0
    // Use this for initialization
    private void Start()
    {
        m_CharacterController = GetComponent <CharacterController>();
        m_Camera = Camera.main;
        m_OriginalCameraPosition = m_Camera.transform.localPosition;
        m_FovKick.Setup(m_Camera);
        m_HeadBob.Setup(m_Camera, m_StepInterval);
        m_StepCycle   = 0f;
        m_NextStep    = m_StepCycle / 2f;
        m_Jumping     = false;
        m_AudioSource = GetComponent <AudioSource>();
        m_MouseLook.Init(transform, m_Camera.transform);

        // Eskild: Need to declare variables in order to change them via scripts.
        m_WalkSpeed    = 8f;
        m_RunSpeed     = 8f;
        gravityEnabled = true;
    }
Example #17
0
 // Use this for initialization
 private void Start()
 {
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
     //added flying flags
     m_Flying           = false;
     m_PreviouslyFlying = false;
     m_Descending       = false;
     m_Ascending        = false;
 }
 // Use this for initialization
 private void Start()
 {
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = GetComponentInChildren <Camera>();
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
     GetComponentInChildren <Renderer>().material.color = playerColour;
     if (!isLocalPlayer)
     {
         m_Camera.gameObject.SetActive(false);
     }
 }
        private bool LockOn_Mode;   //  Lock camera rotate on a GameObject casteable



        // Use this for initialization
        private void Start()
        {
            m_CharacterController = GetComponent <CharacterController>();
            m_Camera = Camera.main;
            m_OriginalCameraPosition = m_Camera.transform.localPosition;
            m_FovKick.Setup(m_Camera);
            m_HeadBob.Setup(m_Camera, m_StepInterval);
            m_StepCycle   = 0f;
            m_NextStep    = m_StepCycle / 2f;
            m_Jumping     = false;
            m_AudioSource = GetComponent <AudioSource>();
            m_MouseLook.Init(transform, m_Camera.transform);

            //---
            LockOn_Mode      = false;
            gun              = GameObject.Find("Gun");
            Camera_transform = GetComponentInChildren <Camera> ().transform;
        }
    // Use this for initialization
    private void Start()
    {
        _rigid       = GetComponent <Rigidbody>();
        _collider    = GetComponent <Collider>();
        distToGround = _collider.bounds.extents.y;

        //m_CharacterController = GetComponent<CharacterController>();
        m_Camera = Camera.main;
        m_OriginalCameraPosition = m_Camera.transform.localPosition;
        m_FovKick.Setup(m_Camera);
        m_HeadBob.Setup(m_Camera, m_StepInterval);
        m_StepCycle   = 0f;
        m_NextStep    = m_StepCycle / 2f;
        m_Jumping     = false;
        m_AudioSource = GetComponent <AudioSource>();
        m_MouseLook.Init(transform, m_Camera.transform);
        _test = transform.localRotation;
    }
Example #21
0
 // Use this for initialization
 private void Start()
 {
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     gameOver      = false;
     playerDied    = false;
     m_AudioSource = GetComponent <AudioSource>();
     mouseLook     = GetComponentInChildren <MouseLook>();
     //m_MouseLook.Init(transform , m_Camera.transform);
     g            = GetComponent <PlayerGravity>();
     oxygenScript = GetComponent <OxygenLevels>();
     numKeycards  = 0;
 }
    // Use this for initialization
    private void Start()
    {
        /*if(isLocalPlayer) {
         *  GameObject screen = GEController.instance.uiTransitionScreen;
         *  screen.SetActive(true);
         * }*/
        GEController.instance.uiLobbyMenuNew.SetActive(false);
        //GameObject.Find("GameManager").GetComponent<MyNetworkManager>().setLocalPlayer(gameObject);

        nView = GetComponent <NetworkIdentity>();

        m_CharacterController = GetComponent <CharacterController>();
        m_Camera = Camera.main;
        m_OriginalCameraPosition = m_Camera.transform.localPosition;
        m_FovKick.Setup(m_Camera);
        m_HeadBob.Setup(m_Camera, m_StepInterval);
        m_StepCycle   = 0f;
        m_NextStep    = m_StepCycle / 2f;
        m_Jumping     = false;
        m_AudioSource = GetComponent <AudioSource>();
        m_MouseLook.Init(transform, m_Camera.transform);

        gameObject.name = "Player_" + nView.netId;

        //Debug.Log("Owner: " + nView.clientAuthorityOwner);
        if (!nView.isLocalPlayer)
        {
            GameObject.Find(gameObject.name + "/MainCamera").GetComponent <Camera>().enabled        = false;
            GameObject.Find(gameObject.name + "/MainCamera").GetComponent <AudioListener>().enabled = false;
        }
        else
        {
            if (plrVisor != null)
            {
                plrVisor.SetActive(false);
            }
        }
        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible   = false;
        cursorLock       = false;
        //GameObject.Find("GAME_ENGINE").GetComponent<GEController>().SpawnPlayer();
    }
    private void Start()
    {
        m_CharacterController = GetComponent <CharacterController>();
        m_Camera                     = Camera.main;
        Camera.main.enabled          = true;
        m_OriginalCameraPosition     = m_Camera.transform.localPosition;
        m_OriginalFlashlightPosition = m_Flashlight.transform.localPosition;
        m_FovKick.Setup(m_Camera);
        m_HeadBob.Setup(m_Camera, m_StepInterval);
        m_StepCycle   = 0f;
        m_NextStep    = m_StepCycle / 2f;
        m_AudioSource = GetComponent <AudioSource>();
        m_MouseLook.Init(transform, m_Camera.transform, m_Flashlight.transform);

        instance = this;
        dying    = false;

        clickHandler = null;
        InteractUI   = GameObject.FindGameObjectWithTag("InteractUI").GetComponent <UnityEngine.UI.Text>();
    }
 // Use this for initialization
 private void Start()
 {
     gameStatus            = GameObject.Find("GameStatus").GetComponent <GameStatus> ();
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_Prone       = false;
     wasCrouching  = false;
     wasProne      = false;
     m_AudioSource = GetComponent <AudioSource>();
     weaponManager = GetComponent <WeaponManager>();
     cameraManager = Camera.main.GetComponent <CameraManager> ();
     noWeaponSpeed = 0.1f;
     m_MouseLook.Init(transform, m_Camera.transform);
 }
Example #25
0
 // Use this for initialization
 private void Start()
 {
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = this.GetComponentInChildren <Camera>();
     Debug.Log(m_Camera);
     m_Camera.gameObject.SetActive(false);
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_UseHeadBob  = false;
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
     tracerLocTexture = tracerLocPaint = 0;
     this.gameObject.SetActive(false);
     UIEnabled = false;
     lastTime  = Time.time;
 }
        // Use this for initialization
        private void Start()
        {
            m_CharacterController.enabled = true;

            if (isLocalPlayer)
            {
                m_Camera.enabled         = true;
                m_OriginalCameraPosition = m_Camera.transform.localPosition;
                m_FovKick.Setup(m_Camera);
                m_HeadBob.Setup(m_Camera, m_StepInterval);
                m_StepCycle           = 0f;
                m_NextStep            = m_StepCycle / 2f;
                m_Jumping             = false;
                m_AudioSource.enabled = true;
                m_MouseLook.Init(transform, m_Camera.transform);
                _minimapCamera.enabled = true;
                _audioListener.enabled = true;
                transform.position     = GameObject.Find("Spawn").transform.position;
            }
        }
Example #27
0
 // Use this for initialization
 private void Start()
 {
     m_CharacterController = GetComponent <CharacterController>();
     m_Camera = Camera.main;
     m_OriginalCameraPosition = m_Camera.transform.localPosition;
     m_FovKick.Setup(m_Camera);
     m_HeadBob.Setup(m_Camera, m_StepInterval);
     m_StepCycle   = 0f;
     m_NextStep    = m_StepCycle / 2f;
     m_Jumping     = false;
     m_AudioSource = GetComponent <AudioSource>();
     m_MouseLook.Init(transform, m_Camera.transform);
     m_hold_fire_button            = false;
     m_reaload                     = false;
     m_Animator                    = GetComponent <Animator>();
     m_crossbow                    = GameObject.Find("crossbow");
     m_waepon_Animator             = GameObject.Find("crossbow").GetComponent <Animator>();
     m_arrow_spawn_position_top    = GameObject.Find("arrow_spawn_top").transform;
     m_arrow_spawn_position_bottom = GameObject.Find("arrow_spawn_bottom").transform;
 }
Example #28
0
    // Use this for initialization
    private void Start()
    {
        Transform[] ParentCam = GetComponentsInChildren <Transform>();

        for (int i = 0; i < ParentCam.Length; i++)
        {
            if (ParentCam[i].GetComponent <Camera>())
            {
                m_Camera = ParentCam[i].GetComponent <Camera>();
            }
        }
        m_CharacterController    = GetComponent <CharacterController>();
        m_OriginalCameraPosition = m_OriginalCameraPosition == Vector3.zero ? m_Camera.transform.localPosition : m_OriginalCameraPosition;
        m_FovKick.Setup(m_Camera);
        m_HeadBob.Setup(m_OriginalCameraPosition, m_StepInterval);
        m_StepCycle   = 0f;
        m_NextStep    = m_StepCycle / 2f;
        m_Jumping     = false;
        m_AudioSource = GetComponent <AudioSource>();
        m_MouseLook.Init(transform, m_Camera.transform);
    }
Example #29
0
    // Use this for initialization
    void Start()
    {
        Physics.queriesHitBackfaces = true;

        Cursor.lockState = CursorLockMode.Locked;
        camera           = transform.Find("camera");
        vcamWide         = camera.Find("vcam_wide").gameObject;
        cc           = GetComponent <CharacterController>();
        handCam      = Camera.main.transform.Find("Camera").GetComponent <Camera>();
        handAnimator = Camera.main.transform.Find("hand").GetComponent <Animator>();

        m_HeadBob.Setup(camera, 5);

        TagNodeCompound levelDat  = NBTHelper.GetLevelDat();
        TagNodeCompound player    = levelDat["Player"] as TagNodeCompound;
        TagNodeCompound abilities = player["abilities"] as TagNodeCompound;
        TagNodeByte     flying    = abilities["flying"] as TagNodeByte;

        isFlying = flying == 1 ? true : false;

        transform.position                = DataCenter.spawnPosition;
        transform.localEulerAngles        = new Vector3(0, -DataCenter.spawnRotation.y, 0);
        camera.transform.localEulerAngles = new Vector3(DataCenter.spawnRotation.z, 0, 0);

        //NetworkManager.Register(ENUM_CMD.CS_ADD_BLOCK_NOTIFY, OnAddBlockNotify);
        //NetworkManager.Register(ENUM_CMD.CS_DELETE_BLOCK_NOTIFY, OnDeleteBlockNotify);

        LoadingUI.Close();
        CrossHair.Show();
        Hand.Show();

        blockMeshFilter   = Camera.main.transform.Find("hand/block").GetComponent <MeshFilter>();
        blockMeshRenderer = Camera.main.transform.Find("hand/block").GetComponent <MeshRenderer>();
        handMeshRenderer  = Camera.main.transform.Find("hand").GetComponent <MeshRenderer>();

        position = transform.position;
        forward  = transform.forward;

        isInitialized = true;
    }
Example #30
0
    // Start is called before the first frame update
    private void Start()
    {
        m_CharacterController = GetComponent <CharacterController>();
        m_playerLook          = GetComponent <PlayerLookController>();
        m_AudioSource         = GetComponent <AudioSource>();
        Character             = GetComponent <Character>();
        PlayerWeaponsManager  = GetComponent <PlayerWeaponsManager>();

        m_HeadBob.Setup(MainCamera, m_StepInterval);
        m_playerLook.Init(transform, RotatePoint);
        m_FovKick.Setup(MainCamera);
        m_OriginalCameraPosition = MainCamera.transform.localPosition;
        m_StepCycle    = 0f;
        m_NextStep     = m_StepCycle / 2f;
        m_Jumping      = false;
        CurrentStamina = MaxStamina;

        Character.Health.onDie     += OnDie;
        Character.Health.onDamaged += OnDamage;

        Instance = this;
    }