Ear flap
This commit is contained in:
parent
3d4828fad8
commit
c094acd777
|
|
@ -501,6 +501,7 @@ GameObject:
|
||||||
- component: {fileID: 6198430257364661693}
|
- component: {fileID: 6198430257364661693}
|
||||||
- component: {fileID: -5564384145903586768}
|
- component: {fileID: -5564384145903586768}
|
||||||
- component: {fileID: -4645702950898394595}
|
- component: {fileID: -4645702950898394595}
|
||||||
|
- component: {fileID: 5550233630878919113}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Elephant
|
m_Name: Elephant
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
|
@ -580,6 +581,21 @@ MonoBehaviour:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
_monkey: {fileID: 4283362470282314707}
|
_monkey: {fileID: 4283362470282314707}
|
||||||
_holdLength: 2
|
_holdLength: 2
|
||||||
|
--- !u!114 &5550233630878919113
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7540716611123628191}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: e3924ec15f56dc74290292826f4e9649, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
_anim: {fileID: 6198430257364661693}
|
||||||
|
_animName: ElephantEar
|
||||||
|
_holdLength: 2
|
||||||
--- !u!1 &7805847212563886084
|
--- !u!1 &7805847212563886084
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -264,6 +264,7 @@ GameObject:
|
||||||
- component: {fileID: 1701002327333926128}
|
- component: {fileID: 1701002327333926128}
|
||||||
- component: {fileID: 5248028064811562821}
|
- component: {fileID: 5248028064811562821}
|
||||||
- component: {fileID: 3253363150451868373}
|
- component: {fileID: 3253363150451868373}
|
||||||
|
- component: {fileID: 5165305002464474939}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Giraffe
|
m_Name: Giraffe
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
|
@ -320,6 +321,21 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
_monkey: {fileID: 7559970804447045551}
|
_monkey: {fileID: 7559970804447045551}
|
||||||
|
--- !u!114 &5165305002464474939
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2939598505969617365}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: e3924ec15f56dc74290292826f4e9649, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
_anim: {fileID: 7772794942310833959}
|
||||||
|
_animName: GiraffeEar
|
||||||
|
_holdLength: 4
|
||||||
--- !u!1 &3911272779464478738
|
--- !u!1 &3911272779464478738
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
37
Assets/Scripts/Games/AnimalAcrobat/EarFlap.cs
Normal file
37
Assets/Scripts/Games/AnimalAcrobat/EarFlap.cs
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
using HeavenStudio.Util;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace HeavenStudio.Games.Scripts_AnimalAcrobat
|
||||||
|
{
|
||||||
|
public class EarFlap : MonoBehaviour
|
||||||
|
{
|
||||||
|
[SerializeField] private Animator _anim;
|
||||||
|
[SerializeField] private string _animName;
|
||||||
|
[SerializeField] private double _holdLength;
|
||||||
|
private AcrobatObstacle _mainScript;
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
_mainScript = GetComponent<AcrobatObstacle>();
|
||||||
|
_mainScript.OnInit += Init;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Init(double beat, bool unused)
|
||||||
|
{
|
||||||
|
BeatAction.New(this, new()
|
||||||
|
{
|
||||||
|
new(beat + _holdLength - 2, delegate
|
||||||
|
{
|
||||||
|
_anim.DoScaledAnimationAsync(_animName, 0.5f);
|
||||||
|
}),
|
||||||
|
new(beat + _holdLength - 1, delegate
|
||||||
|
{
|
||||||
|
_anim.DoScaledAnimationAsync(_animName, 0.5f);
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
11
Assets/Scripts/Games/AnimalAcrobat/EarFlap.cs.meta
Normal file
11
Assets/Scripts/Games/AnimalAcrobat/EarFlap.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e3924ec15f56dc74290292826f4e9649
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Loading…
Reference in a new issue