예제 #1
0
        private void Awake()
        {
            RigidBody           = GetComponent <Rigidbody>();
            CharacterController = GetComponent <CharacterController>();
            Teleporter          = GetComponent <HVRTeleporter>();
            if (Teleporter)
            {
                _hasTeleporter = true;
            }

            if (_hasTeleporter)
            {
                Teleporter.BeforeTeleport.AddListener(OnBeforeTeleport);
                Teleporter.AfterTeleport.AddListener(OnAfterTeleport);
            }

            Inputs = GetComponent <HVRPlayerInputs>();

            if (!ScreenFader)
            {
                var finder = FindObjectOfType <HVRGlobalFadeFinder>();
                if (finder)
                {
                    ScreenFader = finder.gameObject.GetComponent <HVRScreenFade>();
                }
            }
        }