particles

This commit is contained in:
Rapandrasmus 2023-10-08 12:48:53 +02:00
parent aac02a3437
commit be07514c9d
9 changed files with 90 additions and 7 deletions

View file

@ -530,6 +530,7 @@ MonoBehaviour:
_jumpStartCameraDistance: 3
_jumpStartDistance: -1.25
_giraffeCameraZoom: 12
MonkeyMissed: 0
--- !u!1 &9154566379104488428
GameObject:
m_ObjectHideFlags: 0
@ -638,6 +639,16 @@ Transform:
m_CorrespondingSourceObject: {fileID: 6171382744519440479, guid: 8c681a700cd16784580f97e7f10a53e6, type: 3}
m_PrefabInstance: {fileID: 8166682498639938566}
m_PrefabAsset: {fileID: 0}
--- !u!198 &3875907379403851012 stripped
ParticleSystem:
m_CorrespondingSourceObject: {fileID: 4943860916442349826, guid: 8c681a700cd16784580f97e7f10a53e6, type: 3}
m_PrefabInstance: {fileID: 8166682498639938566}
m_PrefabAsset: {fileID: 0}
--- !u!198 &3975180264645336726 stripped
ParticleSystem:
m_CorrespondingSourceObject: {fileID: 5079865856385702544, guid: 8c681a700cd16784580f97e7f10a53e6, type: 3}
m_PrefabInstance: {fileID: 8166682498639938566}
m_PrefabAsset: {fileID: 0}
--- !u!1 &5719573208726547716 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4482739629151873282, guid: 8c681a700cd16784580f97e7f10a53e6, type: 3}
@ -656,6 +667,9 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
offset: {x: 0, y: 0, z: 0}
_scroll: {fileID: 6038557817912069913}
_releaseParticle: {fileID: 3975180264645336726}
_trailParticle: {fileID: 3875907379403851012}
_jumpDistanceStart: 6
_jumpDistance: 4
_jumpHeight: 4

View file

@ -565,6 +565,7 @@ MonoBehaviour:
_holdLength: 2
_ease: 4
_holdPadding: 1
_holdPaddingStart: 0
_rotateRoot: {fileID: 2616646720197201304}
_gripPoint: {fileID: 2131794628642567477}
--- !u!114 &-4645702950898394595
@ -581,6 +582,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
_monkey: {fileID: 4283362470282314707}
_holdLength: 2
_holdParticle: {fileID: 5372215907466563984}
--- !u!114 &5550233630878919113
MonoBehaviour:
m_ObjectHideFlags: 0
@ -919,3 +921,8 @@ Animator:
m_CorrespondingSourceObject: {fileID: 6945261984245565766, guid: 8c681a700cd16784580f97e7f10a53e6, type: 3}
m_PrefabInstance: {fileID: 6562599539575982741}
m_PrefabAsset: {fileID: 0}
--- !u!198 &5372215907466563984 stripped
ParticleSystem:
m_CorrespondingSourceObject: {fileID: 1269725258759199493, guid: 8c681a700cd16784580f97e7f10a53e6, type: 3}
m_PrefabInstance: {fileID: 6562599539575982741}
m_PrefabAsset: {fileID: 0}

View file

@ -322,6 +322,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
_monkey: {fileID: 7559970804447045551}
_holdParticle: {fileID: 1807658667361072620}
--- !u!114 &5165305002464474939
MonoBehaviour:
m_ObjectHideFlags: 0
@ -740,6 +741,11 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 8c681a700cd16784580f97e7f10a53e6, type: 3}
--- !u!198 &1807658667361072620 stripped
ParticleSystem:
m_CorrespondingSourceObject: {fileID: 1269725258759199493, guid: 8c681a700cd16784580f97e7f10a53e6, type: 3}
m_PrefabInstance: {fileID: 615004812187578089}
m_PrefabAsset: {fileID: 0}
--- !u!4 &6714243032395732662 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 6171382744519440479, guid: 8c681a700cd16784580f97e7f10a53e6, type: 3}

View file

@ -10297,12 +10297,12 @@ ParticleSystem:
serializedVersion: 8
lengthInSec: 5
simulationSpeed: 1
stopAction: 0
stopAction: 2
cullingMode: 0
ringBufferMode: 0
ringBufferLoopRange: {x: 0, y: 1}
emitterVelocityMode: 1
looping: 1
looping: 0
prewarm: 0
playOnAwake: 0
useUnscaledTime: 0
@ -10360,7 +10360,7 @@ ParticleSystem:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
moveWithTransform: 1
moveWithTransform: 0
moveWithCustomTransform: {fileID: 0}
scalingMode: 1
randomSeed: 0
@ -20246,12 +20246,12 @@ ParticleSystem:
serializedVersion: 8
lengthInSec: 5
simulationSpeed: 1
stopAction: 0
stopAction: 2
cullingMode: 0
ringBufferMode: 0
ringBufferLoopRange: {x: 0, y: 1}
emitterVelocityMode: 1
looping: 1
looping: 0
prewarm: 0
playOnAwake: 0
useUnscaledTime: 0
@ -20309,7 +20309,7 @@ ParticleSystem:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
moveWithTransform: 1
moveWithTransform: 0
moveWithCustomTransform: {fileID: 0}
scalingMode: 1
randomSeed: 0
@ -25354,7 +25354,7 @@ ParticleSystem:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
moveWithTransform: 1
moveWithTransform: 0
moveWithCustomTransform: {fileID: 0}
scalingMode: 1
randomSeed: 0

View file

