SO MUCH SCUFFEDNESS

This commit is contained in:
2023-05-31 15:12:09 -04:00
parent 68a30bb1bd
commit 5847d71676
323 changed files with 573 additions and 78 deletions

View File

@ -12,6 +12,9 @@ GameObject:
- component: {fileID: 4512293259955182956}
- component: {fileID: 6667641716399555817}
- component: {fileID: -5271135124957689192}
- component: {fileID: 247864930697348647}
- component: {fileID: 526411540949090343}
- component: {fileID: 6088059624252575348}
m_Layer: 0
m_Name: NetworkLOD_Prefab
m_TagString: Untagged
@ -29,6 +32,7 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 3106622367778460228}
m_Father: {fileID: 0}
@ -46,6 +50,19 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3}
m_Name:
m_EditorClassIdentifier:
<IsNested>k__BackingField: 0
<ComponentIndex>k__BackingField: 0
<PredictedSpawn>k__BackingField: {fileID: 0}
_networkBehaviours:
- {fileID: 6667641716399555817}
- {fileID: -5271135124957689192}
- {fileID: 526411540949090343}
<ParentNetworkObject>k__BackingField: {fileID: 0}
<ChildNetworkObjects>k__BackingField: []
_isNetworked: 1
_isGlobal: 0
_initializeOrder: 0
_defaultDespawnType: 0
NetworkObserver: {fileID: 0}
<PrefabId>k__BackingField: 2
<SpawnableCollectionId>k__BackingField: 0
@ -54,18 +71,6 @@ MonoBehaviour:
<AssetPathHash>k__BackingField: 8082309187455287958
_sceneNetworkObjects:
- {fileID: 4512293259955182956}
<IsNested>k__BackingField: 0
<ComponentIndex>k__BackingField: 0
<PredictedSpawn>k__BackingField: {fileID: 0}
_networkBehaviours:
- {fileID: 6667641716399555817}
- {fileID: -5271135124957689192}
<ParentNetworkObject>k__BackingField: {fileID: 0}
<ChildNetworkObjects>k__BackingField: []
_isNetworked: 1
_isGlobal: 0
_initializeOrder: 0
_defaultDespawnType: 0
--- !u!114 &6667641716399555817
MonoBehaviour:
m_ObjectHideFlags: 0
@ -73,7 +78,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4512293259955182959}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9880e85651efd71469092ce519317f7b, type: 3}
m_Name:
@ -97,6 +102,7 @@ MonoBehaviour:
_componentIndexCache: 1
_addedNetworkObject: {fileID: 4512293259955182956}
_networkObjectCache: {fileID: 4512293259955182956}
_componentConfiguration: 0
_synchronizeParent: 0
_packing:
Position: 1
@ -123,6 +129,88 @@ MonoBehaviour:
X: 0
Y: 0
Z: 0
--- !u!143 &247864930697348647
CharacterController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4512293259955182959}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Height: 2
m_Radius: 0.5
m_SlopeLimit: 45
m_StepOffset: 0.3
m_SkinWidth: 0.08
m_MinMoveDistance: 0.001
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &526411540949090343
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4512293259955182959}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a31284a274f3c3c4993d760abda8520a, type: 3}
m_Name:
m_EditorClassIdentifier:
_componentIndexCache: 2
_addedNetworkObject: {fileID: 4512293259955182956}
_networkObjectCache: {fileID: 4512293259955182956}
jumpSpeed: 6
speed: 8
gravity: 0
--- !u!114 &6088059624252575348
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4512293259955182959}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Actions: {fileID: -944628639613478452, guid: c206aa4192994a34a8f932eb995f13b9, type: 3}
m_NotificationBehavior: 2
m_UIInputModule: {fileID: 0}
m_DeviceLostEvent:
m_PersistentCalls:
m_Calls: []
m_DeviceRegainedEvent:
m_PersistentCalls:
m_Calls: []
m_ControlsChangedEvent:
m_PersistentCalls:
m_Calls: []
m_ActionEvents:
- m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 526411540949090343}
m_TargetAssemblyTypeName: PlayerInputDriver, mydef
m_MethodName: OnMovement
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_ActionId: 55dfdeea-331d-47f2-9a02-526e458aa5ed
m_ActionName: New action map/New action[/Keyboard/w,/Keyboard/s,/Keyboard/a,/Keyboard/d]
m_NeverAutoSwitchControlSchemes: 0
m_DefaultControlScheme:
m_DefaultActionMap: New action map
m_SplitScreenIndex: -1
m_Camera: {fileID: 0}
--- !u!1 &7544314590428355348
GameObject:
m_ObjectHideFlags: 0
@ -152,6 +240,7 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4512293259955182957}
m_RootOrder: 0
@ -175,14 +264,16 @@ MeshRenderer:
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 2100000, guid: 138cca86153614c4c8e24fc2768fba69, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@ -203,6 +294,7 @@ MeshRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!135 &6944568664394371648
SphereCollider:
m_ObjectHideFlags: 0

