bomb + ball fix

This commit is contained in:
Rapandrasmus 2024-03-03 01:10:37 +01:00
parent 0c94c21254
commit 9285c779cd
10 changed files with 278 additions and 13 deletions

View file

@ -89493,6 +89493,7 @@ Transform:
- {fileID: 5154023206690165501}
- {fileID: 1070424679674934030}
- {fileID: 1533203938650873811}
- {fileID: 7847283919892774418}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -89564,6 +89565,7 @@ MonoBehaviour:
- {fileID: 2441224063005478318}
- {fileID: 5469916501946480897}
_missObjectRef: {fileID: 375236458063640164}
_bombRef: {fileID: 426220477621117428}
_smallLogCutParticle: {fileID: 1967221045720617934}
_canCutParticle: {fileID: 1336100976886091474}
_batCutParticle: {fileID: 7676651234050664727}
@ -283214,6 +283216,136 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &7421780576366835928
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7847283919892774418}
- component: {fileID: 2091121044834236162}
- component: {fileID: 4213363409197542578}
- component: {fileID: 426220477621117428}
m_Layer: 0
m_Name: bombRef
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &7847283919892774418
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7421780576366835928}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: -2.35, z: 0}
m_LocalScale: {x: 0.6526942, y: 0.6526942, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2298792418077467027}
m_RootOrder: 16
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &2091121044834236162
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7421780576366835928}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: b1a39ae83b8f3994ea5ea73e28b253a8, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 200
m_Sprite: {fileID: 1259205325, guid: fcfd407e5f13b65499ef59b3777db34c, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 3.07, y: 3.27}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!210 &4213363409197542578
SortingGroup:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7421780576366835928}
m_Enabled: 1
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 199
--- !u!114 &426220477621117428
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7421780576366835928}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f7da3ea3f48e67e4fb95580edccae00a, type: 3}
m_Name:
m_EditorClassIdentifier:
offset: {x: 0, y: 0, z: 0}
_rot: 1080
_path:
name:
preview: 0
anchor: {fileID: 0}
positions:
- tag:
pos: {x: 0, y: -2.35, z: 0}
target: {fileID: 0}
height: 16
duration: 4
useLastRealPos: 0
values: []
- tag:
pos: {x: -23.53, y: 8.21, z: 1.9}
target: {fileID: 0}
height: 0
duration: 0
useLastRealPos: 0
values: []
--- !u!1 &7648523036669743223
GameObject:
m_ObjectHideFlags: 0

View file

@ -118,6 +118,7 @@ Transform:
- {fileID: 752161195283805122}
- {fileID: 8326417408316877396}
- {fileID: 3276180286662469811}
- {fileID: 6807847765707975648}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -154,7 +155,7 @@ MonoBehaviour:
_ease: 4
_pivotLeft: {fileID: 752161195283805122}
_pivotRight: {fileID: 8326417408316877396}
_pivotSingle: {fileID: 0}
_pivotSingle: {fileID: 6807847765707975648}
_objectsToMove:
- {fileID: 7773712820662594969}
- {fileID: 3276180286662469811}
@ -273,6 +274,37 @@ Transform:
m_Father: {fileID: 6707971432346881136}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &6101703618622794896
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6807847765707975648}
m_Layer: 0
m_Name: Single
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6807847765707975648
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6101703618622794896}
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: 6707971432346881136}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &6725241522388431689
GameObject:
m_ObjectHideFlags: 0

Binary file not shown.

View file

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 394e2dddc6c26dd47a650e5757263944
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 0
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName: karate/common
assetBundleVariant:

View file

@ -75,6 +75,11 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack
}
return;
}
if (_type == LumBEARjack.BigType.bigBall)
{
_rotateObject.SingleMove(_rotationBeat, _rotationLength, _right);
return;
}
_rotateObject.Move(_rotationBeat, _rotationLength, _right);
}

View file