@ -165,6 +165,7 @@ MonoBehaviour:
_holdLength: 1
_ease: 10
_holdPadding: 0.25
_holdPaddingStart: 0
_rotateRoot: {fileID: 2068126119450832752}
_gripPoint: {fileID: 8286548847234487440}
--- !u!114 &3772265357728581139
@ -181,6 +182,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
_monkey: {fileID: 3408415209414813745}
_holdLength: 1
_holdParticle: {fileID: 6823341616428808818}
--- !u!1 &3823740494665398411
GameObject:
m_ObjectHideFlags: 0
@ -626,3 +628,8 @@ Animator:
m_CorrespondingSourceObject: {fileID: 6945261984245565766, guid: 8c681a700cd16784580f97e7f10a53e6, type: 3}
m_PrefabInstance: {fileID: 5705947929937584503}
m_PrefabAsset: {fileID: 0}
--- !u!198 &6823341616428808818 stripped
ParticleSystem:
m_CorrespondingSourceObject: {fileID: 1269725258759199493, guid: 8c681a700cd16784580f97e7f10a53e6, type: 3}
m_PrefabInstance: {fileID: 5705947929937584503}
m_PrefabAsset: {fileID: 0}

View file

@ -1953,6 +1953,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
_monkey: {fileID: 7753963699734426661}
_holdLength: 3
_holdParticle: {fileID: 1902738374551414374}
--- !u!114 &6573424568878642626
MonoBehaviour:
m_ObjectHideFlags: 0
@ -2233,6 +2234,11 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 8c681a700cd16784580f97e7f10a53e6, type: 3}
--- !u!198 &1902738374551414374 stripped
ParticleSystem:
m_CorrespondingSourceObject: {fileID: 1269725258759199493, guid: 8c681a700cd16784580f97e7f10a53e6, type: 3}
m_PrefabInstance: {fileID: 862749516297338211}
m_PrefabAsset: {fileID: 0}
--- !u!4 &6799377662398989628 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 6171382744519440479, guid: 8c681a700cd16784580f97e7f10a53e6, type: 3}

View file

@ -7,6 +7,9 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat
{
public class AcrobatPlayer : SuperCurveObject
{
[Header("Components")]
[SerializeField] private Transform _scroll;
[SerializeField] private ParticleSystem _releaseParticle, _trailParticle;
[Header("Values")]
[SerializeField] private float _jumpDistanceStart = 6f;
[SerializeField] private float _jumpDistance = 8f;
@ -29,9 +32,15 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat
_restY = transform.localPosition.y;
}
private void LateUpdate()
{
_trailParticle.transform.eulerAngles = Vector3.zero;
}
private void OnDisable()
{
StopAllCoroutines();
_trailParticle.Stop();
}
public void Bop()
@ -42,15 +51,29 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat
public void JumpBetweenAnimals(double beat, float startPoint)
{
_anim.Play("PlayerAir", 0, 0);
Jump(beat, 2, startPoint, _jumpDistance, _jumpHeight, _restY);
RotateJump(beat, 2);
SpawnReleaseParticle();
}
public void JumpBetweenGiraffe(double beat, float startPoint)
{
_anim.Play("PlayerAir", 0, 0);
_trailParticle.Play();
Jump(beat, 4, startPoint, _jumpDistanceGiraffe, _jumpHeightGiraffe, _restY);
RotateJump(beat, 4);
SpawnReleaseParticle();
}
private void SpawnReleaseParticle()
{
ParticleSystem spawnedParticle = Instantiate(_releaseParticle, _scroll);
spawnedParticle.transform.position = transform.position;
spawnedParticle.Play();
}
public void InitialJump(double beat)

View file

@ -8,6 +8,7 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat
public class GiraffeInput : MonoBehaviour
{
[SerializeField] private Animator _monkey;
[SerializeField] private ParticleSystem _holdParticle;
private AcrobatObstacle _mainScript;
private AnimalAcrobat _game;
@ -47,6 +48,7 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat
_monkey.gameObject.SetActive(true);
_monkey.DoScaledAnimationAsync("PlayerHang", 1f, 0.4f);
_game.PlayerSetActive(false);
SpawnParticle();
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(0, delegate {}),
@ -63,6 +65,7 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat
_monkey.gameObject.SetActive(true);
_monkey.DoScaledAnimationAsync("PlayerHang", 1f, 0.4f);
_game.PlayerSetActive(false);
SpawnParticle();
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(0, delegate {}),
@ -73,6 +76,13 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat
});
}
private void SpawnParticle()
{
ParticleSystem spawnedParticle = Instantiate(_holdParticle, transform);
spawnedParticle.transform.position = _holdParticle.transform.position;
spawnedParticle.Play();
}
private void JustRelease(PlayerActionEvent caller, float state)
{
SoundByte.PlayOneShotGame("animalAcrobat/giraffeJump");

View file

@ -9,6 +9,7 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat
{
[SerializeField] private Animator _monkey;
[SerializeField] private double _holdLength;
[SerializeField] private ParticleSystem _holdParticle;
private AcrobatObstacle _mainScript;
@ -42,6 +43,7 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat
_monkey.gameObject.SetActive(true);
_monkey.DoScaledAnimationAsync("PlayerHang", 1f, 0.4f);
_game.PlayerSetActive(false);
SpawnParticle();
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(0, delegate {}),
@ -58,6 +60,7 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat
_monkey.gameObject.SetActive(true);
_monkey.DoScaledAnimationAsync("PlayerHang", 1f, 0.4f);
_game.PlayerSetActive(false);
SpawnParticle();
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(0, delegate {}),
@ -68,6 +71,13 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat
});
}
private void SpawnParticle()
{
ParticleSystem spawnedParticle = Instantiate(_holdParticle, transform);
spawnedParticle.transform.position = _holdParticle.transform.position;
spawnedParticle.Play();
}
private void JustRelease(PlayerActionEvent caller, float state)
{
SoundByte.PlayOneShotGame("animalAcrobat/release");