chore: new filenames according to new Style Guide
This commit is contained in:
parent
741edc72a7
commit
cb92720fa6
@ -10,7 +10,7 @@ MonoBehaviour:
|
|||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: c46f07b5ed07e4e92aa78254188d3d10, type: 3}
|
m_Script: {fileID: 11500000, guid: c46f07b5ed07e4e92aa78254188d3d10, type: 3}
|
||||||
m_Name: InputSystem.inputsettings
|
m_Name: Input System Input Settings
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_SupportedDevices:
|
m_SupportedDevices:
|
||||||
- Gamepad
|
- Gamepad
|
||||||
@ -20,7 +20,7 @@ Material:
|
|||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: FresnelRippleMaterial
|
m_Name: BRP Fresnel Ripples
|
||||||
m_Shader: {fileID: 4800000, guid: b965bf942e2a1754ea5b506226e626ed, type: 3}
|
m_Shader: {fileID: 4800000, guid: b965bf942e2a1754ea5b506226e626ed, type: 3}
|
||||||
m_Parent: {fileID: 0}
|
m_Parent: {fileID: 0}
|
||||||
m_ModifiedSerializedProperties: 0
|
m_ModifiedSerializedProperties: 0
|
||||||
@ -7,7 +7,7 @@ Material:
|
|||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: GlossyPBRRipples Variant
|
m_Name: URP PBR Ripples Variant
|
||||||
m_Shader: {fileID: 4800000, guid: 8a7f26cb4a0b4d446b2ca031d3ff37df, type: 3}
|
m_Shader: {fileID: 4800000, guid: 8a7f26cb4a0b4d446b2ca031d3ff37df, type: 3}
|
||||||
m_Parent: {fileID: 2100000, guid: 78cb0d90576fe15439f3fd294d5eaaba, type: 2}
|
m_Parent: {fileID: 2100000, guid: 78cb0d90576fe15439f3fd294d5eaaba, type: 2}
|
||||||
m_ModifiedSerializedProperties: 8
|
m_ModifiedSerializedProperties: 8
|
||||||
@ -20,7 +20,7 @@ Material:
|
|||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: GlossyPBRRipples
|
m_Name: URP PBR Ripples
|
||||||
m_Shader: {fileID: 4800000, guid: 8a7f26cb4a0b4d446b2ca031d3ff37df, type: 3}
|
m_Shader: {fileID: 4800000, guid: 8a7f26cb4a0b4d446b2ca031d3ff37df, type: 3}
|
||||||
m_Parent: {fileID: 0}
|
m_Parent: {fileID: 0}
|
||||||
m_ModifiedSerializedProperties: 0
|
m_ModifiedSerializedProperties: 0
|
||||||
133
Assets/Models/Legacy/defaultMat.mat
Normal file
133
Assets/Models/Legacy/defaultMat.mat
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &-5817368176278310424
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 11
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
version: 7
|
||||||
|
--- !u!21 &2100000
|
||||||
|
Material:
|
||||||
|
serializedVersion: 8
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: defaultMat
|
||||||
|
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||||
|
m_Parent: {fileID: 0}
|
||||||
|
m_ModifiedSerializedProperties: 0
|
||||||
|
m_ValidKeywords: []
|
||||||
|
m_InvalidKeywords: []
|
||||||
|
m_LightmapFlags: 4
|
||||||
|
m_EnableInstancingVariants: 0
|
||||||
|
m_DoubleSidedGI: 0
|
||||||
|
m_CustomRenderQueue: -1
|
||||||
|
stringTagMap:
|
||||||
|
RenderType: Opaque
|
||||||
|
disabledShaderPasses: []
|
||||||
|
m_LockedProperties:
|
||||||
|
m_SavedProperties:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TexEnvs:
|
||||||
|
- _BaseMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _BumpMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailAlbedoMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailMask:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailNormalMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _EmissionMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _MainTex:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _MetallicGlossMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _OcclusionMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _ParallaxMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _SpecGlossMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- unity_Lightmaps:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- unity_LightmapsInd:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- unity_ShadowMasks:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
m_Ints: []
|
||||||
|
m_Floats:
|
||||||
|
- _AlphaClip: 0
|
||||||
|
- _AlphaToMask: 0
|
||||||
|
- _Blend: 0
|
||||||
|
- _BlendModePreserveSpecular: 1
|
||||||
|
- _BumpScale: 1
|
||||||
|
- _ClearCoatMask: 0
|
||||||
|
- _ClearCoatSmoothness: 0
|
||||||
|
- _Cull: 2
|
||||||
|
- _Cutoff: 0.5
|
||||||
|
- _DetailAlbedoMapScale: 1
|
||||||
|
- _DetailNormalMapScale: 1
|
||||||
|
- _DstBlend: 0
|
||||||
|
- _DstBlendAlpha: 0
|
||||||
|
- _EnvironmentReflections: 1
|
||||||
|
- _GlossMapScale: 0
|
||||||
|
- _Glossiness: 0
|
||||||
|
- _GlossyReflections: 0
|
||||||
|
- _Metallic: 0
|
||||||
|
- _OcclusionStrength: 1
|
||||||
|
- _Parallax: 0.005
|
||||||
|
- _QueueOffset: 0
|
||||||
|
- _ReceiveShadows: 1
|
||||||
|
- _Smoothness: 0.5
|
||||||
|
- _SmoothnessTextureChannel: 0
|
||||||
|
- _SpecularHighlights: 1
|
||||||
|
- _SrcBlend: 1
|
||||||
|
- _SrcBlendAlpha: 1
|
||||||
|
- _Surface: 0
|
||||||
|
- _WorkflowMode: 1
|
||||||
|
- _ZWrite: 1
|
||||||
|
m_Colors:
|
||||||
|
- _BaseColor: {r: 0.8, g: 0.8, b: 0.8, a: 1}
|
||||||
|
- _Color: {r: 0.8, g: 0.8, b: 0.8, a: 1}
|
||||||
|
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||||
|
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||||
|
m_BuildTextureStacks: []
|
||||||
8
Assets/Models/Legacy/defaultMat.mat.meta
Normal file
8
Assets/Models/Legacy/defaultMat.mat.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c6f5f8e387397484fbcfbe020cb4d7d6
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 2100000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -10,7 +10,7 @@ MonoBehaviour:
|
|||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: 2ec995e51a6e251468d2a3fd8a686257, type: 3}
|
m_Script: {fileID: 11500000, guid: 2ec995e51a6e251468d2a3fd8a686257, type: 3}
|
||||||
m_Name: UniversalRenderPipelineGlobalSettings
|
m_Name: URP Global Settings
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
k_AssetVersion: 3
|
k_AssetVersion: 3
|
||||||
m_RenderingLayerNames:
|
m_RenderingLayerNames:
|
||||||
@ -10,7 +10,7 @@ MonoBehaviour:
|
|||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: de640fe3d0db1804a85f9fc8f5cadab6, type: 3}
|
m_Script: {fileID: 11500000, guid: de640fe3d0db1804a85f9fc8f5cadab6, type: 3}
|
||||||
m_Name: URP_Renderer
|
m_Name: URP Renderer
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
debugShaders:
|
debugShaders:
|
||||||
debugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, type: 3}
|
debugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, type: 3}
|
||||||
@ -17,7 +17,8 @@ public class GameManager : MonoBehaviour
|
|||||||
[SerializeField] int minPlayerCount = 2;
|
[SerializeField] int minPlayerCount = 2;
|
||||||
public GameState currentState { get; private set; }
|
public GameState currentState { get; private set; }
|
||||||
private Dictionary<int, PlayerController> players = new Dictionary<int, PlayerController>();
|
private Dictionary<int, PlayerController> players = new Dictionary<int, PlayerController>();
|
||||||
private Dictionary<int, Tuple<string, int>> playerControlSchemes = new Dictionary<int, Tuple<string, int>>();
|
private Dictionary<int, Tuple<string, int>> playerControlSchemes =
|
||||||
|
new Dictionary<int, Tuple<string, int>>();
|
||||||
private float restartMatchTime = 0;
|
private float restartMatchTime = 0;
|
||||||
private ControlSchemeDetection controlSchemeDetector;
|
private ControlSchemeDetection controlSchemeDetector;
|
||||||
|
|
||||||
@ -159,11 +160,13 @@ public class GameManager : MonoBehaviour
|
|||||||
}
|
}
|
||||||
if (controlScheme.Item1.Contains("Keyboard"))
|
if (controlScheme.Item1.Contains("Keyboard"))
|
||||||
{
|
{
|
||||||
pc.playerInput.SwitchCurrentControlScheme(controlScheme.Item1, InputSystem.GetDeviceById(controlScheme.Item2));
|
pc.playerInput.SwitchCurrentControlScheme(controlScheme.Item1,
|
||||||
|
InputSystem.GetDeviceById(controlScheme.Item2));
|
||||||
}
|
}
|
||||||
else if (controlScheme.Item1.Contains("Controller"))
|
else if (controlScheme.Item1.Contains("Controller"))
|
||||||
{
|
{
|
||||||
pc.playerInput.SwitchCurrentControlScheme(controlScheme.Item1, InputSystem.GetDeviceById(controlScheme.Item2));
|
pc.playerInput.SwitchCurrentControlScheme(controlScheme.Item1,
|
||||||
|
InputSystem.GetDeviceById(controlScheme.Item2));
|
||||||
}
|
}
|
||||||
if (controlScheme.Item1 != "New Player")
|
if (controlScheme.Item1 != "New Player")
|
||||||
{
|
{
|
||||||
@ -236,6 +239,7 @@ public class ControlSchemeDetection : IPlayerActions
|
|||||||
int bindingIndex = context.action.GetBindingIndexForControl(context.control);
|
int bindingIndex = context.action.GetBindingIndexForControl(context.control);
|
||||||
InputBinding binding = context.action.bindings[bindingIndex];
|
InputBinding binding = context.action.bindings[bindingIndex];
|
||||||
string controlScheme = binding.groups.Split(';')[0];
|
string controlScheme = binding.groups.Split(';')[0];
|
||||||
ControlSchemeDetected.Invoke(this, new Tuple<string, int>(controlScheme, context.control.device.deviceId));
|
ControlSchemeDetected.Invoke(this, new Tuple<string, int>(controlScheme,
|
||||||
|
context.control.device.deviceId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -86,7 +86,8 @@ public class HitFeedbackTestObjectBehavior : MonoBehaviour
|
|||||||
Vector3 rotation = transform.rotation.eulerAngles;
|
Vector3 rotation = transform.rotation.eulerAngles;
|
||||||
Vector3 driftVelocity = currentVelocity - Vector3.Project(currentVelocity, rotation);
|
Vector3 driftVelocity = currentVelocity - Vector3.Project(currentVelocity, rotation);
|
||||||
antiDriftVelocity = Vector3.Reflect(-driftVelocity, transform.up) - driftVelocity;
|
antiDriftVelocity = Vector3.Reflect(-driftVelocity, transform.up) - driftVelocity;
|
||||||
antiDriftFactor = Mathf.InverseLerp(absolutMaxVelocity, normalMaxVelocity, currentVelocity.magnitude);
|
antiDriftFactor = Mathf.InverseLerp(absolutMaxVelocity, normalMaxVelocity,
|
||||||
|
currentVelocity.magnitude);
|
||||||
antiDriftFactor = Mathf.Max(antiDriftFactor, minAntiDriftFactor);
|
antiDriftFactor = Mathf.Max(antiDriftFactor, minAntiDriftFactor);
|
||||||
Debug.DrawRay(transform.position, driftVelocity.normalized * 5, Color.red);
|
Debug.DrawRay(transform.position, driftVelocity.normalized * 5, Color.red);
|
||||||
}
|
}
|
||||||
@ -97,7 +98,8 @@ public class HitFeedbackTestObjectBehavior : MonoBehaviour
|
|||||||
Vector3 DragDecceleration(Vector3 currentVelocity, Zone zone)
|
Vector3 DragDecceleration(Vector3 currentVelocity, Zone zone)
|
||||||
{
|
{
|
||||||
Vector3 drag = new Vector3();
|
Vector3 drag = new Vector3();
|
||||||
float minDragFactor = Mathf.InverseLerp(absolutMaxVelocity, normalMaxVelocity, currentVelocity.magnitude);
|
float minDragFactor = Mathf.InverseLerp(absolutMaxVelocity, normalMaxVelocity,
|
||||||
|
currentVelocity.magnitude);
|
||||||
float normalDragFactor = Mathf.InverseLerp(normalMaxVelocity, 0, currentVelocity.magnitude);
|
float normalDragFactor = Mathf.InverseLerp(normalMaxVelocity, 0, currentVelocity.magnitude);
|
||||||
if (zone == Zone.NimbleZone)
|
if (zone == Zone.NimbleZone)
|
||||||
{
|
{
|
||||||
@ -135,7 +137,8 @@ public class HitFeedbackTestObjectBehavior : MonoBehaviour
|
|||||||
Vector3 colliderVelocity = collider.attachedRigidbody.velocity;
|
Vector3 colliderVelocity = collider.attachedRigidbody.velocity;
|
||||||
Vector3 tackleDirection = body.transform.position - collider.transform.position;
|
Vector3 tackleDirection = body.transform.position - collider.transform.position;
|
||||||
float colliderMass = collider.attachedRigidbody.mass;
|
float colliderMass = collider.attachedRigidbody.mass;
|
||||||
body.AddForce(colliderVelocity.magnitude * tackleDirection * (colliderMass / body.mass), ForceMode.Acceleration);
|
body.AddForce(colliderVelocity.magnitude * tackleDirection * (colliderMass / body.mass),
|
||||||
|
ForceMode.Acceleration);
|
||||||
UpdateTackleResponse(true);
|
UpdateTackleResponse(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -48,12 +48,18 @@ public class NimbleZoneDetection : MonoBehaviour
|
|||||||
ResetShaderProperties();
|
ResetShaderProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Func<Vector3, Vector3>[] gravityFunctions = { DownGravity, NoGravity, InwardsGravity, OutwardsGravity };
|
private Func<Vector3, Vector3>[] gravityFunctions =
|
||||||
|
{ DownGravity, NoGravity, InwardsGravity, OutwardsGravity };
|
||||||
|
|
||||||
private static Func<Vector3, Vector3> NoGravity = new Func<Vector3, Vector3>(position => new Vector3());
|
private static Func<Vector3, Vector3> NoGravity =
|
||||||
private static Func<Vector3, Vector3> DownGravity = new Func<Vector3, Vector3>(position => Vector3.down * gravityFactor);
|
new Func<Vector3, Vector3>(position => new Vector3());
|
||||||
private static Func<Vector3, Vector3> InwardsGravity = new Func<Vector3, Vector3>
|
private static Func<Vector3, Vector3> DownGravity =
|
||||||
|
new Func<Vector3, Vector3>(position => Vector3.down * gravityFactor);
|
||||||
|
|
||||||
|
private static Func<Vector3, Vector3> InwardsGravity =
|
||||||
|
new Func<Vector3, Vector3>
|
||||||
(position => new Vector3(position.x, position.y, 0).normalized * -gravityFactor);
|
(position => new Vector3(position.x, position.y, 0).normalized * -gravityFactor);
|
||||||
|
|
||||||
private static Func<Vector3, Vector3> OutwardsGravity = new Func<Vector3, Vector3>
|
private static Func<Vector3, Vector3> OutwardsGravity = new Func<Vector3, Vector3>
|
||||||
(position => new Vector3(position.x, position.y, 0).normalized * gravityFactor);
|
(position => new Vector3(position.x, position.y, 0).normalized * gravityFactor);
|
||||||
|
|
||||||
@ -156,9 +162,4 @@ public class NimbleZoneDetection : MonoBehaviour
|
|||||||
material.SetFloatArray("_RippleDurations", rippleDurations);
|
material.SetFloatArray("_RippleDurations", rippleDurations);
|
||||||
material.SetFloatArray("_RippleRadii", rippleRadii);
|
material.SetFloatArray("_RippleRadii", rippleRadii);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDestroy()
|
|
||||||
{
|
|
||||||
ResetShaderProperties();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,7 +55,8 @@ public class PlayerController : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if (forceManager == null)
|
if (forceManager == null)
|
||||||
{
|
{
|
||||||
forceManager = GameObject.FindGameObjectWithTag("ForceManager").GetComponent<AffectingForcesManager>();
|
forceManager = GameObject.FindGameObjectWithTag("ForceManager").
|
||||||
|
GetComponent<AffectingForcesManager>();
|
||||||
}
|
}
|
||||||
body = GetComponent<Rigidbody>();
|
body = GetComponent<Rigidbody>();
|
||||||
playerInput = GetComponent<PlayerInput>();
|
playerInput = GetComponent<PlayerInput>();
|
||||||
@ -116,7 +117,8 @@ public class PlayerController : MonoBehaviour
|
|||||||
float stunFactor = isCriticalTackle ? stunLooseControlFactor : 1f;
|
float stunFactor = isCriticalTackle ? stunLooseControlFactor : 1f;
|
||||||
|
|
||||||
currentThrustInput = IsBoosting() ? 1f : currentThrustInput;
|
currentThrustInput = IsBoosting() ? 1f : currentThrustInput;
|
||||||
Vector3 acceleration = thrustAcceleration * currentThrustInput * Time.deltaTime * Vector3.up * stunFactor;
|
Vector3 acceleration = thrustAcceleration * currentThrustInput * Time.deltaTime
|
||||||
|
* Vector3.up * stunFactor;
|
||||||
|
|
||||||
Vector3 currentVelocity = body.velocity;
|
Vector3 currentVelocity = body.velocity;
|
||||||
|
|
||||||
@ -161,8 +163,11 @@ public class PlayerController : MonoBehaviour
|
|||||||
// Cancel out inertia/drifting
|
// Cancel out inertia/drifting
|
||||||
Vector3 rotation = transform.rotation.eulerAngles;
|
Vector3 rotation = transform.rotation.eulerAngles;
|
||||||
Vector3 driftVelocity = currentVelocity - Vector3.Project(currentVelocity, rotation);
|
Vector3 driftVelocity = currentVelocity - Vector3.Project(currentVelocity, rotation);
|
||||||
|
|
||||||
antiDriftVelocity = Vector3.Reflect(-driftVelocity, transform.up) - driftVelocity;
|
antiDriftVelocity = Vector3.Reflect(-driftVelocity, transform.up) - driftVelocity;
|
||||||
antiDriftFactor = Mathf.InverseLerp(absolutMaxVelocity, normalMaxVelocity, currentVelocity.magnitude);
|
antiDriftFactor = Mathf.InverseLerp(absolutMaxVelocity, normalMaxVelocity,
|
||||||
|
currentVelocity.magnitude);
|
||||||
|
|
||||||
antiDriftFactor = Mathf.Max(antiDriftFactor, minAntiDriftFactor);
|
antiDriftFactor = Mathf.Max(antiDriftFactor, minAntiDriftFactor);
|
||||||
Debug.DrawRay(transform.position, driftVelocity.normalized * 5, Color.red);
|
Debug.DrawRay(transform.position, driftVelocity.normalized * 5, Color.red);
|
||||||
Debug.DrawRay(transform.position, antiDriftVelocity.normalized * 5, Color.green);
|
Debug.DrawRay(transform.position, antiDriftVelocity.normalized * 5, Color.green);
|
||||||
@ -173,7 +178,9 @@ public class PlayerController : MonoBehaviour
|
|||||||
{
|
{
|
||||||
Vector3 drag = new Vector3();
|
Vector3 drag = new Vector3();
|
||||||
bool isBoosting = currentBoostInput > 0 && canBoost == true;
|
bool isBoosting = currentBoostInput > 0 && canBoost == true;
|
||||||
float minDragFactor = Mathf.InverseLerp(absolutMaxVelocity, normalMaxVelocity, currentVelocity.magnitude);
|
float minDragFactor = Mathf.InverseLerp(absolutMaxVelocity, normalMaxVelocity,
|
||||||
|
currentVelocity.magnitude);
|
||||||
|
|
||||||
float normalDragFactor = Mathf.InverseLerp(normalMaxVelocity, 0, currentVelocity.magnitude);
|
float normalDragFactor = Mathf.InverseLerp(normalMaxVelocity, 0, currentVelocity.magnitude);
|
||||||
if (!isBoosting && zone == Zone.NimbleZone)
|
if (!isBoosting && zone == Zone.NimbleZone)
|
||||||
{
|
{
|
||||||
@ -290,7 +297,8 @@ public class PlayerController : MonoBehaviour
|
|||||||
}
|
}
|
||||||
Vector3 colliderVelocity = collider.attachedRigidbody.velocity;
|
Vector3 colliderVelocity = collider.attachedRigidbody.velocity;
|
||||||
Vector3 tackleDirection = body.transform.position - collider.transform.position;
|
Vector3 tackleDirection = body.transform.position - collider.transform.position;
|
||||||
body.AddForce(colliderVelocity.magnitude * tackleDirection * tacklePowerFactor, ForceMode.Acceleration);
|
body.AddForce(colliderVelocity.magnitude * tackleDirection * tacklePowerFactor,
|
||||||
|
ForceMode.Acceleration);
|
||||||
UpdateTackleResponse(true);
|
UpdateTackleResponse(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user