mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-08 18:55:07 +00:00
animate front hand with curve
This commit is contained in:
parent
f55ed7f41c
commit
00705f0d0b
2 changed files with 179 additions and 2 deletions
|
@ -1,5 +1,52 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &271608190735824744
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3179245944379459984}
|
||||
- component: {fileID: 3794235363087547262}
|
||||
m_Layer: 0
|
||||
m_Name: Point 0
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &3179245944379459984
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 271608190735824744}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 8.599225, y: -3.7601194, z: -0.00056266785}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5933667797973890553}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &3794235363087547262
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 271608190735824744}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b0cca3244f403c24f819a870f31cdc29, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
curve: {fileID: 1548392426751435551}
|
||||
handleType: 0
|
||||
leftHandleLocalPosition: {x: -0.3907547, y: -1.1651046, z: -0}
|
||||
rightHandleLocalPosition: {x: 0.3907547, y: 1.1651046, z: 0}
|
||||
--- !u!1 &551892326966028107
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -107,7 +154,7 @@ Transform:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1048069017443487285}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 8.68, y: -4.64, z: -1.2553809}
|
||||
m_LocalPosition: {x: 11.32664, y: -2.844834, z: 0}
|
||||
m_LocalScale: {x: 4, y: 4, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4895754031794878509}
|
||||
|
@ -194,9 +241,57 @@ Transform:
|
|||
- {fileID: 4364905879727277044}
|
||||
- {fileID: 4566486539923839763}
|
||||
- {fileID: 5013543367220548395}
|
||||
- {fileID: 5933667797973890553}
|
||||
m_Father: {fileID: 8034898466080482128}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1788258921642552512
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3812023941837803389}
|
||||
- component: {fileID: 1235756901463535570}
|
||||
m_Layer: 0
|
||||
m_Name: Point 1
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &3812023941837803389
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1788258921642552512}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 11.326642, y: -2.8448343, z: 0.00041389465}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5933667797973890553}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1235756901463535570
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1788258921642552512}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b0cca3244f403c24f819a870f31cdc29, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
curve: {fileID: 1548392426751435551}
|
||||
handleType: 0
|
||||
leftHandleLocalPosition: {x: -1.04284, y: 0.75755143, z: 0}
|
||||
rightHandleLocalPosition: {x: 1.04284, y: -0.75755143, z: -0}
|
||||
--- !u!1 &1857979605670035027
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -248,9 +343,13 @@ MonoBehaviour:
|
|||
firstEnable: 0
|
||||
fg: {fileID: 0}
|
||||
bg: {fileID: 0}
|
||||
frontHand: {fileID: 1048069017443487285}
|
||||
handAnimator: {fileID: 0}
|
||||
handCurve: {fileID: 1548392426751435551}
|
||||
cowbell: {fileID: 0}
|
||||
driverState: 0
|
||||
handStart: 0
|
||||
handProgress: 0
|
||||
--- !u!1 &2105789012818819763
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -421,6 +520,59 @@ MonoBehaviour:
|
|||
_SortingLayer: 0
|
||||
_SortingLayerID: 0
|
||||
_SortingOrder: 0
|
||||
--- !u!1 &5891568287695245021
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5933667797973890553}
|
||||
- component: {fileID: 1548392426751435551}
|
||||
m_Layer: 0
|
||||
m_Name: HitCurve
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &5933667797973890553
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5891568287695245021}
|
||||
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_Children:
|
||||
- {fileID: 3179245944379459984}
|
||||
- {fileID: 3812023941837803389}
|
||||
m_Father: {fileID: 4895754031794878509}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1548392426751435551
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5891568287695245021}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 066a41e004f415b4eb74d5e61a2aadbe, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
curveColor: {r: 0, g: 1, b: 0, a: 1}
|
||||
startPointColor: {r: 1, g: 0, b: 0, a: 1}
|
||||
endPointColor: {r: 0, g: 0, b: 1, a: 1}
|
||||
sampling: 25
|
||||
keyPoints:
|
||||
- {fileID: 3794235363087547262}
|
||||
- {fileID: 1235756901463535570}
|
||||
normalizedTime: 0.5
|
||||
--- !u!1 &7723745442768519090
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
@ -53,14 +53,29 @@ namespace HeavenStudio.Games
|
|||
Tween bgColorTween;
|
||||
Tween fgColorTween;
|
||||
|
||||
|
||||
[Header("References")]
|
||||
public GameObject frontHand;
|
||||
|
||||
|
||||
[Header("Animators")]
|
||||
public Animator handAnimator;
|
||||
|
||||
[Header("Curves")]
|
||||
public BezierCurve3D handCurve;
|
||||
|
||||
|
||||
|
||||
public PlayerActionEvent cowbell;
|
||||
|
||||
|
||||
|
||||
|
||||
public int driverState;
|
||||
|
||||
public float handStart;
|
||||
public float handProgress;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
instance = this;
|
||||
|
@ -70,16 +85,26 @@ namespace HeavenStudio.Games
|
|||
private void Start()
|
||||
{
|
||||
driverState = 0;
|
||||
handStart = -1f;
|
||||
|
||||
|
||||
cowbell = null;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (PlayerInput.Pressed() && !IsExpectingInputNow())
|
||||
if (PlayerInput.Pressed()) //&& !IsExpectingInputNow())
|
||||
{
|
||||
HitCowbell();
|
||||
handStart = Conductor.instance.songPositionInBeats;
|
||||
}
|
||||
|
||||
|
||||
//update hand position
|
||||
handProgress = Math.Min(Conductor.instance.songPositionInBeats - handStart, 1);
|
||||
|
||||
frontHand.transform.position = handCurve.GetPoint(handProgress);
|
||||
|
||||
}
|
||||
|
||||
private void LateUpdate()
|
||||
|
|
Loading…
Reference in a new issue