ハート演出対応
This commit is contained in:
parent
73860a0966
commit
891f8c42e0
|
|
@ -14,32 +14,7 @@ AnimationClip:
|
|||
m_RotationCurves: []
|
||||
m_CompressedRotationCurves: []
|
||||
m_EulerCurves: []
|
||||
m_PositionCurves:
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: {x: 0, y: 1.5, z: 0}
|
||||
inSlope: {x: 0, y: 0, z: 0}
|
||||
outSlope: {x: 0, y: 0, z: 0}
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||
- serializedVersion: 3
|
||||
time: 0.33333334
|
||||
value: {x: 0, y: 1.5, z: 0}
|
||||
inSlope: {x: 0, y: 0, z: 0}
|
||||
outSlope: {x: 0, y: 0, z: 0}
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
path:
|
||||
m_PositionCurves: []
|
||||
m_ScaleCurves:
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
|
|
@ -135,13 +110,6 @@ AnimationClip:
|
|||
typeID: 212
|
||||
customType: 0
|
||||
isPPtrCurve: 0
|
||||
- serializedVersion: 2
|
||||
path: 0
|
||||
attribute: 1
|
||||
script: {fileID: 0}
|
||||
typeID: 4
|
||||
customType: 0
|
||||
isPPtrCurve: 0
|
||||
pptrCurveMapping: []
|
||||
m_AnimationClipSettings:
|
||||
serializedVersion: 2
|
||||
|
|
@ -164,90 +132,6 @@ AnimationClip:
|
|||
m_HeightFromFeet: 0
|
||||
m_Mirror: 0
|
||||
m_EditorCurves:
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.33333334
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.x
|
||||
path:
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1.5
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.33333334
|
||||
value: 1.5
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.y
|
||||
path:
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.33333334
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.z
|
||||
path:
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
|
|
@ -415,6 +299,6 @@ AnimationClip:
|
|||
classID: 212
|
||||
script: {fileID: 0}
|
||||
m_EulerEditorCurves: []
|
||||
m_HasGenericRootTransform: 1
|
||||
m_HasGenericRootTransform: 0
|
||||
m_HasMotionFloatCurves: 0
|
||||
m_Events: []
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ GameObject:
|
|||
- component: {fileID: 3958804368776631697}
|
||||
- component: {fileID: 4809398092723176810}
|
||||
- component: {fileID: 3534603063824972783}
|
||||
m_Layer: 0
|
||||
m_Layer: 5
|
||||
m_Name: SmallHeart
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
|
|
@ -55,7 +55,7 @@ ParticleSystem:
|
|||
startDelay:
|
||||
serializedVersion: 2
|
||||
minMaxState: 0
|
||||
scalar: 1.8
|
||||
scalar: 0
|
||||
minScalar: 0
|
||||
maxCurve:
|
||||
serializedVersion: 2
|
||||
|
|
@ -7321,7 +7321,7 @@ GameObject:
|
|||
- component: {fileID: 3403812381271641660}
|
||||
- component: {fileID: 348776363784026289}
|
||||
- component: {fileID: 916899321649623190}
|
||||
m_Layer: 0
|
||||
m_Layer: 5
|
||||
m_Name: heart
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
|
|
@ -7381,7 +7381,7 @@ SpriteRenderer:
|
|||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 30
|
||||
m_SortingOrder: 151
|
||||
m_Sprite: {fileID: 21300000, guid: aa0bbe72fccf4f04392dd03aacaabec2, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ MonoBehaviour:
|
|||
walkSideTopPos: -1.55
|
||||
walkSideBottomPos: -6.5
|
||||
stopPosision: 0
|
||||
stopPositionRange: 2
|
||||
stopPositionRange: 1
|
||||
orderStayPositions: []
|
||||
orderPosision: 0.5
|
||||
waitOrderPosision: -0.6
|
||||
|
|
@ -73,7 +73,8 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 786931d1da2c4b1c8ce9519c9b3c32fd, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
heart: {fileID: 0}
|
||||
bigHeart: {fileID: 7988005957398545984}
|
||||
smallHeart: {fileID: 992423202615605163}
|
||||
target: {fileID: 0}
|
||||
--- !u!1001 &631677504613307640
|
||||
PrefabInstance:
|
||||
|
|
@ -200,3 +201,15 @@ SpriteRenderer:
|
|||
type: 3}
|
||||
m_PrefabInstance: {fileID: 631677504613307640}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &7988005957398545984 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 7358655632798716600, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 631677504613307640}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &992423202615605163 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 360816779210449747, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 631677504613307640}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
|
|
|
|||
|
|
@ -2,24 +2,32 @@ using UnityEngine;
|
|||
|
||||
public class HeartAnimation : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject heart;
|
||||
[SerializeField] private GameObject bigHeart;
|
||||
[SerializeField] private GameObject smallHeart;
|
||||
[SerializeField] private Transform target;
|
||||
|
||||
private float animationDelay = .3f;
|
||||
private float animationDuration = .8f;
|
||||
private float heartToMeterDuration = .5f;
|
||||
private float destroyDeley = 2f;
|
||||
public void GetHeart()
|
||||
{
|
||||
heart.SetActive(true);
|
||||
this.CallWaitForSeconds(.35f, () =>
|
||||
smallHeart.SetActive(false);
|
||||
this.CallWaitForSeconds(animationDelay, () =>
|
||||
{
|
||||
var cacheTransform = heart.transform;
|
||||
var beginPos = heart.transform.position;
|
||||
cacheTransform.parent = null;
|
||||
this.CallLerp(.5f, f =>
|
||||
bigHeart.SetActive(true);
|
||||
this.CallWaitForSeconds(animationDuration, () =>
|
||||
{
|
||||
cacheTransform.position = Vector3.Lerp(beginPos, target.position, f.EaseInQuadratic());
|
||||
}, () =>
|
||||
{
|
||||
// 大きいハートアニメーションが再生しきったらハートメーターのレベルが書かれているところに飛んでいき
|
||||
// 小さいハートのアニメーションが再生しきったら「Header」を消すのと同時にメーターが増える
|
||||
var cacheTransform = bigHeart.transform;
|
||||
var beginPos = cacheTransform.position;
|
||||
cacheTransform.parent = null;
|
||||
this.CallLerp(heartToMeterDuration, f =>
|
||||
{
|
||||
cacheTransform.position = Vector3.Lerp(beginPos, target.position, f.EaseInQuadratic());
|
||||
}, () =>
|
||||
{
|
||||
smallHeart.SetActive(true);
|
||||
Destroy(bigHeart, destroyDeley);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue