예제 #1
0
        private void Awake()
        {
            m_keybindings = new Dictionary <KeyCode, InputEvent>();

            //Set up player character references if available
            if (!m_charBodyRef && m_charCtrlRef)
            {
                m_charBodyRef = m_charCtrlRef.transform;
            }
            if (!m_charCamContainerRef && m_charCtrlRef)
            {
                m_charCamContainerRef = m_charCtrlRef.transform.GetChild(0);
            }

            if (!m_netMgrRef)
            {
                if (GameObject.Find("NetworkManager"))
                {
                    m_netMgrRef = GameObject.Find("NetworkManager").GetComponent <FPSNetworkCode.NetworkManager>();
                }
            }
        }
예제 #2
0
        private void Start()
        {
            DefaultKeybinds();

            if (!m_netMgrRef)
            {
                if (GameObject.Find("NetworkManager"))
                {
                    m_netMgrRef = GameObject.Find("NetworkManager").GetComponent <FPSNetworkCode.NetworkManager>();
                }
            }

            if (bLockCursorToCenter)
            {
                Cursor.lockState = CursorLockMode.Locked;
            }

            //Move the main camera into the player character prefab that this will control
            if (m_charMainCamRef && m_charCamContainerRef)
            {
                m_charMainCamRef.SetParent(m_charCamContainerRef);
                m_charMainCamRef.localPosition = Vector3.zero;
            }

            //Provide the player character with reference to AmmoController.cs
            if (m_charCtrlRef && m_ammoCtrlRef)
            {
                m_charCtrlRef.m_ammoCtrlRef = this.m_ammoCtrlRef;
            }

            //Hide profile window
            if (m_profileRef)
            {
                m_profileRef.SetActive(false);
            }
        }