miss implemented
This commit is contained in:
parent
666a5d68c5
commit
d36bfc9542
|
|
@ -74715,6 +74715,7 @@ Transform:
|
||||||
- {fileID: 6673106021490433943}
|
- {fileID: 6673106021490433943}
|
||||||
- {fileID: 5154023206690165501}
|
- {fileID: 5154023206690165501}
|
||||||
- {fileID: 1070424679674934030}
|
- {fileID: 1070424679674934030}
|
||||||
|
- {fileID: 1533203938650873811}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
|
@ -74779,6 +74780,7 @@ MonoBehaviour:
|
||||||
- {fileID: 4541619397523910160}
|
- {fileID: 4541619397523910160}
|
||||||
- {fileID: 2441224063005478318}
|
- {fileID: 2441224063005478318}
|
||||||
- {fileID: 5469916501946480897}
|
- {fileID: 5469916501946480897}
|
||||||
|
_missObjectRef: {fileID: 375236458063640164}
|
||||||
_smallLogCutParticle: {fileID: 1967221045720617934}
|
_smallLogCutParticle: {fileID: 1967221045720617934}
|
||||||
_canCutParticle: {fileID: 1336100976886091474}
|
_canCutParticle: {fileID: 1336100976886091474}
|
||||||
_batCutParticle: {fileID: 7676651234050664727}
|
_batCutParticle: {fileID: 7676651234050664727}
|
||||||
|
|
@ -144212,6 +144214,56 @@ ParticleSystemRenderer:
|
||||||
m_MeshWeighting2: 1
|
m_MeshWeighting2: 1
|
||||||
m_MeshWeighting3: 1
|
m_MeshWeighting3: 1
|
||||||
m_MaskInteraction: 0
|
m_MaskInteraction: 0
|
||||||
|
--- !u!1 &4547627987104407242
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1533203938650873811}
|
||||||
|
- component: {fileID: 375236458063640164}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: MissObjectRef
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 0
|
||||||
|
--- !u!4 &1533203938650873811
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4547627987104407242}
|
||||||
|
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_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 2298792418077467027}
|
||||||
|
m_RootOrder: 15
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &375236458063640164
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4547627987104407242}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 27e24d8dc75422c44a8e6c0dbe17d195, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
offset: {x: 0, y: 0, z: 0}
|
||||||
|
_rot: 270
|
||||||
|
_height: 3
|
||||||
|
_beatDuration: 1
|
||||||
|
_jumpDistanceX: -5
|
||||||
|
_jumpDistanceY: -2
|
||||||
--- !u!1 &4646648672004435504
|
--- !u!1 &4646648672004435504
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,12 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack
|
||||||
_cutActionEvent.Disable();
|
_cutActionEvent.Disable();
|
||||||
_cutActionEvent.QueueDeletion();
|
_cutActionEvent.QueueDeletion();
|
||||||
}
|
}
|
||||||
|
SpriteRenderer sr = _type switch
|
||||||
|
{
|
||||||
|
LumBEARjack.BigType.log => _logSR,
|
||||||
|
_ => throw new System.NotImplementedException(),
|
||||||
|
};
|
||||||
|
LumBEARjack.instance.ActivateMissEffect(sr.transform, sr);
|
||||||
Destroy(gameObject);
|
Destroy(gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -189,6 +189,14 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack
|
||||||
s.Disable();
|
s.Disable();
|
||||||
s.QueueDeletion();
|
s.QueueDeletion();
|
||||||
}
|
}
|
||||||
|
SpriteRenderer sr = _type switch
|
||||||
|
{
|
||||||
|
LumBEARjack.HugeType.log => _logSR,
|
||||||
|
LumBEARjack.HugeType.freezer => _freezerSR,
|
||||||
|
LumBEARjack.HugeType.peach => _peachSR,
|
||||||
|
_ => throw new System.NotImplementedException(),
|
||||||
|
};
|
||||||
|
LumBEARjack.instance.ActivateMissEffect(sr.transform, sr);
|
||||||
Destroy(gameObject);
|
Destroy(gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
58
Assets/Scripts/Games/LumBEARjack/LBJMissObject.cs
Normal file
58
Assets/Scripts/Games/LumBEARjack/LBJMissObject.cs
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using HeavenStudio.Util;
|
||||||
|
|
||||||
|
namespace HeavenStudio.Games.Scripts_LumBEARjack
|
||||||
|
{
|
||||||
|
public class LBJMissObject : SuperCurveObject
|
||||||
|
{
|
||||||
|
[Header("Properties")]
|
||||||
|
[SerializeField] private float _rot;
|
||||||
|
[SerializeField] private float _height;
|
||||||
|
[SerializeField] private float _beatDuration;
|
||||||
|
[SerializeField] private float _jumpDistanceX;
|
||||||
|
[SerializeField] private float _jumpDistanceY;
|
||||||
|
|
||||||
|
private Path _path;
|
||||||
|
private SpriteRenderer _objectSr;
|
||||||
|
private double _startBeat;
|
||||||
|
private bool _right;
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
_path = new Path()
|
||||||
|
{
|
||||||
|
positions = new PathPos[2],
|
||||||
|
};
|
||||||
|
_path.positions[0].height = _height;
|
||||||
|
_path.positions[0].duration = _beatDuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Activate(Transform objectToMove, SpriteRenderer objectSr)
|
||||||
|
{
|
||||||
|
_startBeat = Conductor.instance.songPositionInBeatsAsDouble;
|
||||||
|
_objectSr = objectSr;
|
||||||
|
transform.position = objectToMove.position;
|
||||||
|
objectToMove.SetParent(transform, true);
|
||||||
|
_right = objectToMove.localEulerAngles.z <= 180;
|
||||||
|
_path.positions[0].pos = transform.localPosition;
|
||||||
|
_path.positions[1].pos = transform.localPosition + new Vector3(_right ? _jumpDistanceX : -_jumpDistanceX, _jumpDistanceY);
|
||||||
|
Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
float normalized = Mathf.Max(Conductor.instance.GetPositionFromBeat(_startBeat, _beatDuration, false), 0);
|
||||||
|
|
||||||
|
_objectSr.color = new Color(1, 1, 1, 1 - Mathf.Clamp01(normalized));
|
||||||
|
transform.localPosition = GetPathPositionFromBeat(_path, Conductor.instance.songPositionInBeatsAsDouble, _startBeat);
|
||||||
|
|
||||||
|
float newRot = Mathf.Lerp(0, _right ? _rot : -_rot, normalized);
|
||||||
|
transform.localEulerAngles = new Vector3(0, 0, newRot);
|
||||||
|
|
||||||
|
if (normalized > 1) Destroy(gameObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
11
Assets/Scripts/Games/LumBEARjack/LBJMissObject.cs.meta
Normal file
11
Assets/Scripts/Games/LumBEARjack/LBJMissObject.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 27e24d8dc75422c44a8e6c0dbe17d195
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -117,6 +117,15 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack
|
||||||
private void Miss(PlayerActionEvent caller)
|
private void Miss(PlayerActionEvent caller)
|
||||||
{
|
{
|
||||||
SoundByte.PlayOneShot("miss");
|
SoundByte.PlayOneShot("miss");
|
||||||
|
SpriteRenderer sr = _type switch
|
||||||
|
{
|
||||||
|
LumBEARjack.SmallType.log => _log.GetComponent<SpriteRenderer>(),
|
||||||
|
LumBEARjack.SmallType.can => _can.GetComponent<SpriteRenderer>(),
|
||||||
|
LumBEARjack.SmallType.bat => _bat.GetComponent<SpriteRenderer>(),
|
||||||
|
LumBEARjack.SmallType.broom => _broom.GetComponent<SpriteRenderer>(),
|
||||||
|
_ => throw new System.NotImplementedException(),
|
||||||
|
};
|
||||||
|
LumBEARjack.instance.ActivateMissEffect(sr.transform, sr);
|
||||||
Destroy(gameObject);
|
Destroy(gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -315,6 +315,8 @@ namespace HeavenStudio.Games
|
||||||
|
|
||||||
[SerializeField] private LBJBGCat[] _bgCats = new LBJBGCat[12];
|
[SerializeField] private LBJBGCat[] _bgCats = new LBJBGCat[12];
|
||||||
|
|
||||||
|
[SerializeField] private LBJMissObject _missObjectRef;
|
||||||
|
|
||||||
[Header("Particles")]
|
[Header("Particles")]
|
||||||
[SerializeField] private ParticleSystem _smallLogCutParticle;
|
[SerializeField] private ParticleSystem _smallLogCutParticle;
|
||||||
[SerializeField] private ParticleSystem _canCutParticle;
|
[SerializeField] private ParticleSystem _canCutParticle;
|
||||||
|
|
@ -1048,6 +1050,13 @@ namespace HeavenStudio.Games
|
||||||
|
|
||||||
#region Particles and Effects
|
#region Particles and Effects
|
||||||
|
|
||||||
|
public void ActivateMissEffect(Transform objectToMove, SpriteRenderer objectSr)
|
||||||
|
{
|
||||||
|
LBJMissObject spawnedMiss = Instantiate(_missObjectRef, transform);
|
||||||
|
spawnedMiss.gameObject.SetActive(true);
|
||||||
|
spawnedMiss.Activate(objectToMove, objectSr);
|
||||||
|
}
|
||||||
|
|
||||||
public void ActivateBaby(double beat, float durationMult)
|
public void ActivateBaby(double beat, float durationMult)
|
||||||
{
|
{
|
||||||
LBJBaby newBaby = Instantiate(_baby, transform);
|
LBJBaby newBaby = Instantiate(_baby, transform);
|
||||||
|
|
|
||||||
|
|
@ -297,5 +297,6 @@ MonoBehaviour:
|
||||||
- Assets/Scripts/Games/LumBEARjack/LBJBGCat.cs
|
- Assets/Scripts/Games/LumBEARjack/LBJBGCat.cs
|
||||||
- Assets/Scripts/Games/LumBEARjack/LBJBaby.cs
|
- Assets/Scripts/Games/LumBEARjack/LBJBaby.cs
|
||||||
- Assets/Scripts/Games/LumBEARjack/LBJObjectRotate.cs
|
- Assets/Scripts/Games/LumBEARjack/LBJObjectRotate.cs
|
||||||
|
- Assets/Scripts/Games/LumBEARjack/LBJMissObject.cs
|
||||||
PathsToSkipImportEvent: []
|
PathsToSkipImportEvent: []
|
||||||
PathsToIgnoreOverwriteSettingOnAttribute: []
|
PathsToIgnoreOverwriteSettingOnAttribute: []
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue