Finish alicing

This commit is contained in:
Jens Pitkänen 2020-08-06 22:58:31 +03:00
parent 139b1a1807
commit 16b0132f6c
9 changed files with 107 additions and 32 deletions

View File

@ -72,7 +72,7 @@ AnimationClip:
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 0, y: -0.19999993, z: 0.4}
value: {x: 0, y: -0.19999993, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
@ -81,7 +81,7 @@ AnimationClip:
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.6666667
value: {x: 0, y: -0.21, z: 0.405}
value: {x: 0, y: -0.21, z: 0.005}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
@ -90,7 +90,7 @@ AnimationClip:
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 1.3333334
value: {x: 0, y: -0.19999993, z: 0.4}
value: {x: 0, y: -0.19999993, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
@ -226,7 +226,7 @@ AnimationClip:
m_Curve:
- serializedVersion: 3
time: 0
value: 0.4
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
@ -235,7 +235,7 @@ AnimationClip:
outWeight: 0.33333334
- serializedVersion: 3
time: 0.6666667
value: 0.405
value: 0.005
inSlope: 0
outSlope: 0
tangentMode: 136
@ -244,7 +244,7 @@ AnimationClip:
outWeight: 0.33333334
- serializedVersion: 3
time: 1.3333334
value: 0.4
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136

View File

@ -20,7 +20,7 @@ AnimationClip:
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 0, y: -0.19999993, z: 0.4}
value: {x: 0, y: -0.19999993, z: 0}
inSlope: {x: 0, y: 0.045422196, z: 0}
outSlope: {x: 0, y: 0.045422196, z: 0}
tangentMode: 0
@ -29,7 +29,7 @@ AnimationClip:
outWeight: {x: 0.33333334, y: 0.21276595, z: 0.33333334}
- serializedVersion: 3
time: 0.23333333
value: {x: 0, y: -0.19, z: 0.4}
value: {x: 0, y: -0.19, z: 0}
inSlope: {x: 0, y: 0.0036644656, z: 0}
outSlope: {x: 0, y: 0.0036644656, z: 0}
tangentMode: 0
@ -38,7 +38,7 @@ AnimationClip:
outWeight: {x: 0.33333334, y: 0.54491717, z: 0.33333334}
- serializedVersion: 3
time: 0.45
value: {x: 0, y: -0.19999993, z: 0.4}
value: {x: 0, y: -0.19999993, z: 0}
inSlope: {x: 0, y: 0.08186936, z: 0}
outSlope: {x: 0, y: 0.08186936, z: 0}
tangentMode: 0
@ -158,7 +158,7 @@ AnimationClip:
m_Curve:
- serializedVersion: 3
time: 0
value: 0.4
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
@ -167,7 +167,7 @@ AnimationClip:
outWeight: 0.33333334
- serializedVersion: 3
time: 0.45
value: 0.4
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136

View File

@ -925,6 +925,7 @@ GameObject:
m_Component:
- component: {fileID: 7391558913374292208}
- component: {fileID: 5888965224432224917}
- component: {fileID: 703637974133461687}
m_Layer: 0
m_Name: GunRoot
m_TagString: Untagged
@ -939,8 +940,8 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7391558913374292223}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.15, y: 0, z: 0}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.15, y: -0.04, z: 0.4}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 7391558913422139240}
@ -966,6 +967,24 @@ Animator:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
--- !u!114 &703637974133461687
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7391558913374292223}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 22a7da1b361417640853a9cdcde28400, type: 3}
m_Name:
m_EditorClassIdentifier:
Player: {fileID: 7391558912774766620}
InterpolationSpeed: 5
YawDegrees: 7
PitchDegrees: 7
RollDegrees: 7
RotationThreshold: 5
--- !u!1 &7391558913422139223
GameObject:
m_ObjectHideFlags: 0
@ -990,7 +1009,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7391558913422139223}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: -0.19999993, z: 0.4}
m_LocalPosition: {x: 0, y: -0.19999993, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 7391558913269936983}

View File

@ -47,6 +47,36 @@ MonoBehaviour:
m_OverrideState: 0
m_Value: 0
min: 0
--- !u!114 &-3919862544555392601
MonoBehaviour:
m_ObjectHideFlags: 3
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: 29fa0085f50d5e54f8144f766051a691, type: 3}
m_Name: FilmGrain
m_EditorClassIdentifier:
active: 1
m_AdvancedMode: 0
type:
m_OverrideState: 0
m_Value: 0
intensity:
m_OverrideState: 1
m_Value: 0.1
min: 0
max: 1
response:
m_OverrideState: 0
m_Value: 0.8
min: 0
max: 1
texture:
m_OverrideState: 0
m_Value: {fileID: 0}
--- !u!114 &-1329204002016237937
MonoBehaviour:
m_ObjectHideFlags: 3
@ -83,6 +113,7 @@ MonoBehaviour:
- {fileID: 7991213835716202865}
- {fileID: 4212929005619836917}
- {fileID: -1329204002016237937}
- {fileID: -3919862544555392601}
--- !u!114 &4212929005619836917
MonoBehaviour:
m_ObjectHideFlags: 3

View File

@ -42,7 +42,7 @@ MonoBehaviour:
m_SoftShadowsSupported: 1
m_UseSRPBatcher: 1
m_SupportsDynamicBatching: 0
m_MixedLightingSupported: 1
m_MixedLightingSupported: 0
m_DebugLevel: 0
m_UseAdaptivePerformance: 1
m_ColorGradingMode: 1

View File

@ -0,0 +1,41 @@
using UnityEngine;
using NeonTea.Quakeball.Player;
namespace NeonTea.Quakeball.Animation {
/// <summary>Lags a little behind every frame to create a delay effect in the gun movement.</summary>
public class GunInterpolator : MonoBehaviour {
public LocalPlayer Player;
public float InterpolationSpeed;
public float YawDegrees;
public float PitchDegrees;
public float RollDegrees;
public float RotationThreshold;
private Vector2 CurrentLean = Vector2.zero;
private Vector2 TargetLean = Vector2.zero;
private void Update() {
Vector2 LookDelta = Player.LookAction.ReadValue<Vector2>();
SetTarget(LookDelta.x, ref TargetLean.x);
CurrentLean.x = Mathf.Lerp(CurrentLean.x, TargetLean.x, InterpolationSpeed * Time.deltaTime);
SetTarget(LookDelta.y, ref TargetLean.y);
CurrentLean.y = Mathf.Lerp(CurrentLean.y, TargetLean.y, InterpolationSpeed * Time.deltaTime);
Vector3 Eulers = transform.localEulerAngles;
Eulers.x = -CurrentLean.y * PitchDegrees;
Eulers.y = CurrentLean.x * YawDegrees;
Eulers.z = CurrentLean.x * RollDegrees;
transform.localEulerAngles = Eulers;
}
private void SetTarget(float delta, ref float targetLean) {
if (delta > RotationThreshold) {
targetLean = -1;
} else if (delta < -RotationThreshold) {
targetLean = 1;
} else {
targetLean = Mathf.Lerp(targetLean, 0, 10f * Time.deltaTime);
}
}
}
}

View File

@ -1,16 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace NeonTea.Quakeball.Animation {
/// <summary>Follows a Transform with configurable lerp speeds.</summary>
public class LerpFollower : MonoBehaviour {
public Transform Followed;
public Vector3 PositionLerpSpeed = new Vector3(100, 100, 100);
public Vector3 RotationLerpSpeed = new Vector3(100, 100, 100);
public Vector3 ScaleLerpSpeed = new Vector3(100, 100, 100);
private void Update() {
}
}
}

View File

@ -12,7 +12,7 @@ namespace NeonTea.Quakeball.Player {
private float Lean = 0;
private Player Player;
private InputAction LookAction;
public InputAction LookAction { private set; get; }
private InputAction MoveAction;
private InputAction CrouchAction;
private InputAction JumpAction;