mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-10 11:45:09 +00:00
Merge pull request #8 from CarsonKompon/karate-man-coloured-bulbs
Karate man coloured bulbs
This commit is contained in:
commit
526269805d
8 changed files with 297 additions and 4 deletions
|
@ -6719,7 +6719,8 @@ Transform:
|
|||
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_Children: []
|
||||
m_Children:
|
||||
- {fileID: 2894176741642927925}
|
||||
m_Father: {fileID: 7248900332475218834}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
|
@ -7022,6 +7023,7 @@ MonoBehaviour:
|
|||
anim: {fileID: 0}
|
||||
Holder: {fileID: 7248900331917783119}
|
||||
Sprite: {fileID: 7248900332269585492}
|
||||
BulbLightSprite: {fileID: 8800416197462662414}
|
||||
Shadow: {fileID: 7248900331919671867}
|
||||
isThrown: 0
|
||||
isHit: 0
|
||||
|
@ -17755,6 +17757,11 @@ MonoBehaviour:
|
|||
m_EditorClassIdentifier:
|
||||
EligibleHits: []
|
||||
firstEnable: 0
|
||||
LightBulbColors:
|
||||
- {r: 0, g: 0, b: 0, a: 0}
|
||||
- {r: 0.007843138, g: 0.8117647, b: 1, a: 1}
|
||||
- {r: 233, g: 233, b: 0, a: 1}
|
||||
- {r: 0, g: 0, b: 0, a: 0}
|
||||
Pot: {fileID: 7248900332380919981}
|
||||
Bomb: {fileID: 1878496493894552565}
|
||||
KarateJoe: {fileID: 7248900332013002443}
|
||||
|
@ -17767,6 +17774,14 @@ MonoBehaviour:
|
|||
- {fileID: 8671423413994339737, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
|
||||
- {fileID: -6341196331951941137, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
|
||||
- {fileID: -6283416824598814145, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
|
||||
ObjectBottomSprites:
|
||||
- {fileID: 0}
|
||||
- {fileID: 21300000, guid: 2dcc4a0e0420a8e4097445cac4b2e1ab, type: 3}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
BarrelSprites:
|
||||
- {fileID: 6524922379630696755, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
|
||||
- {fileID: 1156572009758090512, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
|
||||
|
@ -18236,3 +18251,99 @@ SpriteRenderer:
|
|||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!1 &8800416197462662414
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2894176741642927925}
|
||||
- component: {fileID: 7700154717549798099}
|
||||
- component: {fileID: 8377832867748690547}
|
||||
m_Layer: 0
|
||||
m_Name: BulbLight
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!4 &2894176741642927925
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8800416197462662414}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -0.26, y: 0.02, z: 0}
|
||||
m_LocalScale: {x: 2.1, y: 2.1, z: 2.1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7248900332269585493}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &7700154717549798099
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8800416197462662414}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
|
||||
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: 60
|
||||
m_Sprite: {fileID: 21300000, guid: 2dcc4a0e0420a8e4097445cac4b2e1ab, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1.9444444, y: 1.9444444}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!114 &8377832867748690547
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8800416197462662414}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e61c91c33ba01f1409c503668f734047, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
flickerInterval: 0.1
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
|
@ -0,0 +1,108 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2dcc4a0e0420a8e4097445cac4b2e1ab
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 72
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -8,6 +8,22 @@ namespace RhythmHeavenMania.Games.KarateMan
|
|||
{
|
||||
public class KarateMan : Minigame
|
||||
{
|
||||
public enum LightBulbType
|
||||
{
|
||||
Normal = 0,
|
||||
Blue = 1,
|
||||
Yellow = 2,
|
||||
Custom = 3
|
||||
}
|
||||
|
||||
public Color[] LightBulbColors = new Color[]
|
||||
{
|
||||
new Color(0, 0, 0, 0),
|
||||
new Color(2, 207, 255),
|
||||
new Color(233, 233, 0),
|
||||
new Color(0, 0, 0, 0)
|
||||
};
|
||||
|
||||
const float hitVoiceOffset = 0.042f;
|
||||
|
||||
public GameObject Pot, Bomb;
|
||||
|
@ -18,6 +34,7 @@ namespace RhythmHeavenMania.Games.KarateMan
|
|||
public static KarateMan instance { get; set; }
|
||||
|
||||
public Sprite[] ObjectSprites;
|
||||
public Sprite[] ObjectBottomSprites;
|
||||
public Sprite[] BarrelSprites;
|
||||
|
||||
public List<BGSpriteC> BGSprites;
|
||||
|
@ -73,7 +90,7 @@ namespace RhythmHeavenMania.Games.KarateMan
|
|||
});
|
||||
}
|
||||
|
||||
public void Shoot(float beat, int type, bool combo = false, string throwAnim = "", int comboIndex = 0, Vector2 endShadowPos = new Vector2())
|
||||
public void Shoot(float beat, int type, bool combo = false, string throwAnim = "", int comboIndex = 0, Vector2 endShadowPos = new Vector2(), UnityEngine.Color tint = default)
|
||||
{
|
||||
GameObject pot = Instantiate(Pot);
|
||||
pot.transform.parent = Pot.transform.parent;
|
||||
|
@ -115,6 +132,10 @@ namespace RhythmHeavenMania.Games.KarateMan
|
|||
case 1:
|
||||
outSnd = "karateman/lightbulbOut";
|
||||
p.hitSnd = "karateman/lightbulbHit";
|
||||
if (tint != default && tint != Color.black) {
|
||||
p.BulbLightSprite.SetActive(true);
|
||||
p.BulbLightSprite.GetComponent<SpriteRenderer>().color = tint;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (Starpelly.Mathp.GetDecimalFromFloat(beat) == 0f)
|
||||
|
|
|
@ -15,9 +15,11 @@ namespace RhythmHeavenMania.Games.KarateMan
|
|||
public GameObject Holder;
|
||||
private GameObject newHolder;
|
||||
public GameObject Sprite;
|
||||
public GameObject BulbLightSprite;
|
||||
private SpriteRenderer spriteComp;
|
||||
public GameObject Shadow;
|
||||
private SpriteRenderer shadowSpriteComp;
|
||||
private SpriteRenderer bulbLightSpriteComp;
|
||||
|
||||
public bool isThrown;
|
||||
public bool isHit = false;
|
||||
|
@ -58,8 +60,10 @@ namespace RhythmHeavenMania.Games.KarateMan
|
|||
anim = GetComponent<Animator>();
|
||||
spriteComp = Sprite.GetComponent<SpriteRenderer>();
|
||||
shadowSpriteComp = Shadow.GetComponent<SpriteRenderer>();
|
||||
bulbLightSpriteComp = BulbLightSprite.GetComponent<SpriteRenderer>();
|
||||
|
||||
Sprite.transform.eulerAngles = new Vector3(0, 0, Random.Range(0, 360));
|
||||
BulbLightSprite.transform.eulerAngles = Sprite.transform.eulerAngles;
|
||||
|
||||
if (type == 2)
|
||||
hitLength = 14f;
|
||||
|
@ -199,12 +203,15 @@ namespace RhythmHeavenMania.Games.KarateMan
|
|||
if (normalizedBeat > 1)
|
||||
{
|
||||
spriteComp.sortingOrder = -20;
|
||||
bulbLightSpriteComp.sortingOrder = -20;
|
||||
shadowSpriteComp.sortingOrder = -30;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Pots closer to Joe are sorted further back.
|
||||
spriteComp.sortingOrder = 60 - Mathf.RoundToInt(10f * normalizedBeat);
|
||||
int newOrder = 60 - Mathf.RoundToInt(10f * normalizedBeat);
|
||||
spriteComp.sortingOrder = newOrder;
|
||||
bulbLightSpriteComp.sortingOrder = newOrder;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -289,6 +296,7 @@ namespace RhythmHeavenMania.Games.KarateMan
|
|||
isHit = true;
|
||||
|
||||
spriteComp.sortingOrder = 49;
|
||||
bulbLightSpriteComp.sortingOrder = 49;
|
||||
}
|
||||
|
||||
public void Miss()
|
||||
|
@ -305,6 +313,7 @@ namespace RhythmHeavenMania.Games.KarateMan
|
|||
isThrown = false;
|
||||
anim.enabled = false;
|
||||
spriteComp.sortingOrder = 49;
|
||||
bulbLightSpriteComp.sortingOrder = 49;
|
||||
}
|
||||
|
||||
private void NewHolder()
|
||||
|
|
|
@ -230,7 +230,16 @@ namespace RhythmHeavenMania
|
|||
{
|
||||
new GameAction("bop", delegate { KarateMan.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 0.5f, true),
|
||||
new GameAction("pot", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 0); }, 2),
|
||||
new GameAction("bulb", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 1); }, 2),
|
||||
new GameAction("bulb", delegate {
|
||||
var e = eventCaller.currentEntity;
|
||||
var c = KarateMan.instance.LightBulbColors[e.type];
|
||||
if(e.type == 3) c = e.colorA;
|
||||
KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 1, tint: c);
|
||||
}, 2, false, new List<Param>()
|
||||
{
|
||||
new Param("type", KarateMan.LightBulbType.Normal, "Type"),
|
||||
new Param("colorA", new Color(), "Custom Color")
|
||||
}),
|
||||
new GameAction("rock", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 2); }, 2),
|
||||
new GameAction("ball", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 3); }, 2),
|
||||
new GameAction("kick", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 4); }, 4.5f),
|
||||
|
|
24
Assets/Scripts/SpriteFlicker.cs
Normal file
24
Assets/Scripts/SpriteFlicker.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class SpriteFlicker : MonoBehaviour
|
||||
{
|
||||
|
||||
public float flickerInterval;
|
||||
|
||||
SpriteRenderer sr;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
sr = GetComponent<SpriteRenderer>();
|
||||
InvokeRepeating("ToggleVisibility", 0f, flickerInterval);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void ToggleVisibility()
|
||||
{
|
||||
sr.enabled = !sr.enabled;
|
||||
}
|
||||
}
|
11
Assets/Scripts/SpriteFlicker.cs.meta
Normal file
11
Assets/Scripts/SpriteFlicker.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e61c91c33ba01f1409c503668f734047
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in a new issue