/// --------------------------------------------- /// Ultimate Character Controller /// Copyright (c) Opsive. All Rights Reserved. /// https://www.opsive.com /// --------------------------------------------- #if NET_4_6 || UNITY_2018_3_OR_NEWER || UNITY_WEBGL || UNITY_IOS || UNITY_ANDROID || UNITY_WII || UNITY_WIIU || UNITY_SWITCH || UNITY_PS3 || UNITY_PS4 || UNITY_XBOXONE || UNITY_WSA namespace Opsive.UltimateCharacterController.StateSystem { using System; using UnityEngine; // This class is required in order for the preset system to work with AOT platforms. The preset system uses reflection to generate the delegates // and reflection doesn't play well with AOT because the classes need to be defined ahead of time. Define the classes here so the compiler will // add in the correct type. This code is not actually used anywhere, it is purely for the compiler. public class AOTLinker : MonoBehaviour { public void Linker() { #pragma warning disable 0219 var intGenericDelegate = new Preset.GenericDelegate(); var intFuncDelegate = new Func(() => { return 0; }); var intActionDelegate = new Action((int value) => { }); var floatGenericDelegate = new Preset.GenericDelegate(); var floatFuncDelegate = new Func(() => { return 0; }); var floatActionDelegate = new Action((float value) => { }); var uintGenericDelegate = new Preset.GenericDelegate(); var uintFuncDelegate = new Func(() => { return 0; }); var uintActionDelegate = new Action((uint value) => { }); var doubleGenericDelegate = new Preset.GenericDelegate(); var doubleFuncDelegate = new Func(() => { return 0; }); var doubleActionDelegate = new Action((double value) => { }); var longGenericDelegate = new Preset.GenericDelegate(); var longFuncDelegate = new Func(() => { return 0; }); var longActionDelegate = new Action((long value) => { }); var boolGenericDelegate = new Preset.GenericDelegate(); var boolFuncDelegate = new Func(() => { return true; }); var boolActionDelegate = new Action((bool value) => { }); var stringGenericDelegate = new Preset.GenericDelegate(); var stringFuncDelegate = new Func(() => { return string.Empty; }); var stringActionDelegate = new Action((string value) => { }); var byteGenericDelegate = new Preset.GenericDelegate(); var byteFuncDelegate = new Func(() => { return new byte(); }); var byteActionDelegate = new Action((byte value) => { }); var vector2GenericDelegate = new Preset.GenericDelegate(); var vector2FuncDelegate = new Func(() => { return Vector2.zero; }); var vector2ActionDelegate = new Action((Vector2 value) => { }); var vector3GenericDelegate = new Preset.GenericDelegate(); var vector3FuncDelegate = new Func(() => { return Vector3.zero; }); var vector3ActionDelegate = new Action((Vector3 value) => { }); var vector4GenericDelegate = new Preset.GenericDelegate(); var vector4FuncDelegate = new Func(() => { return Vector4.zero; }); var vector4ActionDelegate = new Action((Vector4 value) => { }); var quaternionGenericDelegate = new Preset.GenericDelegate(); var quaternionFuncDelegate = new Func(() => { return Quaternion.identity; }); var quaternionActionDelegate = new Action((Quaternion value) => { }); var colorGenericDelegate = new Preset.GenericDelegate(); var colorFuncDelegate = new Func(() => { return Color.white; }); var colorActionDelegate = new Action((Color value) => { }); var rectGenericDelegate = new Preset.GenericDelegate(); var rectFuncDelegate = new Func(() => { return Rect.zero; }); var rectActionDelegate = new Action((Rect value) => { }); var matrix4x4GenericDelegate = new Preset.GenericDelegate(); var matrix4x4FuncDelegate = new Func(() => { return Matrix4x4.zero; }); var matrix4x4ActionDelegate = new Action((Matrix4x4 value) => { }); var animationCurveGenericDelegate = new Preset.GenericDelegate(); var animationCurveFuncDelegate = new Func(() => { return new AnimationCurve(); }); var animationCurveActionDelegate = new Action((AnimationCurve value) => { }); var layerMaskGenericDelegate = new Preset.GenericDelegate(); var layerMaskFuncDelegate = new Func(() => { return new LayerMask(); }); var layerMaskActionDelegate = new Action((LayerMask value) => { }); var humanBodyBonesGenericDelegate = new Preset.GenericDelegate(); var humanBodyBonesFuncDelegate = new Func(() => { return 0; }); var humanBodyBonesActionDelegate = new Action((HumanBodyBones value) => { }); var queryTriggerInteractionGenericDelegate = new Preset.GenericDelegate(); var queryTriggerInteractionFuncDelegate = new Func(() => { return 0; }); var queryTriggerInteractionActionDelegate = new Action((QueryTriggerInteraction value) => { }); var forceModeGenericDelegate = new Preset.GenericDelegate(); var forceModeFuncDelegate = new Func(() => { return 0; }); var forceModeActionDelegate = new Action((ForceMode value) => { }); var unityObjectGenericDelegate = new Preset.GenericDelegate(); var unityObjectFuncDelegate = new Func(() => { return new UnityEngine.Object(); }); var unityObjectActionDelegate = new Action((UnityEngine.Object value) => { }); var gameObjectGenericDelegate = new Preset.GenericDelegate(); var gameObjectFuncDelegate = new Func(() => { return null; }); var gameObjectActionDelegate = new Action((GameObject value) => { }); var transformGenericDelegate = new Preset.GenericDelegate(); var transformFuncDelegate = new Func(() => { return null; }); var transformActionDelegate = new Action((Transform value) => { }); var minMaxFloatGenericDelegate = new Preset.GenericDelegate(); var minMaxFloatFuncDelegate = new Func(() => { return new Utility.MinMaxFloat(); }); var minMaxFloatActionDelegate = new Action((Utility.MinMaxFloat value) => { }); var minMaxVector3GenericDelegate = new Preset.GenericDelegate(); var minMaxVector3FuncDelegate = new Func(() => { return new Utility.MinMaxVector3(); }); var minMaxVector3ActionDelegate = new Action((Utility.MinMaxVector3 value) => { }); var lookVectorModeGenericDelegate = new Preset.GenericDelegate(); var lookVectorModeFuncDelegate = new Func(() => { return 0; }); var lookVectorModeActionDelegate = new Action((UltimateCharacterController.Input.PlayerInput.LookVectorMode value) => { }); var preloadedPrefabGenericDelegate = new Preset.GenericDelegate(); var preloadedPrefabFuncDelegate = new Func(() => { return new Shared.Game.ObjectPool.PreloadedPrefab(); }); var preloadedPrefabActionDelegate = new Action((Shared.Game.ObjectPool.PreloadedPrefab value) => { }); var abilityStartTypeGenericDelegate = new Preset.GenericDelegate(); var abilityStartTypeFuncDelegate = new Func(() => { return 0; }); var abilityStartTypeActionDelegate = new Action((Character.Abilities.Ability.AbilityStartType value) => { }); var abilityStopTypeGenericDelegate = new Preset.GenericDelegate(); var abilityStopTypeFuncDelegate = new Func(() => { return 0; }); var abilityStopTypeActionDelegate = new Action((Character.Abilities.Ability.AbilityStopType value) => { }); var abilityBoolOverrideGenericDelegate = new Preset.GenericDelegate(); var abilityBoolOverrideFuncDelegate = new Func(() => { return 0; }); var abilityBoolOverrideActionDelegate = new Action((Character.Abilities.Ability.AbilityBoolOverride value) => { }); var comboInputElementGenericDelegate = new Preset.GenericDelegate(); var comboInputElementFuncDelegate = new Func(() => { return new Character.Abilities.Starters.ComboTimeout.ComboInputElement(); }); var comboInputElementActionDelegate = new Action((Character.Abilities.Starters.ComboTimeout.ComboInputElement value) => { }); var restrictionTypeGenericDelegate = new Preset.GenericDelegate(); var restrictionTypeFuncDelegate = new Func(() => { return 0; }); var restrictionTypeActionDelegate = new Action((Character.Abilities.RestrictPosition.RestrictionType value) => { }); var objectDetectionModeGenericDelegate = new Preset.GenericDelegate(); var objectDetectionModeTypeFuncDelegate = new Func(() => { return 0; }); var objectDetectionModeTypeActionDelegate = new Action((Character.Abilities.DetectObjectAbilityBase.ObjectDetectionMode value) => { }); var autoEquipTypeGenericDelegate = new Preset.GenericDelegate(); var autoEquipTypeFuncDelegate = new Func(() => { return 0; }); var autoEquipTypeActionDelegate = new Action((Character.Abilities.Items.EquipUnequip.AutoEquipType value) => { }); var shakeTargetGenericDelegate = new Preset.GenericDelegate(); var shakeTargetFuncDelegate = new Func(() => { return 0; }); var shakeTargetActionDelegate = new Action((Character.Effects.Shake.ShakeTarget value) => { }); var attributeAutoUpdateValueTypeGenericDelegate = new Preset.GenericDelegate(); var attributeAutoUpdateFuncDelegate = new Func(() => { return 0; }); var attributeAutoUpdateActionDelegate = new Action((Traits.Attribute.AutoUpdateValue value) => { }); var surfaceImpactGenericDelegate = new Preset.GenericDelegate(); var surfaceImpactFuncDelegate = new Func(() => { return null; }); var surfaceImpactActionDelegate = new Action((SurfaceSystem.SurfaceImpact value) => { }); var uvTextureGenericDelegate = new Preset.GenericDelegate(); var uvTextureFuncDelegate = new Func(() => { return new SurfaceSystem.UVTexture(); }); var uvTextureActionDelegate = new Action((SurfaceSystem.UVTexture value) => { }); var objectSurfaceGenericDelegate = new Preset.GenericDelegate(); var objectSurfaceFuncDelegate = new Func(() => { return new SurfaceSystem.ObjectSurface(); }); var objectSurfaceActionDelegate = new Action((SurfaceSystem.ObjectSurface value) => { }); var objectSpawnInfoGenericDelegate = new Preset.GenericDelegate(); var objectSpawnInfoFuncDelegate = new Func(() => { return null; }); var objectSpawnInfoActionDelegate = new Action((Utility.ObjectSpawnInfo value) => { }); var animationEventTriggerGenericDelegate = new Preset.GenericDelegate(); var animationEventTriggerFuncDelegate = new Func(() => { return null; }); var animationEventTriggerActionDelegate = new Action((Utility.AnimationEventTrigger value) => { }); var characterFootEffectsFootGenericDelegate = new Preset.GenericDelegate(); var characterFootEffectsFootFuncDelegate = new Func(() => { return new Character.CharacterFootEffects.Foot(); }); var characterFootEffectsFootActionDelegate = new Action((Character.CharacterFootEffects.Foot value) => { }); var characterFootEffectsFootstepPlacementModeGenericDelegate = new Preset.GenericDelegate(); var characterFootEffectsFootstepPlacementModeFuncDelegate = new Func(() => { return 0; }); var characterFootEffectsFootstepPlacementModeActionDelegate = new Action((Character.CharacterFootEffects.FootstepPlacementMode value) => { }); var spawnPointSpawnShapeGenericDelegate = new Preset.GenericDelegate(); var spawnShapeFuncDelegate = new Func(() => { return 0; }); var spawnShapeActionDelegate = new Action((Game.SpawnPoint.SpawnShape value) => { }); var respawnerSpawnPositioningModeGenericDelegate = new Preset.GenericDelegate(); var respawnerSpawnPositioningFuncDelegate = new Func(() => { return 0; }); var respawnerSpawnPositioningActionDelegate = new Action((Traits.Respawner.SpawnPositioningMode value) => { }); var movingPlatformWaypointGenericDelegate = new Preset.GenericDelegate(); var movingPlatformWaypointFuncDelegate = new Func(() => { return new Objects.MovingPlatform.Waypoint(); }); var movingPlatformWaypointActionDelegate = new Action((Objects.MovingPlatform.Waypoint value) => { }); var movingPlatformPathMovementTypeGenericDelegate = new Preset.GenericDelegate(); var movingPlatformPathMovementTypeFuncDelegate = new Func (() => { return 0; }); var movingPlatformPathMovementTypeActionDelegate = new Action((Objects.MovingPlatform.PathMovementType value) => { }); var movingPlatformPathDirectionGenericDelegate = new Preset.GenericDelegate(); var movingPlatformPathDirectionFuncDelegate = new Func(() => { return 0; }); var movingPlatformPathDirectionActionDelegate = new Action((Objects.MovingPlatform.PathDirection value) => { }); var movingPlatformMovementInterpolationModeGenericDelegate = new Preset.GenericDelegate(); var movingPlatformMovementInterpolationModeFuncDelegate = new Func(() => { return 0; }); var movingPlatformMovementInterpolationModeActionDelegate = new Action((Objects.MovingPlatform.MovementInterpolationMode value) => { }); var movingPlatformRotateInterpolationModeGenericDelegate = new Preset.GenericDelegate(); var movingPlatformRotateInterpolationModeFuncDelegate = new Func(() => { return 0; }); var movingPlatformRotateInterpolationModeActionDelegate = new Action((Objects.MovingPlatform.RotateInterpolationMode value) => { }); var audioClipSetGenericDelegate = new Preset.GenericDelegate(); var audioClipSetFuncDelegate = new Func(() => { return null; }); var audioClipSetActionDelegate = new Action((Audio.AudioClipSet value) => { }); #if ULTIMATE_CHARACTER_CONTROLLER_SHOOTER var autoReloadTypeGenericDelegate = new Preset.GenericDelegate(); var autoReloadTypeFuncDelegate = new Func(() => { return 0; }); var autoReloadTypeModeActionDelegate = new Action((Character.Abilities.Items.Reload.AutoReloadType value) => { }); var shootableWeaponFireModeGenericDelegate = new Preset.GenericDelegate(); var shootableWeaponFireModeFuncDelegate = new Func(() => { return 0; }); var shootableWeaponFireModeActionDelegate = new Action((Items.Actions.ShootableWeapon.FireMode value) => { }); var shootableWeaponFireTypeGenericDelegate = new Preset.GenericDelegate(); var shootableWeaponFireTypeFuncDelegate = new Func(() => { return 0; }); var shootableWeaponFireTypeActionDelegate = new Action((Items.Actions.ShootableWeapon.FireType value) => { }); var shootableWeaponProjectileVisibilityGenericDelegate = new Preset.GenericDelegate(); var shootableWeaponProjectileVisiblityTypeFuncDelegate = new Func(() => { return 0; }); var shootableWeaponProjectileVisiblityTypeActionDelegate = new Action((Items.Actions.ShootableWeapon.ProjectileVisiblityType value) => { }); var shootableWeaponReloadClipTypeGenericDelegate = new Preset.GenericDelegate(); var shootableWeaponReloadClipTypeFuncDelegate = new Func(() => { return 0; }); var shootableWeaponReloadClipTypeActionDelegate = new Action((Items.Actions.ShootableWeapon.ReloadClipType value) => { }); #endif #if ULTIMATE_CHARACTER_CONTROLLER_MELEE var meleeWeaponTrailVisibilityGenericDelegate = new Preset.GenericDelegate(); var meleeWeaponTrailVisibilityFuncDelegate = new Func(() => { return 0; }); var meleeWeaponTrailVisibilityActionDelegate = new Action((Items.Actions.MeleeWeapon.TrailVisibilityType value) => { }); #endif var magicItemCastDirectionGenericDelegate = new Preset.GenericDelegate(); var magicItemCastDirectionFuncDelegate = new Func(() => { return 0; }); var magicItemCastDirectionActionDelegate = new Action((Items.Actions.MagicItem.CastDirection value) => { }); var magicItemCastUseTypeGenericDelegate = new Preset.GenericDelegate(); var magicItemCastUseTypeFuncDelegate = new Func(() => { return 0; }); var magicItemCastUseTypeActionDelegate = new Action((Items.Actions.MagicItem.CastUseType value) => { }); var magicItemCastInterruptSourceGenericDelegate = new Preset.GenericDelegate(); var magicItemCastInterruptSourceFuncDelegate = new Func(() => { return 0; }); var magicItemCastInterruptSourceActionDelegate = new Action((Items.Actions.MagicItem.CastInterruptSource value) => { }); var healthFlashMonitorFlashGenericDelegate = new Preset.GenericDelegate(); var healthFlashMonitorFlashFuncDelegate = new Func(() => { return new UI.HealthFlashMonitor.Flash(); }); var healthFlashMonitorFlashActionDelegate = new Action((UI.HealthFlashMonitor.Flash value) => { }); #pragma warning restore 0219 } } } #endif