View File

@ -0,0 +1,196 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
// version 1.4.4
// from Assets/FishNet/Demos/Network LOD/Prefabs/New Controls.inputactions
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Utilities;
public partial class @NewControls : IInputActionCollection2, IDisposable
{
public InputActionAsset asset { get; }
public @NewControls()
{
asset = InputActionAsset.FromJson(@"{
""name"": ""New Controls"",
""maps"": [
{
""name"": ""New action map"",
""id"": ""d0f51457-a857-4fa4-98ce-e5cde69f5bba"",
""actions"": [
{
""name"": ""New action"",
""type"": ""Value"",
""id"": ""55dfdeea-331d-47f2-9a02-526e458aa5ed"",
""expectedControlType"": ""Vector2"",
""processors"": """",
""interactions"": ""Hold"",
""initialStateCheck"": true
}
],
""bindings"": [
{
""name"": ""2D Vector"",
""id"": ""ab43b81b-3869-467f-9684-e4f7a35d6c73"",
""path"": ""2DVector"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""New action"",
""isComposite"": true,
""isPartOfComposite"": false
},
{
""name"": ""up"",
""id"": ""24cc63fc-7927-464b-acce-ad9f5d5de163"",
""path"": ""<Keyboard>/w"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""New action"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""down"",
""id"": ""6fbbe716-aa97-412a-85c5-9597c0fea21c"",
""path"": ""<Keyboard>/s"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""New action"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""left"",
""id"": ""3da6b6cd-13d7-4bd9-b943-010ef1aafb06"",
""path"": ""<Keyboard>/a"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""New action"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""right"",
""id"": ""5dd39ce5-66ed-442e-af87-f9b09cb1b971"",
""path"": ""<Keyboard>/d"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""New action"",
""isComposite"": false,
""isPartOfComposite"": true
}
]
}
],
""controlSchemes"": []
}");
// New action map
m_Newactionmap = asset.FindActionMap("New action map", throwIfNotFound: true);
m_Newactionmap_Newaction = m_Newactionmap.FindAction("New action", throwIfNotFound: true);
}
public void Dispose()
{
UnityEngine.Object.Destroy(asset);
}
public InputBinding? bindingMask
{
get => asset.bindingMask;
set => asset.bindingMask = value;
}
public ReadOnlyArray<InputDevice>? devices
{
get => asset.devices;
set => asset.devices = value;
}
public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes;
public bool Contains(InputAction action)
{
return asset.Contains(action);
}
public IEnumerator<InputAction> GetEnumerator()
{
return asset.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
public void Enable()
{
asset.Enable();
}
public void Disable()
{
asset.Disable();
}
public IEnumerable<InputBinding> bindings => asset.bindings;
public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
{
return asset.FindAction(actionNameOrId, throwIfNotFound);
}
public int FindBinding(InputBinding bindingMask, out InputAction action)
{
return asset.FindBinding(bindingMask, out action);
}
// New action map
private readonly InputActionMap m_Newactionmap;
private INewactionmapActions m_NewactionmapActionsCallbackInterface;
private readonly InputAction m_Newactionmap_Newaction;
public struct NewactionmapActions
{
private @NewControls m_Wrapper;
public NewactionmapActions(@NewControls wrapper) { m_Wrapper = wrapper; }
public InputAction @Newaction => m_Wrapper.m_Newactionmap_Newaction;
public InputActionMap Get() { return m_Wrapper.m_Newactionmap; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }
public bool enabled => Get().enabled;
public static implicit operator InputActionMap(NewactionmapActions set) { return set.Get(); }
public void SetCallbacks(INewactionmapActions instance)
{
if (m_Wrapper.m_NewactionmapActionsCallbackInterface != null)
{
@Newaction.started -= m_Wrapper.m_NewactionmapActionsCallbackInterface.OnNewaction;
@Newaction.performed -= m_Wrapper.m_NewactionmapActionsCallbackInterface.OnNewaction;
@Newaction.canceled -= m_Wrapper.m_NewactionmapActionsCallbackInterface.OnNewaction;
}
m_Wrapper.m_NewactionmapActionsCallbackInterface = instance;
if (instance != null)
{
@Newaction.started += instance.OnNewaction;
@Newaction.performed += instance.OnNewaction;
@Newaction.canceled += instance.OnNewaction;
}
}
}
public NewactionmapActions @Newactionmap => new NewactionmapActions(this);
public interface INewactionmapActions
{
void OnNewaction(InputAction.CallbackContext context);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d8c332b454deffe49b61a9c793d281f6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,78 @@
{
"name": "New Controls",
"maps": [
{
"name": "New action map",
"id": "d0f51457-a857-4fa4-98ce-e5cde69f5bba",
"actions": [
{
"name": "New action",
"type": "Value",
"id": "55dfdeea-331d-47f2-9a02-526e458aa5ed",
"expectedControlType": "Vector2",
"processors": "",
"interactions": "Hold",
"initialStateCheck": true
}
],
"bindings": [
{
"name": "2D Vector",
"id": "ab43b81b-3869-467f-9684-e4f7a35d6c73",
"path": "2DVector",
"interactions": "",
"processors": "",
"groups": "",
"action": "New action",
"isComposite": true,
"isPartOfComposite": false
},
{
"name": "up",
"id": "24cc63fc-7927-464b-acce-ad9f5d5de163",
"path": "<Keyboard>/w",
"interactions": "",
"processors": "",
"groups": "",
"action": "New action",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "down",
"id": "6fbbe716-aa97-412a-85c5-9597c0fea21c",
"path": "<Keyboard>/s",
"interactions": "",
"processors": "",
"groups": "",
"action": "New action",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "left",
"id": "3da6b6cd-13d7-4bd9-b943-010ef1aafb06",
"path": "<Keyboard>/a",
"interactions": "",
"processors": "",
"groups": "",
"action": "New action",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "right",
"id": "5dd39ce5-66ed-442e-af87-f9b09cb1b971",
"path": "<Keyboard>/d",
"interactions": "",
"processors": "",
"groups": "",
"action": "New action",
"isComposite": false,
"isPartOfComposite": true
}
]
}
],
"controlSchemes": []
}

View File

@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: c206aa4192994a34a8f932eb995f13b9
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3}
generateWrapperCode: 1
wrapperCodePath:
wrapperClassName:
wrapperCodeNamespace:

View File

@ -0,0 +1,60 @@
using FishNet.Object;
using UnityEngine;
using UnityEngine.InputSystem;
[RequireComponent(typeof(CharacterController))]
[RequireComponent(typeof(PlayerInput))]
public class PlayerInputDriver : NetworkBehaviour
{
private CharacterController _characterController;
private Vector2 _moveInput;
private Vector3 _moveDirection;
private bool _jump;
[SerializeField] public float jumpSpeed = 6f;
[SerializeField] public float speed = 8f;
[SerializeField] public float gravity = -9.8f;
private void Start()
{
_characterController = GetComponent(typeof(CharacterController)) as CharacterController;
_jump = false;
}
private void Update()
{
if (!base.IsOwner)
return;
if (_characterController.isGrounded||true)
{
_moveDirection = new Vector3(_moveInput.x, 0.0f, _moveInput.y);
_moveDirection *= speed;
if (_jump)
{
_moveDirection.y = jumpSpeed;
_jump = false;
}
}
_moveDirection.y += gravity * Time.deltaTime;
_characterController.Move(_moveDirection * Time.deltaTime);
}
#region UnityEventCallbacks
public void OnMovement(InputAction.CallbackContext context)
{
if (!base.IsOwner)
return;
_moveInput = context.ReadValue<Vector2>();
}
public void OnJump(InputAction.CallbackContext context)
{
if (!base.IsOwner)
return;
if (context.started || context.performed)
{
_jump = true;
}
else if (context.canceled)
{
_jump = false;
}
}
#endregion
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a31284a274f3c3c4993d760abda8520a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,17 @@
{
"name": "mydef",
"rootNamespace": "",
"references": [
"GUID:75469ad4d38634e559750d17036d5f7c",
"GUID:7c88a4a7926ee5145ad2dfa06f454c67"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: df3b7b8b65e22ea4487176804c62c5f0
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: