private void Start()
 {
     playerMotor = GameManager.Instance.PlayerMotor;
     controller  = GetComponent <CharacterController>();
 }
示例#2
0
 void Start()
 {
     playerMotor   = GetComponent <PlayerMotor>();
     levitateMotor = GetComponent <LevitateMotor>();
     controller    = GetComponent <CharacterController>();
 }
        void Start()
        {
            // Store references
            dfUnity = DaggerfallUnity.Instance;
            dfAudioSource = GetComponent<DaggerfallAudioSource>();
            playerMotor = GetComponent<PlayerMotor>();
            playerEnterExit = GetComponent<PlayerEnterExit>();

            // Add our own custom audio source at runtime as we need to change the pitch of footsteps.
            // We don't want that affecting to other sounds on this game object.
            customAudioSource = gameObject.AddComponent<AudioSource>();
            customAudioSource.hideFlags = HideFlags.HideInInspector;
            customAudioSource.playOnAwake = false;
            customAudioSource.loop = false;
            customAudioSource.dopplerLevel = 0f;
            customAudioSource.spatialBlend = 0f;

            // Set start position
            lastPosition = GetHorizontalPosition();

            // Set starting footsteps
            currentFootstepSound = FootstepSoundNormal;
        }
        void Awake()
        {
            playerController = GetComponent<CharacterController>();
            playerMotor = GetComponent<PlayerMotor>();
            entityBehaviour = GetComponent<DaggerfallEntityBehaviour>();
            entityBehaviour.OnSetEntity += EntityBehaviour_OnSetEntity;
            mainCamera = GameManager.Instance.MainCamera;

            startCameraHeight = mainCamera.transform.localPosition.y;
        }
示例#5
0
 private void Start()
 {
     playerMotor   = GameManager.Instance.PlayerMotor;
     levitateMotor = GetComponent <LevitateMotor>();
 }
示例#6
0
 private void Start()
 {
     playerMotor   = GameManager.Instance.PlayerMotor;
     levitateMotor = GetComponent <LevitateMotor>();
     CanRun        = CanRunUnlessRiding;
 }
示例#7
0
        void Awake()
        {
            instance = this;

            Player = GameObject.FindGameObjectWithTag("Player");
            if (!Player)
                throw new Exception("Player object not set in FloatingOrigin script.");

            if (!StreamingWorld)
                throw new Exception("StreamingWorld not set in FloatingOrigin script.");

            playerMotor = Player.GetComponent<PlayerMotor>();
            if (!playerMotor)
                throw new Exception("Player object does not have a PlayerMotor.");
        }
示例#8
0
 private void Start()
 {
     playerMotor  = GetComponent <PlayerMotor>();
     speedChanger = GetComponent <PlayerSpeedChanger>();
     playerCamera = GameManager.Instance.MainCamera;
 }
 void Start()
 {
     playerMotor = GetComponent<PlayerMotor>();
     frictionMotor = GetComponent<FrictionMotor>();
     myTransform = playerMotor.transform;
 }
示例#10
0
 private void Start()
 {
     playerMotor = GameManager.Instance.PlayerMotor;
 }