/// --------------------------------------------- /// Ultimate Character Controller /// Copyright (c) Opsive. All Rights Reserved. /// https://www.opsive.com /// --------------------------------------------- namespace Opsive.UltimateCharacterController.Networking.Character { using Opsive.UltimateCharacterController.Character; using Opsive.UltimateCharacterController.Items.Actions; using UnityEngine; /// /// Acts as a bridge between the character controller and the underlying networking implementation. /// public interface INetworkCharacter { /// /// Loads the inventory's default loadout. /// void LoadDefaultLoadout(); /// /// Equips or unequips the item with the specified ItemIdentifier and slot. /// /// The ID of the ItemIdentifier that should be equipped. /// The slot of the item that should be equipped. /// Should the item be equipped? If false it will be unequipped. void EquipUnequipItem(uint itemIdentifierID, int slotID, bool equip); /// /// The ItemIdentifier has been picked up. /// /// The ID of the ItemIdentifier that was picked up. /// The number of ItemIdentifier picked up. /// The ID of the slot which the item belongs to. /// Was the item be picked up immediately? /// Should the item be force equipped? void ItemIdentifierPickup(uint itemIdentifierID, int amount, int slotID, bool immediatePickup, bool forceEquip); /// /// Removes all of the items from the inventory. /// void RemoveAllItems(); #if ULTIMATE_CHARACTER_CONTROLLER_SHOOTER /// /// Fires the weapon. /// /// The ItemAction that is being fired. /// (0 - 1) value indicating the amount of strength to apply to the shot. void Fire(ItemAction itemAction, float strength); /// /// Starts to reload the item. /// /// The ItemAction that is being reloaded. void StartItemReload(ItemAction itemAction); /// /// Reloads the item. /// /// The ItemAction that is being reloaded. /// Should the full clip be force reloaded? void ReloadItem(ItemAction itemAction, bool fullClip); /// /// The item has finished reloading. /// /// The ItemAction that is being reloaded. /// Was the item reloaded successfully? /// Should the item be reloaded immediately? void ItemReloadComplete(ItemAction itemAction, bool success, bool immediateReload); #endif #if ULTIMATE_CHARACTER_CONTROLLER_MELEE /// /// The melee weapon hit a collider. /// /// The ItemAction that caused the collision. /// The index of the hitbox that caused the collision. /// The raycast that caused the collision. /// The GameObject that was hit. /// The hit Ultimate Character Locomotion component. void MeleeHitCollider(ItemAction itemAction, int hitboxIndex, RaycastHit raycastHit, GameObject hitGameObject, UltimateCharacterLocomotion hitCharacterLocomotion); #endif /// /// Throws the throwable object. /// /// The ThrowableItem that is performing the throw. void ThrowItem(ItemAction itemAction); /// /// Enables the object mesh renderers for the ThrowableItem. /// /// The ThrowableItem that is having the renderers enabled. void EnableThrowableObjectMeshRenderers(ItemAction itemAction); /// /// Starts or stops the begin or end actions. /// /// The MagicItem that is starting or stopping the actions. /// Should the begin actions be started? /// Should the actions be started? void StartStopBeginEndMagicActions(ItemAction itemAction, bool beginActions, bool start); /// /// Casts a magic CastAction. /// /// The MagicItem that is performing the cast. /// The index of the CastAction. /// The ID of the cast. /// The direction of the cast. /// The target position of the cast. void MagicCast(ItemAction itemAction, int index, uint castID, Vector3 direction, Vector3 targetPosition); /// /// Performs the magic impact. /// /// The MagicItem that is performing the impact. /// The ID of the cast. /// The object that originated the impact. /// The object that received the impact. /// The position of the impact. /// The impact normal direction. void MagicImpact(ItemAction itemAction, uint castID, GameObject source, GameObject target, Vector3 position, Vector3 normal); /// /// Stops the magic CastAction. /// /// The MagicItem that is stopping the cast. /// The index of the CastAction. /// The ID of the cast. void StopMagicCast(ItemAction itemAction, int index, uint castID); /// /// Activates or deactives the flashlight. /// /// Should the flashlight be activated? void ToggleFlashlight(ItemAction itemAction, bool active); /// /// Pushes the target Rigidbody in the specified direction. /// /// The Rigidbody to push. /// The amount of force to apply. /// The point at which to apply the push force. void PushRigidbody(Rigidbody targetRigidbody, Vector3 force, Vector3 point); /// /// Sets the rotation of the character. /// /// The rotation to set. /// Should the animator be snapped into position? void SetRotation(Quaternion rotation, bool snapAnimator); /// /// Sets the position of the character. /// /// The position to set. /// Should the animator be snapped into position? void SetPosition(Vector3 position, bool snapAnimator); /// /// Resets the rotation and position to their default values. /// void ResetRotationPosition(); /// /// Sets the position and rotation of the character. /// /// The position to set. /// The rotation to set. /// Should the animator be snapped into position? void SetPositionAndRotation(Vector3 position, Quaternion rotation, bool snapAnimator); /// /// Activates or deactivates the character. /// /// Is the character active? /// Should the OnShowUI event be executed? void SetActive(bool active, bool uiEvent); } }