Ejemplo n.º 1
0
        void Start()
        {
            Instance = this;
            m_CharacterController = GetComponent <CharacterController>();
            //m_Animation = GetComponentInChildren<Animation>();
            m_Joystack = FindObjectOfType <JoystackCc>();
            if (m_Joystack == null)
            {
                Debug.LogWarning("cann't fiond joystack");
            }

            //m_CameraTrans = FindObjectOfType<GameCamera>().transform;
        }
Ejemplo n.º 2
0
        private void Start()
        {
            // get the transform of the main camera
            if (Camera.main != null)
            {
                m_Cam = Camera.main.transform;
            }
            else
            {
                Debug.LogWarning(
                    "Warning: no main camera found. Third person character needs a Camera tagged \"MainCamera\", for camera-relative controls.", gameObject);
                // we use self-relative controls in this case, which probably isn't what the user wants, but hey, we warned them!
            }

            // get the third person character ( this should never be null due to require component )
            m_Character = GetComponent <ThirdPersonCharacter>();

            m_Joystack = FindObjectOfType <JoystackCc>();
            if (m_Joystack == null)
            {
                Debug.LogWarning("cann't fiond joystack");
            }
        }