Add input controller and malon model (i think)

This commit is contained in:
2022-08-13 12:18:32 -07:00
parent 5d1c3975f6
commit 4424d1546c
3 changed files with 243 additions and 0 deletions

View File

@@ -444,6 +444,210 @@ Animator:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
--- !u!1 &1271750229 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: -221473311111568139, guid: fe8102caa0af4e146ac21b0ba4b658ac, type: 3}
m_PrefabInstance: {fileID: 1750031049}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1271750233
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1271750229}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 492ccac425c363548b6f9be7835cbc6a, type: 3}
m_Name:
m_EditorClassIdentifier:
Speed: 5
RotateSpeed: 0.5
--- !u!143 &1271750234
CharacterController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1271750229}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Height: 200
m_Radius: 73.57972
m_SlopeLimit: 45
m_StepOffset: 0.003
m_SkinWidth: 0.08
m_MinMoveDistance: 0.001
m_Center: {x: 0, y: 95, z: 0}
--- !u!1001 &1750031049
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: fe8102caa0af4e146ac21b0ba4b658ac, type: 3}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: fe8102caa0af4e146ac21b0ba4b658ac, type: 3}
propertyPath: m_LocalScale.x
value: 0.01
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: fe8102caa0af4e146ac21b0ba4b658ac, type: 3}
propertyPath: m_LocalScale.y
value: 0.01
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: fe8102caa0af4e146ac21b0ba4b658ac, type: 3}
propertyPath: m_LocalScale.z
value: 0.01
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: fe8102caa0af4e146ac21b0ba4b658ac, type: 3}
propertyPath: m_LocalPosition.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: fe8102caa0af4e146ac21b0ba4b658ac, type: 3}
propertyPath: m_LocalPosition.y
value: 9.82
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: fe8102caa0af4e146ac21b0ba4b658ac, type: 3}
propertyPath: m_LocalPosition.z
value: -33.22
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: fe8102caa0af4e146ac21b0ba4b658ac, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: fe8102caa0af4e146ac21b0ba4b658ac, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: fe8102caa0af4e146ac21b0ba4b658ac, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: fe8102caa0af4e146ac21b0ba4b658ac, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: fe8102caa0af4e146ac21b0ba4b658ac, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: fe8102caa0af4e146ac21b0ba4b658ac, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: fe8102caa0af4e146ac21b0ba4b658ac, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: fe8102caa0af4e146ac21b0ba4b658ac, type: 3}
propertyPath: m_Name
value: Malon
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: fe8102caa0af4e146ac21b0ba4b658ac, type: 3}
--- !u!1 &1906199873
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1906199877}
- component: {fileID: 1906199876}
- component: {fileID: 1906199875}
- component: {fileID: 1906199874}
m_Layer: 0
m_Name: Plane
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!64 &1906199874
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1906199873}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 4
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &1906199875
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1906199873}
m_Enabled: 1
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}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &1906199876
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1906199873}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1906199877
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1906199873}
m_LocalRotation: {x: 0.08715578, y: 0, z: 0, w: 0.9961947}
m_LocalPosition: {x: 1.5039091, y: 4.85, z: -7.5949078}
m_LocalScale: {x: 100, y: 100, z: 100}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 10, y: 0, z: 0}
--- !u!1001 &5273888998558250076
PrefabInstance:
m_ObjectHideFlags: 0

View File

@@ -0,0 +1,26 @@
using UnityEngine;
namespace Scampz.GameJam.Assets.Scripts
{
public class CharacterInputController : MonoBehaviour
{
private CharacterController _controller;
public float Speed = 5f;
public float RotateSpeed = 3.0f;
private void Start()
{
_controller = GetComponent<CharacterController>();
}
void Update()
{
// Rotation
transform.Rotate(0, Input.GetAxis(InputOptions.Horizontal) * RotateSpeed, 0);
// Move
var forward = transform.TransformDirection(Vector3.forward);
var curSpeed = Speed * Input.GetAxis(InputOptions.Vertical);
_controller.SimpleMove(forward * curSpeed);
}
}
}

View File

@@ -0,0 +1,13 @@
namespace Scampz.GameJam.Assets.Scripts
{
public static class InputOptions
{
public static string Vertical => "Vertical";
public static string Horizontal => "Horizontal";
public static string Interact => "Interact";
public static string Cancel => "Cancel";
}
}