Beispiel #1
0
        void Awake()
        {
            MovementValues values = this.GetComponent <MovementValues>();

            if (values != null)
            {
                movement.defaultForwardSpeed = values.defaultForwardSpeed;
                movement.maxCrouchSpeed      = values.maxCrouchSpeed;
                movement.maxSprintSpeed      = values.maxSprintSpeed;
                movement.minSprintSpeed      = values.minSprintSpeed;
                movement.maxAimSpeed         = values.maxAimSpeed;
                movement.maxProneSpeed       = values.maxProneSpeed;

                movement.defaultSidewaysSpeed = values.defaultSidewaysSpeed;
                movement.sprintSidewaysSpeed  = values.sprintSidewaysSpeed;
                movement.crouchSidewaysSpeed  = values.crouchSidewaysSpeed;
                movement.aimSidewaysSpeed     = values.aimSidewaysSpeed;
                movement.proneSidewaysSpeed   = values.proneSidewaysSpeed;

                movement.defaultBackwardsSpeed = values.defaultBackwardsSpeed;
                movement.crouchBackwardsSpeed  = values.crouchBackwardsSpeed;
                movement.aimBackwardsSpeed     = values.aimBackwardsSpeed;
                movement.proneBackwardsSpeed   = values.proneBackwardsSpeed;
            }

            controller         = GetComponent <CharacterController>();
            standardHeight     = controller.height;
            standardCenter     = controller.center.y;
            tr                 = transform;
            weaponCamera       = GameObject.FindWithTag("WeaponCamera");
            crouching          = false;
            prone              = false;
            standardCamHeight  = weaponCamera.transform.localPosition.y;
            crouchingCamHeight = standardCamHeight - crouchDeltaHeight;
            proneCamHeight     = standardCamHeight - proneDeltaHeight;
            NormalSpeed();
        }
Beispiel #2
0
 void Start()
 {
     CM     = PlayerWeapons.CM;
     values = MovementValues.singleton;
 }
Beispiel #3
0
 void Awake()
 {
     singleton = this;
 }