예제 #1
0
        public override void Init()
        {
            movementController    = GetComponent <PlayerMovementController>();
            actionController      = GetComponent <PlayerActionController>();
            rotationController    = GetComponent <PlayerRotationController>();
            animationController   = GetComponent <PlayerAnimationController>();
            inventoryController   = GetComponent <PlayerInventoryController>();
            weaponController      = GetComponent <PlayerWeaponController>();
            healthController      = GetComponent <HealthController>();
            reloadController      = GetComponent <PlayerReloadController>();
            interactionController = GetComponent <InteractionSearcherController>();
            executionController   = GetComponent <PlayerExecutionController>();
            limbsController       = GetComponentInChildren <LimbsController>();
            hitboxController      = GetComponentInChildren <HitboxController>();
            abilityController     = GetComponent <AbilityController>();

            tickPlayer.value = true;

            movementController.Init();
            actionController.Init();
            rotationController.Init();
            animationController.Init();
            weaponController.Init();
            inventoryController.Init();
            healthController.Init();
            reloadController.Init();
            interactionController.Init();
            executionController.Init();
            limbsController.Init();
            hitboxController.Init();
            abilityController.Init();
        }
예제 #2
0
    void Start()
    {
        m_transform = transform;

        m_initialPosition = m_transform.localPosition;
        m_initialRotation = m_transform.localRotation;

        GameObject playerObject = MyHelper.FindFirstParentWithComponent(gameObject, typeof(PlayerMotor));

        m_playerMotor = playerObject.GetComponent <PlayerMotor>();

        GameObject rotationControllerObject = MyHelper.FindFirstParentWithComponent(gameObject, typeof(PlayerRotationController));

        m_playerRotationController = rotationControllerObject.GetComponent <PlayerRotationController>();

        positionalSmoothingStrength = 1f / positionalSmoothingStrength; //since the value is actually the inverse of smoothing
        rotationalSmoothingStrength = 1f / rotationalSmoothingStrength; //since the value is actually the inverse of smoothing
    }
예제 #3
0
 void Start()
 {
     offset = transform.position - player.transform.position;         //aquiring initial offset
     //playerController = player.GetComponent<PlayerController> ();
     rotationController = player.GetComponentInChildren <PlayerRotationController> ();
 }
예제 #4
0
    public void EnableUserControl(bool value)
    {
        PlayerRotationController rotationController = GetComponent <PlayerRotationController>();

        rotationController.enabled = value;
    }