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(); }
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 }
void Start() { offset = transform.position - player.transform.position; //aquiring initial offset //playerController = player.GetComponent<PlayerController> (); rotationController = player.GetComponentInChildren <PlayerRotationController> (); }
public void EnableUserControl(bool value) { PlayerRotationController rotationController = GetComponent <PlayerRotationController>(); rotationController.enabled = value; }