@ -0,0 +1,38 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace HeavenStudio.Games.Scripts_LumBEARjack
{
public class LBJBomb : SuperCurveObject
{
[SerializeField] private float _rot = 720f;
[SerializeField] private Path _path;
[NonSerialized] public double startBeat;
private void Awake()
{
_path.positions[1].pos = new Vector3(UnityEngine.Random.Range(-_path.positions[1].pos.x, _path.positions[1].pos.x), _path.positions[1].pos.y, _path.positions[1].pos.z);
}
private void OnDrawGizmos()
{
DrawEditorGizmo(_path);
}
private void Update()
{
float normalizedBeat = Conductor.instance.GetPositionFromBeat(startBeat, _path.positions[0].duration, false);
transform.localPosition = GetPathPositionFromBeat(_path, Conductor.instance.songPositionInBeatsAsDouble, startBeat);
transform.localEulerAngles = new Vector3(0, 0, Mathf.Lerp(0, _rot, normalizedBeat));
if (normalizedBeat > 1)
{
Destroy(gameObject);
}
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f7da3ea3f48e67e4fb95580edccae00a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -21,6 +21,7 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack
private LumBEARjack.SmallType _type;
private LumBEARjack.HuhChoice _huh;
private bool _right = true;
private bool _bomb = true;
private double _rotationBeat;
private double _rotationLength;
@ -38,12 +39,13 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack
_rotateObject = GetComponent<LBJObjectRotate>();
}
public void Init(LBJBear bear, double beat, double length, LumBEARjack.SmallType type, LumBEARjack.HuhChoice huh, bool right, double startUpBeat = -1)
public void Init(LBJBear bear, double beat, double length, LumBEARjack.SmallType type, LumBEARjack.HuhChoice huh, bool right, bool bomb, double startUpBeat = -1)
{
_bear = bear;
_type = type;
_huh = huh;
_right = right;
_bomb = bomb;
switch (type)
{
@ -116,7 +118,7 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack
};
SoundByte.PlayOneShotGame("lumbearjack/" + cutSound);
LumBEARjack.instance.DoSmallObjectEffect(_type);
LumBEARjack.instance.DoSmallObjectEffect(_type, _bomb, caller.startBeat + caller.timer);
switch (_huh)
{

View file

@ -45,15 +45,19 @@ namespace HeavenStudio.Games.Loaders
function = delegate
{
var e = eventCaller.currentEntity;
LumBEARjack.instance.SpawnSmallObject(e.beat, e.length, (LumBEARjack.SmallType)e["type"], (LumBEARjack.HuhChoice)e["huh"], (LumBEARjack.CatPutChoice)e["cat"]);
LumBEARjack.instance.SpawnSmallObject(e.beat, e.length, (LumBEARjack.SmallType)e["type"], (LumBEARjack.HuhChoice)e["huh"], (LumBEARjack.CatPutChoice)e["cat"], e["bomb"]);
},
defaultLength = 3,
parameters = new()
{
new("type", LumBEARjack.SmallType.log, "Type"),
new("type", LumBEARjack.SmallType.log, "Type", "", new()
{
new((x, _) => (LumBEARjack.SmallType)x == LumBEARjack.SmallType.barrel, new string[] { "bomb" })
}),
new("sound", true, "Cue Sound"),
new("huh", LumBEARjack.HuhChoice.ObjectSpecific, "Huh"),
new("cat", LumBEARjack.CatPutChoice.Alternate, "Side")
new("cat", LumBEARjack.CatPutChoice.Alternate, "Side"),
new("bomb", true, "Bomb")
}
},
new("big", "Big Object")
@ -159,15 +163,19 @@ namespace HeavenStudio.Games.Loaders
function = delegate
{
var e = eventCaller.currentEntity;
LumBEARjack.instance.SpawnSmallObject(e.beat, e.length, (LumBEARjack.SmallType)e["type"], (LumBEARjack.HuhChoice)e["huh"], (LumBEARjack.CatPutChoice)e["cat"]);
LumBEARjack.instance.SpawnSmallObject(e.beat, e.length, (LumBEARjack.SmallType)e["type"], (LumBEARjack.HuhChoice)e["huh"], (LumBEARjack.CatPutChoice)e["cat"], e["bomb"]);
},
defaultLength = 3,
parameters = new()
{
new("type", LumBEARjack.SmallType.log, "Type"),
new("type", LumBEARjack.SmallType.log, "Type", "", new()
{
new((x, _) => (LumBEARjack.SmallType)x == LumBEARjack.SmallType.barrel, new string[] { "bomb" })
}),
new("sound", true, "Cue Sound"),
new("huh", LumBEARjack.HuhChoice.ObjectSpecific, "Huh"),
new("cat", LumBEARjack.CatPutChoice.Alternate, "Side")
new("cat", LumBEARjack.CatPutChoice.Alternate, "Side"),
new("bomb", true, "Bomb")
},
resizable = true
},
@ -320,6 +328,8 @@ namespace HeavenStudio.Games
[SerializeField] private LBJMissObject _missObjectRef;
[SerializeField] private LBJBomb _bombRef;
[Header("Particles")]
[SerializeField] private ParticleSystem _smallLogCutParticle;
[SerializeField] private ParticleSystem _canCutParticle;
@ -380,14 +390,14 @@ namespace HeavenStudio.Games
#region Spawn Objects
public void SpawnSmallObject(double beat, double length, SmallType type, HuhChoice huh, CatPutChoice cat, double startUpBeat = -1)
public void SpawnSmallObject(double beat, double length, SmallType type, HuhChoice huh, CatPutChoice cat, bool bomb, double startUpBeat = -1)
{
BeatAction.New(this, new()
{
new(beat + (length / 3), delegate
{
LBJSmallObject spawnedObject = Instantiate(_smallObjectPrefab, _cutObjectHolder);
spawnedObject.Init(_bear, beat, length, type, huh, ShouldBeRight(beat, cat), startUpBeat);
spawnedObject.Init(_bear, beat, length, type, huh, ShouldBeRight(beat, cat), bomb, startUpBeat);
})
});
}
@ -608,7 +618,7 @@ namespace HeavenStudio.Games
case "small":
case "smallS":
SmallObjectSound(e.beat, e.length, (SmallType)e["type"], beat);
SpawnSmallObject(e.beat, e.length, (SmallType)e["type"], (HuhChoice)e["huh"], (CatPutChoice)e["cat"], beat);
SpawnSmallObject(e.beat, e.length, (SmallType)e["type"], (HuhChoice)e["huh"], (CatPutChoice)e["cat"], e["bomb"], beat);
break;
case "big":
case "bigS":
@ -1099,7 +1109,7 @@ namespace HeavenStudio.Games
_snowParticle.Play();
}
public void DoSmallObjectEffect(SmallType type)
public void DoSmallObjectEffect(SmallType type, bool bomb, double beat)
{
switch (type)
{
@ -1122,6 +1132,18 @@ namespace HeavenStudio.Games
case SmallType.barrel:
ParticleSystem spawnedParticle4 = Instantiate(_barrelCutParticle, _particleCutPoint);
spawnedParticle4.PlayScaledAsyncAllChildren(0.5f);
if (bomb)
{
LBJBomb spawnedBomb = Instantiate(_bombRef, transform);
spawnedBomb.gameObject.SetActive(true);
spawnedBomb.startBeat = beat;
MultiSound.Play(new MultiSound.Sound[]
{
new("lumbearjack/bombCut", beat),
new("lumbearjack/bombBreak", beat + 4, 1, 0.2f)
});
}
break;
case SmallType.book:
ParticleSystem spawnedParticle5 = Instantiate(_bookCutParticle, _particleCutPoint);

View file

@ -327,5 +327,6 @@ MonoBehaviour:
- Assets/Scripts/Util/StringUtils.cs
- Assets/Plugins/Starpelly/OperatingSystem/MacOS.cs
- Assets/Plugins/Starpelly/Common.cs
- Assets/Scripts/Games/LumBEARjack/LBJBomb.cs
PathsToSkipImportEvent: []
PathsToIgnoreOverwriteSettingOnAttribute: []