replace old karate man prefab with new one

This commit is contained in:
minenice55 2022-07-29 15:06:22 -04:00
parent 41d098ec1d
commit a1f7b0ea42
31 changed files with 4375 additions and 23754 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 0b1209c434c230e4ea7a17b19b76849c
guid: d168b552a0cb2b44d8544bf0b6c8da13
PrefabImporter:
externalObjects: {}
userData:

View file

@ -0,0 +1,668 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: NoPose
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 0, y: 0, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: Exclaim
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 0, y: 0, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: Main
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 0, y: 0, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: Sub
m_PositionCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: -1.08, y: 1, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: Exclaim
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: -5.8, y: 1.5, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: Main
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: -1.403, y: 1, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: Sub
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 0}
attribute: m_Sprite
path: Exclaim
classID: 212
script: {fileID: 0}
- curve:
- time: 0
value: {fileID: 0}
attribute: m_Sprite
path: Main
classID: 212
script: {fileID: 0}
- curve:
- time: 0
value: {fileID: 0}
attribute: m_Sprite
path: Sub
classID: 212
script: {fileID: 0}
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 224731958
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
- serializedVersion: 2
path: 521822810
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
- serializedVersion: 2
path: 1615840316
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
- serializedVersion: 2
path: 224731958
attribute: 1
script: {fileID: 0}
typeID: 4
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 521822810
attribute: 1
script: {fileID: 0}
typeID: 4
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 1615840316
attribute: 1
script: {fileID: 0}
typeID: 4
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 224731958
attribute: 4
script: {fileID: 0}
typeID: 4
customType: 4
isPPtrCurve: 0
- serializedVersion: 2
path: 521822810
attribute: 4
script: {fileID: 0}
typeID: 4
customType: 4
isPPtrCurve: 0
- serializedVersion: 2
path: 1615840316
attribute: 4
script: {fileID: 0}
typeID: 4
customType: 4
isPPtrCurve: 0
pptrCurveMapping:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.016666668
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: -1.08
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.x
path: Exclaim
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.y
path: Exclaim
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.z
path: Exclaim
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.x
path: Exclaim
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.y
path: Exclaim
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.z
path: Exclaim
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: -5.8
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.x
path: Main
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1.5
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.y
path: Main
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.z
path: Main
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.x
path: Main
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.y
path: Main
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.z
path: Main
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: -1.403
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.x
path: Sub
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.y
path: Sub
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.z
path: Sub
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.x
path: Sub
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.y
path: Sub
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.z
path: Sub
classID: 4
script: {fileID: 0}
m_EulerEditorCurves:
- curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.x
path: Exclaim
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.y
path: Exclaim
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.z
path: Exclaim
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.x
path: Main
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.y
path: Main
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.z
path: Main
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.x
path: Sub
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.y
path: Sub
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.z
path: Sub
classID: 4
script: {fileID: 0}
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View file

@ -1,7 +1,8 @@
fileFormatVersion: 2
guid: d168b552a0cb2b44d8544bf0b6c8da13
PrefabImporter:
guid: fe1864420a204874fac271bb6955a5e8
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -178,6 +178,32 @@ AnimatorController:
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1102 &1133350279288983051
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: NoPose
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: fe1864420a204874fac271bb6955a5e8, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &1136731949493752883
AnimatorState:
serializedVersion: 6
@ -234,6 +260,9 @@ AnimatorStateMachine:
- serializedVersion: 1
m_State: {fileID: -3526870332612620235}
m_Position: {x: 410, y: 390, z: 0}
- serializedVersion: 1
m_State: {fileID: 1133350279288983051}
m_Position: {x: 445, y: 455, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
@ -243,4 +272,4 @@ AnimatorStateMachine:
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: -2381588529378463098}
m_DefaultState: {fileID: 1133350279288983051}

View file

@ -219,7 +219,7 @@ AnimationClip:
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0

View file

@ -219,7 +219,7 @@ AnimationClip:
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0

View file

@ -219,7 +219,7 @@ AnimationClip:
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0

View file

@ -219,7 +219,7 @@ AnimationClip:
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0

View file

@ -219,7 +219,7 @@ AnimationClip:
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0

View file

@ -219,7 +219,7 @@ AnimationClip:
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0

View file

@ -219,7 +219,7 @@ AnimationClip:
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0

View file

@ -1,118 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
namespace HeavenStudio.Games.Scripts_KarateMan
{
// Physics in Rhythm Heaven Mania? nah im just fuckin lazy
public class BarrelDestroyEffect : MonoBehaviour
{
public SpriteRenderer SpriteRenderer;
private Rigidbody2D rb2d;
private BoxCollider2D col;
public int spriteIndex;
public int index;
public bool combo;
public GameObject shadow;
public void Init()
{
SpriteRenderer = this.gameObject.GetComponent<SpriteRenderer>();
SpriteRenderer.sprite = KarateMan.instance.BarrelSprites[spriteIndex];
rb2d = this.gameObject.AddComponent<Rigidbody2D>();
rb2d.gravityScale = 11;
rb2d.collisionDetectionMode = CollisionDetectionMode2D.Continuous;
// rb2d.interpolation = RigidbodyInterpolation2D.Interpolate;
float yRange = 0;
float xRange = Random.Range(500, 800);
switch (index)
{
case 0:
yRange = Random.Range(400, 1500);
break;
case 1:
yRange = Random.Range(200, 700);
break;
case 2:
yRange = Random.Range(300, 1200);
break;
case 3:
yRange = Random.Range(300, 1200);
break;
case 4:
yRange = Random.Range(300, 1200);
break;
case 5:
yRange = Random.Range(300, 1200);
break;
case 6:
yRange = Random.Range(300, 1200);
break;
case 7:
yRange = Random.Range(500, 1600);
break;
}
if (combo)
{
yRange = Random.Range(800, 1600);
xRange = Random.Range(200, 500);
}
rb2d.AddForce(Vector3.up * yRange);
rb2d.AddForce(Vector3.right * xRange);
// this.gameObject.AddComponent<Rotate>().rotateSpeed = Random.Range(60, 450);
col = this.gameObject.AddComponent<BoxCollider2D>();
PhysicsMaterial2D mat = new PhysicsMaterial2D();
mat.bounciness = 0;
col.sharedMaterial = mat;
col.offset = new Vector2(-0.0574677f, -0.07480353f);
col.size = new Vector2(0.5694333f, 1.912059f);
StartCoroutine(FadeOut());
gameObject.name = "barrel_p";
}
private void OnCollisionEnter2D(Collision2D collision)
{
if (collision.gameObject.name != "barrel_p")
{
Destroy(rb2d);
Destroy(col);
}
else
{
Physics2D.IgnoreCollision(collision.collider, col);
}
}
private void Update()
{
if (rb2d != null)
this.transform.eulerAngles = new Vector3(0, 0, rb2d.velocity.magnitude * 4);
shadow.transform.localPosition = new Vector3(this.transform.localPosition.x, shadow.transform.localPosition.y);
}
private IEnumerator FadeOut()
{
yield return new WaitForSeconds(Conductor.instance.secPerBeat * 3);
var shadowSprite = shadow.GetComponent<SpriteRenderer>();
var fadeColor = shadowSprite.color;
fadeColor.a = 0;
SpriteRenderer.DOColor(new Color(1, 1, 1, 0), Conductor.instance.secPerBeat * 3).OnComplete(delegate { Destroy(this.gameObject); });
shadowSprite.DOColor(fadeColor, Conductor.instance.secPerBeat * 3).OnComplete(delegate { Destroy(shadow); });
}
}
}

View file

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

View file

@ -1,143 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HeavenStudio.Util;
namespace HeavenStudio.Games.Scripts_KarateMan
{
public class Bomb : PlayerActionObject
{
private Animator anim;
private float startBeat;
private float hitBeat;
private float missBeat;
public bool kicked;
private bool missed;
private bool eligible;
public GameObject Holder;
public GameObject RotHolder;
private Vector3 lastRot;
public GameObject shadow;
private float shadowY;
[Header("Curves")]
[SerializeField] private AnimationCurve outCurve;
[SerializeField] private AnimationCurve shadowHitCurve;
private void Awake()
{
anim = GetComponent<Animator>();
startBeat = Conductor.instance.songPositionInBeats;
eligible = true;
PlayerActionInit(this.gameObject, startBeat);
}
public override void OnAce()
{
Hit();
}
private void Update()
{
shadow.transform.localPosition = new Vector3(Holder.transform.localPosition.x, shadow.transform.localPosition.y);
if (!kicked)
{
if (!missed)
{
float normalizedBeatAnim = Conductor.instance.GetPositionFromBeat(startBeat, 1.25f);
anim.Play("BombOut", 0, normalizedBeatAnim);
anim.speed = 0;
float normalizedBeat = Conductor.instance.GetPositionFromBeat(startBeat, 0.75f);
StateCheckNoList(normalizedBeat);
RotHolder.transform.eulerAngles = new Vector3(0, 0, Mathf.Lerp(0, -90, outCurve.Evaluate(normalizedBeatAnim)));
lastRot = RotHolder.transform.eulerAngles;
shadowY = shadow.transform.localPosition.y;
if (normalizedBeat > 1.5f)
{
eligible = false;
// explode animation
if (normalizedBeat > 4)
Destroy(this.gameObject);
}
if (PlayerInput.PressedUp())
{
if (state.perfect)
{
Hit();
}
else
{
Miss();
}
}
}
else
{
float normalizedBeatAnim = Conductor.instance.GetPositionFromBeat(missBeat, 1f);
anim.Play("BombMiss", 0, normalizedBeatAnim);
anim.speed = 0;
RotHolder.transform.eulerAngles = new Vector3(0, 0, Mathf.Lerp(lastRot.z, lastRot.z - 180, normalizedBeatAnim));
if (normalizedBeatAnim > 2)
{
Destroy(this.gameObject);
}
}
}
else
{
float normalizedBeatAnim = Conductor.instance.GetPositionFromBeat(hitBeat, 3f);
anim.Play("BombHit", 0, normalizedBeatAnim);
anim.speed = 0;
RotHolder.transform.eulerAngles = new Vector3(0, 0, Mathf.Lerp(lastRot.z, lastRot.z - 180, normalizedBeatAnim));
shadow.transform.localPosition = new Vector3(shadow.transform.localPosition.x, Mathf.Lerp(shadowY, 0.881f, shadowHitCurve.Evaluate(normalizedBeatAnim)));
shadow.transform.localScale = Holder.transform.localScale;
if (normalizedBeatAnim > 1)
{
Destroy(this.gameObject);
}
}
}
public void Hit()
{
KarateJoe.instance.HitEffectF(new Vector3(0.9f, 2.0549f));
Jukebox.PlayOneShotGame("karateman/bombKick");
hitBeat = Conductor.instance.songPositionInBeats;
kicked = true;
RotHolder.transform.eulerAngles = lastRot;
KarateJoe.instance.ResetKick();
KarateJoe.instance.AnimPlay("Kick");
}
public void Miss()
{
missBeat = Conductor.instance.songPositionInBeats;
missed = true;
Jukebox.PlayOneShot("miss");
KarateJoe.instance.ResetKick();
KarateJoe.instance.AnimPlay("Kick");
}
}
}

View file

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

View file

@ -1,53 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
namespace HeavenStudio.Games.Scripts_KarateMan
{
// Physics in Rhythm Heaven Mania? nah im just fuckin lazy
public class CookingPotDestroyEffect : MonoBehaviour
{
public SpriteRenderer SpriteRenderer;
public int spriteIndex;
public int index;
private float rotationSpeed;
public GameObject pot;
private void Awake()
{
SpriteRenderer sr = gameObject.AddComponent<SpriteRenderer>();
sr.sprite = KarateMan.instance.CookingPotSprites[1];
Rigidbody2D rb2d = gameObject.AddComponent<Rigidbody2D>();
rb2d.gravityScale = 5;
rb2d.collisionDetectionMode = CollisionDetectionMode2D.Continuous;
rb2d.AddForce(Vector3.up * Random.Range(875, 925));
rotationSpeed = Random.Range(100, 200);
PhysicsMaterial2D mat = new PhysicsMaterial2D();
mat.bounciness = 0;
StartCoroutine(FadeOut());
gameObject.name = "cookingpot_lid";
}
private void Update()
{
transform.eulerAngles -= new Vector3(0, 0, rotationSpeed * Time.deltaTime);
transform.position = new Vector3(pot.transform.position.x, transform.position.y, transform.position.z);
}
private IEnumerator FadeOut()
{
yield return new WaitForSeconds(Conductor.instance.secPerBeat * 3);
Destroy(gameObject);
}
}
}

View file

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

View file

@ -1,325 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HeavenStudio.Util;
namespace HeavenStudio.Games.Scripts_KarateMan
{
public class KarateJoe : MonoBehaviour
{
[Header("Components")]
public Animator anim;
public GameObject HitEffect;
public GameObject BulbHit;
[SerializeField] private SpriteRenderer head;
[SerializeField] private Sprite[] heads;
[SerializeField] private GameObject missEffect;
[SerializeField] private SpriteRenderer[] shadows;
[Header("Properties")]
public bool hitBarrel = false;
public Coroutine kickC;
public Coroutine missC;
private float barrelBeat;
public bool inCombo;
public bool hitCombo;
private float comboBeat;
public List<Pot> currentComboPots = new List<Pot>();
private int comboPotIndex;
private int currentComboHitInList;
private int comboIndex;
public float comboNormalizedBeat = 0;
public static KarateJoe instance { get; set; }
private void Awake()
{
instance = this;
anim = GetComponent<Animator>();
}
private void Update()
{
if (inCombo)
{
comboNormalizedBeat = Conductor.instance.GetPositionFromBeat(comboBeat, 1);
if (hitCombo)
{
if (currentComboPots[comboPotIndex] == null) return;
}
else
{
comboNormalizedBeat += 1;
}
if (comboNormalizedBeat >= 1 && comboIndex < 1)
{
if (hitCombo)
{
currentComboPots[comboPotIndex].Hit();
HitEffectF(currentComboPots[comboPotIndex].Holder.transform.localPosition);
comboPotIndex++;
Jukebox.PlayOneShotGame("karateman/comboHit1");
}
else
{
Jukebox.PlayOneShotGame("karateman/swingNoHit");
}
comboIndex++;
AnimPlay("PunchLeft");
}
else if (comboNormalizedBeat >= 1.25f && comboIndex < 2)
{
if (hitCombo)
{
currentComboPots[comboPotIndex].Hit();
HitEffectF(currentComboPots[comboPotIndex].Holder.transform.localPosition);
comboPotIndex++;
Jukebox.PlayOneShotGame("karateman/comboHit1");
}
else
{
Jukebox.PlayOneShotGame("karateman/swingNoHit_Alt");
}
comboIndex++;
AnimPlay("PunchRight");
}
else if (comboNormalizedBeat >= 1.5f && comboIndex < 3)
{
if (hitCombo)
{
currentComboPots[comboPotIndex].Hit();
HitEffectF(currentComboPots[comboPotIndex].Holder.transform.localPosition);
comboPotIndex++;
Jukebox.PlayOneShotGame("karateman/comboHit2");
}
comboIndex++;
AnimPlay("ComboCrouch");
}
else if (comboNormalizedBeat >= 1.75f && comboIndex < 4)
{
if (hitCombo)
{
currentComboPots[comboPotIndex].Hit();
HitEffectF(currentComboPots[comboPotIndex].Holder.transform.localPosition);
comboPotIndex++;
Jukebox.PlayOneShotGame("karateman/comboHit3");
}
else
{
Jukebox.PlayOneShotGame("karateman/comboMiss");
}
comboIndex++;
AnimPlay("ComboKick");
}
else if (comboNormalizedBeat >= 2f && comboIndex < 5)
{
if (hitCombo)
{
currentComboPots[comboPotIndex].Hit();
HitEffectF(currentComboPots[comboPotIndex].Holder.transform.localPosition);
comboPotIndex++;
Jukebox.PlayOneShotGame("karateman/comboHit3");
}
comboIndex++;
AnimPlay("ComboCrouchPunch");
}
else if (comboNormalizedBeat >= 2.05f)
{
if (hitCombo)
{
if (PlayerInput.AltPressedUp())
{
// ComboPow(null);
}
}
else
{
// fail anim
AnimPlay("ComboMiss");
ResetCombo();
}
if (comboNormalizedBeat >= 3.5f && comboIndex < 69)
{
ResetCombo();
AnimPlay("ComboCrouchPunchToIdle");
comboIndex = 69;
}
}
}
else
{
if (!inCombo)
if (PlayerInput.AltPressed())
{
Combo(null);
}
}
if (!hitBarrel)
{
if (PlayerInput.Pressed() && !inCombo)
{
Swing(null);
}
}
for(int i=0;i < shadows.Length; i++)
{
shadows[i].color = KarateMan.instance.GetShadowColor();
}
}
public void Combo(Pot p)
{
if (p == null)
{
comboBeat = Conductor.instance.songPositionInBeats;
hitCombo = false;
}
else
{
comboBeat = p.createBeat;
hitCombo = true;
}
inCombo = true;
}
public void ComboPow(Pot p, bool overrideState = false)
{
if (!hitCombo || !inCombo || !hitCombo && !inCombo) return;
anim.Play("Pow", 0, 0);
/*if (currentComboPots[comboPotIndex].state.perfect)
{
// BarrelDestroy(currentComboPots[comboPotIndex], true);
HitEffectF(currentComboPots[comboPotIndex].Holder.transform.localPosition);
Destroy(currentComboPots[comboPotIndex].gameObject);
Jukebox.PlayOneShotGame("karateman/comboHit4");
}
else
{
Jukebox.PlayOneShot("miss");
currentComboPots[comboPotIndex].Miss();
}*/
if (p != null)
{
if (p.state.perfect || overrideState)
{
p.BarrelDestroy(true);
HitEffectF(p.Holder.transform.localPosition);
Destroy(p.gameObject);
Jukebox.PlayOneShotGame("karateman/comboHit4");
}
else if (p.state.notPerfect())
{
p.Miss();
}
}
ResetCombo();
}
private void ResetCombo()
{
SetHead(0);
hitCombo = false;
inCombo = false;
comboPotIndex = 0;
comboIndex = 0;
currentComboHitInList = 0;
currentComboPots.Clear();
}
public IEnumerator PrepareKick()
{
barrelBeat = Conductor.instance.songPositionInBeats;
hitBarrel = true;
yield return new WaitForSeconds(0.17f);
AnimPlay("KickPrepare");
}
public void ResetKick()
{
if (kickC != null)
{
StopCoroutine(kickC);
}
hitBarrel = false;
}
public void Swing(Pot p)
{
SetHead(0);
bool punchLeft = true;
if (p == null)
{
Jukebox.PlayOneShotGame("karateman/swingNoHit");
}
else
{
if (p.type == 2 || p.type == 3 || p.type == 4 || p.type == 6 || p.type == 999)
{
punchLeft = false;
}
else
{
punchLeft = true;
}
if (p.type == 4)
{
if (kickC != null) StopCoroutine(kickC);
kickC = StartCoroutine(PrepareKick());
}
if (!p.combo)
HitEffectF(HitEffect.transform.localPosition);
}
if (punchLeft)
AnimPlay("PunchLeft");
else
AnimPlay("PunchRight");
}
public void HitEffectF(Vector3 pos)
{
GameObject hit = Instantiate(HitEffect);
hit.transform.parent = HitEffect.transform.parent;
hit.transform.localPosition = pos;
hit.SetActive(true);
Destroy(hit, 0.06f);
}
public void AnimPlay(string name)
{
anim.Play(name, 0, 0);
anim.speed = 1;
}
public void SetHead(int index)
{
head.sprite = heads[index];
}
public IEnumerator Miss()
{
// I couldn't find the sound for this
GameObject miss = Instantiate(missEffect, missEffect.transform.parent);
miss.SetActive(true);
SetHead(2);
yield return new WaitForSeconds(0.08f);
Destroy(miss);
SetHead(0);
}
}
}

View file

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

View file

@ -1,58 +1,41 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HeavenStudio.Util;
//THIS CLASS IS TO BE RENAMED
namespace HeavenStudio.Games.Loaders
{
using static Minigames;
public static class RvlKarateLoader
public static class RvlNewKarateLoader
{
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("karateman", "Karate Man", "70A8D8", false, false, new List<GameAction>()
return new Minigame("karateman", "Karate Man [INDEV REWORK]", "70A8D8", false, false, new List<GameAction>()
{
new GameAction("bop", delegate { KarateMan.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 0.5f, true),
new GameAction("hit", delegate
{
KarateMan.instance.Shoot(eventCaller.currentEntity.beat, eventCaller.currentEntity.type);
}, 2, false, new List<Param>()
{
new Param("type", KarateMan.HitType.Pot, "Object", "The object to fire")
}),
new GameAction("bulb", delegate {
var e = eventCaller.currentEntity;
var c = KarateMan.instance.LightBulbColors[e.type];
if(e.type == (int)KarateMan.LightBulbType.Custom) c = e.colorA;
KarateMan.instance.Shoot(e.beat, 1, tint: c);
}, 2, false, new List<Param>()
{
new Param("type", KarateMan.LightBulbType.Normal, "Type", "The preset bulb type. Yellow is used for kicks while Blue is used for combos"),
new Param("colorA", new Color(), "Custom Color", "The color to use when the bulb type is set to Custom")
}),
new GameAction("kick", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 4); }, 4.5f),
new GameAction("combo", delegate { KarateMan.instance.Combo(eventCaller.currentEntity.beat); }, 4f),
new GameAction("hitX", delegate
{
var e = eventCaller.currentEntity;
switch ((KarateMan.HitThree)e.type)
new GameAction("bop", delegate { }, 0.5f, true),
new GameAction("hit", delegate { var e = eventCaller.currentEntity; KarateMan.instance.CreateItem(e.beat, e.type); }, 2, false,
new List<Param>()
{
case KarateMan.HitThree.HitTwo: KarateMan.instance.Hit2(e.beat); break;
case KarateMan.HitThree.HitThreeAlt: KarateMan.instance.Hit3(e.beat, true); break;
case KarateMan.HitThree.HitFour: KarateMan.instance.Hit4(e.beat); break;
default: KarateMan.instance.Hit3(e.beat); break;
}
}, 1f, false, new List<Param>()
{
new Param("type", KarateMan.HitThree.HitThree, "Type", "What should be called out")
}),
new GameAction("prepare", delegate { KarateMan.instance.Prepare(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 1f, true),
new Param("type", KarateMan.HitType.Pot, "Object", "The object to fire")
}),
new GameAction("bulb", delegate { var e = eventCaller.currentEntity; KarateMan.instance.CreateBulbSpecial(e.beat, e.type, e.colorA); }, 2, false,
new List<Param>()
{
new Param("type", KarateMan.LightBulbType.Normal, "Type", "The preset bulb type. Yellow is used for kicks while Blue is used for combos"),
new Param("colorA", new Color(), "Custom Color", "The color to use when the bulb type is set to Custom")
}),
new GameAction("kick", delegate { }, 4f),
new GameAction("combo", delegate { KarateMan.instance.Combo(eventCaller.currentEntity.beat); }, 4f),
new GameAction("hitX", delegate { var e = eventCaller.currentEntity; KarateMan.instance.DoWord(e.beat, e.type); }, 1f, false,
new List<Param>()
{
new Param("type", KarateMan.HitThree.HitThree, "Type", "The warning text to show")
}),
new GameAction("prepare", delegate { }, 1f, true),
new GameAction("set background effects", delegate {
var e = eventCaller.currentEntity;
var c = KarateMan.instance.BackgroundColors[e.type];
if(e.type == (int)KarateMan.BackgroundType.Custom) c = e.colorA;
KarateMan.instance.SetBackgroundColor(e.type, e.type2, c, e.colorB);
KarateMan.instance.SetBackgroundFX((KarateMan.BackgroundFXType)eventCaller.currentEntity.type3);
}, 0.5f, false, new List<Param>()
{
new Param("type", KarateMan.BackgroundType.Yellow, "Background Type", "The preset background type"),
@ -62,27 +45,38 @@ namespace HeavenStudio.Games.Loaders
new Param("type3", KarateMan.BackgroundFXType.None, "FX Type", "The background effect to be displayed")
}),
// These are still here for backwards-compatibility but are hidden in the editor
new GameAction("pot", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 0); }, 2, hidden: true),
new GameAction("rock", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 2); }, 2, hidden: true),
new GameAction("ball", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 3); }, 2, hidden: true),
new GameAction("tacobell", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 999); }, 2, hidden: true),
new GameAction("hit4", delegate { KarateMan.instance.Hit4(eventCaller.currentEntity.beat); }, hidden: true),
new GameAction("bgfxon", delegate { KarateMan.instance.SetBackgroundFX(KarateMan.BackgroundFXType.Sunburst); }, hidden: true),
new GameAction("bgfxoff", delegate { KarateMan.instance.SetBackgroundFX(KarateMan.BackgroundFXType.None); }, hidden: true),
new GameAction("pot", delegate { KarateMan.instance.CreateItem(eventCaller.currentEntity.beat, (int) KarateMan.HitType.Pot); }, 2, hidden: true),
new GameAction("rock", delegate { KarateMan.instance.CreateItem(eventCaller.currentEntity.beat, (int) KarateMan.HitType.Rock); }, 2, hidden: true),
new GameAction("ball", delegate { KarateMan.instance.CreateItem(eventCaller.currentEntity.beat, (int) KarateMan.HitType.Ball); }, 2, hidden: true),
new GameAction("tacobell", delegate { KarateMan.instance.CreateItem(eventCaller.currentEntity.beat, (int) KarateMan.HitType.TacoBell); }, 2, hidden: true),
new GameAction("hit4", delegate { KarateMan.instance.DoWord(eventCaller.currentEntity.beat, (int) KarateMan.HitThree.HitFour); }, hidden: true),
new GameAction("bgfxon", delegate { }, hidden: true),
new GameAction("bgfxoff", delegate { }, hidden: true),
new GameAction("hit3", delegate { var e = eventCaller.currentEntity; KarateMan.instance.DoWord(e.beat, e.type); }, 1f, false,
new List<Param>()
{
new Param("type", KarateMan.HitThree.HitThree, "Type", "The warning text to show")
},
hidden: true),
new GameAction("set background color", delegate { }, 0.5f, false,
new List<Param>()
{
new Param("type", KarateMan.BackgroundType.Yellow, "Background Type", "The preset background type"),
new Param("type2", KarateMan.ShadowType.Tinted, "Shadow Type", "The shadow type. If Tinted doesn't work with your background color try Custom"),
new Param("colorA", new Color(), "Custom Background Color", "The background color to use when background type is set to Custom"),
new Param("colorB", new Color(), "Custom Shadow Color", "The shadow color to use when shadow type is set to Custom"),
}),
new GameAction("set background fx", delegate {
KarateMan.instance.SetBackgroundFX((KarateMan.BackgroundFXType)eventCaller.currentEntity.type);
}, 0.5f, false, new List<Param>()
{
new Param("type", KarateMan.BackgroundFXType.None, "FX Type", "The background effect to be displayed")
},
hidden: true
)
hidden: true)
});;
});
}
}
}
@ -90,18 +84,18 @@ namespace HeavenStudio.Games.Loaders
namespace HeavenStudio.Games
{
using Scripts_KarateMan;
public class KarateMan : Minigame
{
public static KarateMan instance;
public enum HitType
{
Pot = 0,
Lightbulb = 1,
Rock = 2,
Ball = 3,
CookingPot = 6,
Alien = 7,
TacoBell = 999
}
@ -110,7 +104,11 @@ namespace HeavenStudio.Games
HitTwo,
HitThree,
HitThreeAlt,
HitFour
HitFour,
Grr,
Warning,
Combo,
HitOne,
}
public enum LightBulbType
@ -136,7 +134,8 @@ namespace HeavenStudio.Games
{
None,
Sunburst,
Rings
Rings,
Fade
}
public enum ShadowType
@ -148,81 +147,181 @@ namespace HeavenStudio.Games
public Color[] LightBulbColors;
public Color[] BackgroundColors;
public Color[] ShadowColors;
public static Color ShadowBlendColor = new Color(195f / 255f, 48f / 255f, 2f / 255f);
//camera positions (normal, special)
public Transform[] CameraPosition;
Vector3 cameraPosition;
//pot trajectory stuff
public Transform ItemHolder;
public GameObject Item;
public KarateManJoe Joe;
//warning text
public Animator Word;
float wordClearTime = Single.MinValue;
const float hitVoiceOffset = 0.042f;
public GameObject Pot, Bomb;
public KarateJoe KarateJoe;
public List<Minigame.Eligible> EligibleCombos = new List<Minigame.Eligible>();
public static KarateMan instance { get; set; }
public Sprite[] ObjectSprites;
public Sprite[] BarrelSprites;
public Sprite[] CookingPotSprites;
public Sprite[] OtherSprites;
public List<BGSpriteC> BGSprites;
public SpriteRenderer BGSprite;
public SpriteRenderer BGFXSprite;
public BackgroundType BGType = BackgroundType.Yellow;
public BackgroundFXType BGFXType = BackgroundFXType.None;
public Color BGColor;
public ShadowType Shadow = ShadowType.Tinted;
public Color ShadowColor = Color.black;
private float newBeat;
public GameEvent bop = new GameEvent();
public GameEvent prepare = new GameEvent();
private float bgBeat;
public ParticleSystem potHitEffect;
public GameObject comboRef;
public GameObject HIT3Ref;
public Sprite[] Numbers;
[System.Serializable]
public class BGSpriteC
{
public List<Sprite> Sprites;
}
private void Awake()
{
instance = this;
BGType = 0;
BGColor = BackgroundColors[0];
Shadow = 0;
KarateManPot.ResetLastCombo();
cameraPosition = CameraPosition[0].position;
}
public override void OnGameSwitch(float beat)
private void Start()
{
base.OnGameSwitch(beat);
SetBackgroundColor((int)BGType, (int)Shadow, BGColor, ShadowColor);
GameCamera.additionalPosition = cameraPosition - GameCamera.defaultPosition;
}
private void Update()
{
GameCamera.additionalPosition = cameraPosition - GameCamera.defaultPosition;
if (Conductor.instance.songPositionInBeats >= wordClearTime)
{
Word.Play("NoPose");
}
}
public void DoWord(float beat, int type)
{
switch (type)
{
case (int) HitThree.HitTwo:
Word.Play("Word02");
wordClearTime = beat + 4f;
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("karateman/hit", beat + 0.5f, offset: hitVoiceOffset),
new MultiSound.Sound("karateman/two", beat + 1f),
}, forcePlay: true);
break;
case (int) HitThree.HitThree:
Word.Play("Word03");
wordClearTime = beat + 4f;
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("karateman/hit", beat + 0.5f, offset: hitVoiceOffset),
new MultiSound.Sound("karateman/three", beat + 1f),
}, forcePlay: true);
break;
case (int) HitThree.HitThreeAlt:
Word.Play("Word03");
wordClearTime = beat + 4f;
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("karateman/hitAlt", beat + 0.5f, offset: hitVoiceOffset),
new MultiSound.Sound("karateman/threeAlt", beat + 1f),
}, forcePlay: true);
break;
case (int) HitThree.HitFour:
Word.Play("Word04");
wordClearTime = beat + 4f;
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("karateman/hit", beat + 0.5f, offset: hitVoiceOffset),
new MultiSound.Sound("karateman/four", beat + 1f),
}, forcePlay: true);
break;
case (int) HitThree.Grr:
Word.Play("Word01");
wordClearTime = beat + 1f;
break;
case (int) HitThree.Warning:
Word.Play("Word05");
wordClearTime = beat + 1f;
break;
case (int) HitThree.Combo:
Word.Play("Word00");
wordClearTime = beat + 3f;
break;
case (int) HitThree.HitOne: //really?
Word.Play("Word06");
wordClearTime = beat + 4f;
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("karateman/hit", beat + 0.5f, offset: hitVoiceOffset),
new MultiSound.Sound("karateman/one", beat + 1f),
}, forcePlay: true);
break;
}
}
public void CreateItem(float beat, int type)
{
string outSound;
if (Starpelly.Mathp.GetDecimalFromFloat(beat + 0.5f) == 0f)
outSound = "karateman/offbeatObjectOut";
else
outSound = "karateman/objectOut";
switch (type)
{
case (int) HitType.Pot:
CreateItemInstance(beat, "Item00");
break;
case (int) HitType.Lightbulb:
if (Starpelly.Mathp.GetDecimalFromFloat(beat + 0.5f) == 0f)
outSound = "karateman/offbeatLightbulbOut";
else
outSound = "karateman/lightbulbOut";
var mobj = CreateItemInstance(beat, "Item01", KarateManPot.ItemType.Bulb);
mobj.GetComponent<KarateManPot>().SetBulbColor(LightBulbColors[0]);
break;
case (int) HitType.Rock:
CreateItemInstance(beat, "Item02", KarateManPot.ItemType.Rock);
break;
case (int) HitType.Ball:
CreateItemInstance(beat, "Item03", KarateManPot.ItemType.Ball);
break;
case (int) HitType.CookingPot:
CreateItemInstance(beat, "Item06", KarateManPot.ItemType.Cooking);
break;
case (int) HitType.Alien:
CreateItemInstance(beat, "Item07", KarateManPot.ItemType.Alien);
break;
case (int) HitType.TacoBell:
CreateItemInstance(beat, "Item99", KarateManPot.ItemType.TacoBell);
break;
default:
CreateItemInstance(beat, "Item00");
break;
}
Jukebox.PlayOneShotGame(outSound, forcePlay: true);
}
public void CreateBulbSpecial(float beat, int type, Color c)
{
string outSound;
if (Starpelly.Mathp.GetDecimalFromFloat(beat + 0.5f) == 0f)
outSound = "karateman/offbeatLightbulbOut";
else
outSound = "karateman/lightbulbOut";
var mobj = CreateItemInstance(beat, "Item01", KarateManPot.ItemType.Bulb);
if (type == (int) LightBulbType.Custom)
mobj.GetComponent<KarateManPot>().SetBulbColor(c);
else
mobj.GetComponent<KarateManPot>().SetBulbColor(LightBulbColors[type]);
Jukebox.PlayOneShotGame(outSound, forcePlay: true);
}
public void Combo(float beat)
{
comboRef.GetComponent<Animator>().enabled = true;
comboRef.GetComponent<Animator>().Play("comboRef");
Jukebox.PlayOneShotGame("karateman/barrelOutCombos");
Jukebox.PlayOneShotGame("karateman/barrelOutCombos", forcePlay: true);
Shoot(beat, 0, true, "PotCombo1", 0, new Vector2(-0.94f, -2.904f));
Shoot(beat + 0.25f, 0, true, "PotCombo2", 1, new Vector2(-0.94f, -2.904f));
Shoot(beat + 0.5f, 0, true, "PotCombo3", 2, new Vector2(-0.776f, -3.162f));
Shoot(beat + 0.75f, 0, true, "PotCombo4", 3, new Vector2(1.453f, -3.162f));
Shoot(beat + 1f, 0, true, "PotCombo5", 4, new Vector2(0.124f, -3.123f));
Shoot(beat + 1.5f, 4, true, "PotCombo6", 5, new Vector2(-1.333f, -2.995f));
int comboId = KarateManPot.GetNewCombo();
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { CreateItemInstance(beat, "Item00", KarateManPot.ItemType.ComboPot1, comboId); }),
new BeatAction.Action(beat + 0.25f, delegate { CreateItemInstance(beat + 0.25f, "Item00", KarateManPot.ItemType.ComboPot2, comboId); }),
new BeatAction.Action(beat + 0.5f, delegate { CreateItemInstance(beat + 0.5f, "Item00", KarateManPot.ItemType.ComboPot3, comboId); }),
new BeatAction.Action(beat + 0.75f, delegate { CreateItemInstance(beat + 0.75f, "Item00", KarateManPot.ItemType.ComboPot4, comboId); }),
new BeatAction.Action(beat + 1f, delegate { CreateItemInstance(beat + 1f, "Item00", KarateManPot.ItemType.ComboPot5, comboId); }),
new BeatAction.Action(beat + 1.5f, delegate { CreateItemInstance(beat + 1.5f, "Item05", KarateManPot.ItemType.ComboBarrel, comboId); }),
});
MultiSound.Play(new MultiSound.Sound[]
{
@ -232,267 +331,21 @@ namespace HeavenStudio.Games
new MultiSound.Sound("karateman/punchy4", beat + 1.75f),
new MultiSound.Sound("karateman/ko", beat + 2f),
new MultiSound.Sound("karateman/pow", beat + 2.5f)
});
}, forcePlay: true);
}
public void Shoot(float beat, int type, bool combo = false, string throwAnim = "", int comboIndex = 0, Vector2 endShadowPos = new Vector2(), UnityEngine.Color tint = default)
GameObject CreateItemInstance(float beat, string awakeAnim, KarateManPot.ItemType type = KarateManPot.ItemType.Pot, int comboId = -1)
{
GameObject pot = Instantiate(Pot);
pot.transform.parent = Pot.transform.parent;
GameObject mobj = GameObject.Instantiate(Item, ItemHolder);
KarateManPot mobjDat = mobj.GetComponent<KarateManPot>();
mobjDat.type = type;
mobjDat.startBeat = beat;
mobjDat.awakeAnim = awakeAnim;
mobjDat.comboId = comboId;
if (KarateJoe.instance.anim.IsAnimationNotPlaying())
KarateJoe.instance.SetHead(0);
Pot p = pot.GetComponent<Pot>();
pot.SetActive(true);
p.startBeat = beat;
p.createBeat = beat;
p.isThrown = true;
p.type = type;
if(type <= ObjectSprites.Length)
p.Sprite.GetComponent<SpriteRenderer>().sprite = ObjectSprites[type];
if (combo)
{
p.comboIndex = comboIndex;
p.throwAnim = throwAnim;
p.combo = true;
KarateJoe.currentComboPots.Add(p);
p.endShadowThrowPos = endShadowPos;
}
else
{
p.throwAnim = "PotThrow";
string outSnd = "";
switch (type)
{
case 0:
if (Starpelly.Mathp.GetDecimalFromFloat(beat) == 0f)
outSnd = "karateman/objectOut";
else
outSnd = "karateman/offbeatObjectOut";
p.hitSnd = "karateman/potHit";
break;
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)
outSnd = "karateman/objectOut";
else
outSnd = "karateman/offbeatObjectOut";
p.hitSnd = "karateman/rockHit";
break;
case 3:
if (Starpelly.Mathp.GetDecimalFromFloat(beat) == 0f)
outSnd = "karateman/objectOut";
else
outSnd = "karateman/offbeatObjectOut";
p.hitSnd = "karateman/soccerHit";
break;
case 4:
p.kick = true;
outSnd = "karateman/barrelOutKicks";
p.hitSnd = "karateman/barrelBreak";
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("karateman/punchKick1", beat + 1f),
new MultiSound.Sound("karateman/punchKick2", beat + 1.5f),
new MultiSound.Sound("karateman/punchKick3", beat + 1.75f),
new MultiSound.Sound("karateman/punchKick4", beat + 2.25f)
});
break;
case 6:
if (Starpelly.Mathp.GetDecimalFromFloat(beat) == 0f)
outSnd = "karateman/objectOut";
else
outSnd = "karateman/offbeatObjectOut";
p.hitSnd = "karateman/cookingPot";
break;
case 7:
if (Starpelly.Mathp.GetDecimalFromFloat(beat) == 0f)
outSnd = "karateman/objectOut";
else
outSnd = "karateman/offbeatObjectOut";
p.hitSnd = "karateman/alienHit";
break;
case 999:
p.Sprite.GetComponent<SpriteRenderer>().sprite = OtherSprites[0];
if (Starpelly.Mathp.GetDecimalFromFloat(beat) == 0f)
outSnd = "karateman/objectOut";
else
outSnd = "karateman/offbeatObjectOut";
p.hitSnd = "karateman/tacobell";
break;
}
p.endShadowThrowPos = new Vector2(-1.036f, -2.822f);
Jukebox.PlayOneShotGame(outSnd);
}
p.Init();
}
List<Beatmap.Entity> cuedVoices = new List<Beatmap.Entity>(); // "Hit" voices cued in advance are stored here so they aren't called multiple times in Update().
private void Update()
{
if (Conductor.instance.ReportBeat(ref newBeat))
{
if (BGFXSprite.enabled)
{
var type = (int)BGFXType - 1;
if (bgBeat % 2 == 0)
{
BGFXSprite.sprite = BGSprites[type].Sprites[0];
}
else
{
BGFXSprite.sprite = BGSprites[type].Sprites[1];
}
bgBeat++;
}
}
if (Conductor.instance.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
{
if (Conductor.instance.songPositionInBeats >= bop.startBeat && Conductor.instance.songPositionInBeats < bop.startBeat + bop.length)
{
if (KarateJoe.anim.IsAnimationNotPlaying())
KarateJoe.anim.Play("Bop", 0, 0);
}
}
if (prepare.length > 0)
{
if (Conductor.instance.songPositionInBeats >= prepare.startBeat && Conductor.instance.songPositionInBeats < prepare.startBeat + prepare.length)
{
if (KarateJoe.anim.IsAnimationNotPlaying())
KarateJoe.AnimPlay("Prepare");
}
else
{
KarateJoe.AnimPlay("Idle");
prepare.length = 0;
}
}
if (!Conductor.instance.isPlaying)
return;
// Call "hit" voice slightly early to account for sound offset.
var hitVoiceEvents = GameManager.instance.Beatmap.entities.FindAll(c => c.datamodel == "karateman/hit3" || c.datamodel == "karateman/hit4");
for (int i = 0; i < hitVoiceEvents.Count; i++)
{
var hitEvent = hitVoiceEvents[i];
var timeToEvent = hitEvent.beat - Conductor.instance.songPositionInBeats;
if (timeToEvent <= 1f && timeToEvent > 0f && !cuedVoices.Contains(hitEvent))
{
cuedVoices.Add(hitEvent);
var sound = "karateman/hit";
if (hitEvent.type == (int)KarateMan.HitThree.HitThreeAlt) sound += "Alt";
MultiSound.Play(new MultiSound.Sound[] { new MultiSound.Sound(sound, hitEvent.beat - hitVoiceOffset * Conductor.instance.songBpm / 60f) });
}
}
}
public void SetBackgroundFX(BackgroundFXType type)
{
BGFXType = type;
if (BGFXType == BackgroundFXType.None)
{
BGFXSprite.enabled = false;
}
else
{
BGFXSprite.enabled = true;
BGFXSprite.sprite = BGSprites[(int)type - 1].Sprites[0];
}
}
public void SetBackgroundColor(int type, int shadowType, Color backgroundColor, Color shadowColor)
{
BGType = (BackgroundType)type;
BGColor = backgroundColor;
BGSprite.color = backgroundColor;
Shadow = (ShadowType)shadowType;
ShadowColor = shadowColor;
}
public void Bop(float beat, float length)
{
bop.length = length;
bop.startBeat = beat;
}
public void Hit2(float beat)
{
MultiSound.Play(new MultiSound.Sound[] { new MultiSound.Sound("karateman/two", beat + 0.5f) });
}
public void Hit3(float beat, bool alt = false)
{
var sound = "karateman/three";
if (alt) sound += "Alt";
MultiSound.Play(new MultiSound.Sound[] { new MultiSound.Sound(sound, beat + 0.5f) });
GameObject hit3 = Instantiate(HIT3Ref, this.transform);
hit3.transform.GetChild(0).GetChild(1).GetComponent<SpriteRenderer>().sprite = Numbers[2];
BeatAction.New(hit3, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.5f, delegate { hit3.transform.GetChild(0).gameObject.SetActive(true); }),
new BeatAction.Action(beat + 4.5f, delegate { Destroy(hit3); })
});
}
public void Hit4(float beat)
{
MultiSound.Play(new MultiSound.Sound[] { new MultiSound.Sound("karateman/four", beat + 0.5f) });
GameObject hit4 = Instantiate(HIT3Ref, this.transform);
hit4.transform.GetChild(0).GetChild(1).GetComponent<SpriteRenderer>().sprite = Numbers[3];
BeatAction.New(hit4, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.5f, delegate { hit4.transform.GetChild(0).gameObject.SetActive(true); }),
new BeatAction.Action(beat + 4.5f, delegate { Destroy(hit4); })
});
}
public void Prepare(float beat, float length)
{
prepare.startBeat = beat;
prepare.length = length;
}
public void CreateBomb(Transform parent, Vector2 scale, ref GameObject shadow)
{
GameObject bomb = Instantiate(Bomb, parent);
bomb.SetActive(true);
bomb.transform.localScale = scale;
shadow.transform.parent = bomb.transform;
shadow.transform.SetAsLastSibling();
bomb.GetComponent<Bomb>().shadow = shadow;
}
public Color GetShadowColor()
{
if(Shadow == ShadowType.Custom)
{
return ShadowColor;
}
else if(BGType < BackgroundType.Custom)
{
return ShadowColors[(int)BGType];
}
mobj.SetActive(true);
return Color.LerpUnclamped(BGColor, ShadowBlendColor, 0.45f);
return mobj;
}
}
}

View file

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: f7c69b76f8c0a85489aa15813dfef687
guid: af41fb607b88d8644b683298f8fcaf54
MonoImporter:
externalObjects: {}
serializedVersion: 2

View file

@ -8,7 +8,7 @@ using HeavenStudio.Util;
namespace HeavenStudio.Games.Scripts_KarateMan
{
public class KarateManJoeNew : MonoBehaviour
public class KarateManJoe : MonoBehaviour
{
public Animator anim;
public GameEvent bop = new GameEvent();
@ -17,6 +17,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
float lastComboMissTime = Single.MinValue;
float lastUpperCutTime = Single.MinValue;
public bool inCombo = false;
public bool lockedInCombo = false;
int inComboId = -1;
int shouldComboId = -1;
public void SetComboId(int id) { inComboId = id; }
@ -57,7 +58,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
if (PlayerInput.Pressed(true) && !inCombo)
{
if (!KarateManNew.instance.IsExpectingInputNow())
if (!KarateMan.instance.IsExpectingInputNow())
{
Punch(1);
Jukebox.PlayOneShotGame("karateman/swingNoHit", forcePlay: true);
@ -65,7 +66,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
}
else if (PlayerInput.AltPressed() && !inCombo)
{
if (!KarateManNew.instance.IsExpectingInputNow())
if (!KarateMan.instance.IsExpectingInputNow())
{
//start a forced-fail combo sequence
ForceFailCombo(cond.songPositionInBeats);
@ -73,9 +74,9 @@ namespace HeavenStudio.Games.Scripts_KarateMan
}
else if (PlayerInput.AltPressedUp())
{
if (!KarateManNew.instance.IsExpectingInputNow())
if (!KarateMan.instance.IsExpectingInputNow())
{
if (inComboId != -1 && !KarateManNew.instance.IsExpectingInputNow())
if (inComboId != -1 && !lockedInCombo)
{
inComboId = -1;
}
@ -85,6 +86,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
public bool Punch(int forceHand = 0)
{
if (GameManager.instance.currentGame != "karateman") return false;
var cond = Conductor.instance;
bool straight = false;
switch (forceHand)
@ -116,6 +118,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
public void ComboSequence(int seq)
{
if (GameManager.instance.currentGame != "karateman") return;
var cond = Conductor.instance;
bop.startBeat = cond.songPositionInBeats + 1f;
switch (seq)
@ -131,10 +134,12 @@ namespace HeavenStudio.Games.Scripts_KarateMan
break;
case 3:
anim.DoScaledAnimationAsync("UpperCut", 0.5f);
lockedInCombo = false;
break;
case 4:
anim.Play("ToReady", -1, 0);
bop.startBeat = cond.songPositionInBeats + 0.5f;
lockedInCombo = false;
break;
default:
break;
@ -148,12 +153,6 @@ namespace HeavenStudio.Games.Scripts_KarateMan
bop.startBeat = beat + 3f;
}
public void ComboEnd(float beat, bool miss = false)
{
var cond = Conductor.instance;
bop.startBeat = cond.songPositionInBeats + 1f;
}
public void ForceFailCombo(float beat)
{
if (inCombo) return;

View file

@ -1,275 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HeavenStudio.Util;
//THIS CLASS IS TO BE RENAMED
namespace HeavenStudio.Games.Loaders
{
using static Minigames;
public static class RvlNewKarateLoader
{
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("karateManNew", "Karate Man [INDEV REWORK]", "70A8D8", false, false, new List<GameAction>()
{
new GameAction("bop", delegate { }, 0.5f, true),
new GameAction("hit", delegate { var e = eventCaller.currentEntity; KarateManNew.instance.CreateItem(e.beat, e.type); }, 2, false,
new List<Param>()
{
new Param("type", KarateManNew.HitType.Pot, "Object", "The object to fire")
}),
new GameAction("bulb", delegate { var e = eventCaller.currentEntity; KarateManNew.instance.CreateBulbSpecial(e.beat, e.type, e.colorA); }, 2, false,
new List<Param>()
{
new Param("type", KarateManNew.LightBulbType.Normal, "Type", "The preset bulb type. Yellow is used for kicks while Blue is used for combos"),
new Param("colorA", new Color(), "Custom Color", "The color to use when the bulb type is set to Custom")
}),
new GameAction("kick", delegate { }, 4.5f),
new GameAction("combo", delegate { var e = eventCaller.currentEntity; KarateManNew.instance.Combo(e.beat); }, 4f),
new GameAction("hitX", delegate { }, 1f, false,
new List<Param>()
{
new Param("type", KarateManNew.HitThree.HitThree, "Type", "What should be called out")
}),
new GameAction("prepare", delegate { }, 1f, true),
new GameAction("set background effects", delegate {
}, 0.5f, false, new List<Param>()
{
new Param("type", KarateMan.BackgroundType.Yellow, "Background Type", "The preset background type"),
new Param("type2", KarateMan.ShadowType.Tinted, "Shadow Type", "The shadow type. If Tinted doesn't work with your background color try Custom"),
new Param("colorA", new Color(), "Custom Background Color", "The background color to use when background type is set to Custom"),
new Param("colorB", new Color(), "Custom Shadow Color", "The shadow color to use when shadow type is set to Custom"),
new Param("type3", KarateMan.BackgroundFXType.None, "FX Type", "The background effect to be displayed")
}),
// These are still here for backwards-compatibility but are hidden in the editor
new GameAction("pot", delegate { }, 2, hidden: true),
new GameAction("rock", delegate { }, 2, hidden: true),
new GameAction("ball", delegate { }, 2, hidden: true),
new GameAction("tacobell", delegate { }, 2, hidden: true),
new GameAction("hit4", delegate { }, hidden: true),
new GameAction("bgfxon", delegate { }, hidden: true),
new GameAction("bgfxoff", delegate { }, hidden: true),
new GameAction("hit3", delegate { }, 1f, false,
new List<Param>()
{
new Param("type", KarateManNew.HitThree.HitThree, "Type", "What should be called out")
},
hidden: true),
new GameAction("set background color", delegate { }, 0.5f, false,
new List<Param>()
{
new Param("type", KarateManNew.BackgroundType.Yellow, "Background Type", "The preset background type"),
new Param("type2", KarateManNew.ShadowType.Tinted, "Shadow Type", "The shadow type. If Tinted doesn't work with your background color try Custom"),
new Param("colorA", new Color(), "Custom Background Color", "The background color to use when background type is set to Custom"),
new Param("colorB", new Color(), "Custom Shadow Color", "The shadow color to use when shadow type is set to Custom"),
}),
new GameAction("set background fx", delegate {
}, 0.5f, false, new List<Param>()
{
new Param("type", KarateMan.BackgroundFXType.None, "FX Type", "The background effect to be displayed")
},
hidden: true)
});
}
}
}
namespace HeavenStudio.Games
{
using Scripts_KarateMan;
public class KarateManNew : Minigame
{
public static KarateManNew instance;
public enum HitType
{
Pot = 0,
Lightbulb = 1,
Rock = 2,
Ball = 3,
CookingPot = 6,
Alien = 7,
TacoBell = 999
}
public enum HitThree
{
HitTwo,
HitThree,
HitThreeAlt,
HitFour,
Grr,
Warning,
HitOne,
}
public enum LightBulbType
{
Normal,
Blue,
Yellow,
Custom
}
public enum BackgroundType
{
Yellow,
Fuchsia,
Blue,
Red,
Orange,
Pink,
Custom
}
public enum BackgroundFXType
{
None,
Sunburst,
Rings,
Fade
}
public enum ShadowType
{
Tinted,
Custom
}
public Color[] LightBulbColors;
public Color[] BackgroundColors;
public Color[] ShadowColors;
//camera positions (normal, special)
public Transform[] CameraPosition;
Vector3 cameraPosition;
//pot trajectory stuff
public Transform ItemHolder;
public GameObject Item;
public KarateManJoeNew Joe;
private void Awake()
{
instance = this;
KarateManPotNew.ResetLastCombo();
cameraPosition = CameraPosition[1].position;
}
private void Start()
{
GameCamera.additionalPosition = cameraPosition - GameCamera.defaultPosition;
}
private void Update()
{
GameCamera.additionalPosition = cameraPosition - GameCamera.defaultPosition;
}
public void CreateItem(float beat, int type)
{
string outSound;
if (Starpelly.Mathp.GetDecimalFromFloat(beat + 0.5f) == 0f)
outSound = "karateman/offbeatObjectOut";
else
outSound = "karateman/objectOut";
switch (type)
{
case (int) HitType.Pot:
CreateItemInstance(beat, "Item00");
break;
case (int) HitType.Lightbulb:
if (Starpelly.Mathp.GetDecimalFromFloat(beat + 0.5f) == 0f)
outSound = "karateman/offbeatLightbulbOut";
else
outSound = "karateman/lightbulbOut";
CreateItemInstance(beat, "Item01", KarateManPotNew.ItemType.Bulb);
break;
case (int) HitType.Rock:
CreateItemInstance(beat, "Item02", KarateManPotNew.ItemType.Rock);
break;
case (int) HitType.Ball:
CreateItemInstance(beat, "Item03", KarateManPotNew.ItemType.Ball);
break;
case (int) HitType.CookingPot:
CreateItemInstance(beat, "Item06", KarateManPotNew.ItemType.Cooking);
break;
case (int) HitType.Alien:
CreateItemInstance(beat, "Item07", KarateManPotNew.ItemType.Alien);
break;
case (int) HitType.TacoBell:
CreateItemInstance(beat, "Item99", KarateManPotNew.ItemType.TacoBell);
break;
default:
CreateItemInstance(beat, "Item00");
break;
}
Jukebox.PlayOneShotGame(outSound, forcePlay: true);
}
public void CreateBulbSpecial(float beat, int type, Color c)
{
string outSound;
if (Starpelly.Mathp.GetDecimalFromFloat(beat + 0.5f) == 0f)
outSound = "karateman/offbeatLightbulbOut";
else
outSound = "karateman/lightbulbOut";
var mobj = CreateItemInstance(beat, "Item01", KarateManPotNew.ItemType.Bulb);
if (type == (int) LightBulbType.Custom)
mobj.GetComponent<KarateManPotNew>().SetBulbColor(c);
else
mobj.GetComponent<KarateManPotNew>().SetBulbColor(LightBulbColors[type]);
Jukebox.PlayOneShotGame(outSound, forcePlay: true);
}
public void Combo(float beat)
{
Jukebox.PlayOneShotGame("karateman/barrelOutCombos", forcePlay: true);
int comboId = KarateManPotNew.GetNewCombo();
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { CreateItemInstance(beat, "Item00", KarateManPotNew.ItemType.ComboPot1, comboId); }),
new BeatAction.Action(beat + 0.25f, delegate { CreateItemInstance(beat + 0.25f, "Item00", KarateManPotNew.ItemType.ComboPot2, comboId); }),
new BeatAction.Action(beat + 0.5f, delegate { CreateItemInstance(beat + 0.5f, "Item00", KarateManPotNew.ItemType.ComboPot3, comboId); }),
new BeatAction.Action(beat + 0.75f, delegate { CreateItemInstance(beat + 0.75f, "Item00", KarateManPotNew.ItemType.ComboPot4, comboId); }),
new BeatAction.Action(beat + 1f, delegate { CreateItemInstance(beat + 1f, "Item00", KarateManPotNew.ItemType.ComboPot5, comboId); }),
new BeatAction.Action(beat + 1.5f, delegate { CreateItemInstance(beat + 1.5f, "Item05", KarateManPotNew.ItemType.ComboBarrel, comboId); }),
});
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("karateman/punchy1", beat + 1f),
new MultiSound.Sound("karateman/punchy2", beat + 1.25f),
new MultiSound.Sound("karateman/punchy3", beat + 1.5f),
new MultiSound.Sound("karateman/punchy4", beat + 1.75f),
new MultiSound.Sound("karateman/ko", beat + 2f),
new MultiSound.Sound("karateman/pow", beat + 2.5f)
}, forcePlay: true);
}
GameObject CreateItemInstance(float beat, string awakeAnim, KarateManPotNew.ItemType type = KarateManPotNew.ItemType.Pot, int comboId = -1)
{
GameObject mobj = GameObject.Instantiate(Item, ItemHolder);
KarateManPotNew mobjDat = mobj.GetComponent<KarateManPotNew>();
mobjDat.type = type;
mobjDat.startBeat = beat;
mobjDat.awakeAnim = awakeAnim;
mobjDat.comboId = comboId;
mobj.SetActive(true);
return mobj;
}
}
}

View file

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

View file

@ -6,7 +6,7 @@ using HeavenStudio.Util;
namespace HeavenStudio.Games.Scripts_KarateMan
{
public class KarateManPotNew : PlayerActionObject
public class KarateManPot : PlayerActionObject
{
public float startBeat;
public ItemType type;
@ -101,8 +101,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan
switch (type)
{
case ItemType.ComboPot1:
KarateManNew.instance.ScheduleInput(startBeat, 1f, InputType.STANDARD_ALT_DOWN, ComboStartJustOrNg, ComboStartThrough, ComboStartOut);
KarateManNew.instance.ScheduleUserInput(startBeat, 1f, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, ComboStartWrongAction, ComboStartOut, ComboStartOut);
KarateMan.instance.ScheduleInput(startBeat, 1f, InputType.STANDARD_ALT_DOWN, ComboStartJustOrNg, ComboStartThrough, ComboStartOut);
KarateMan.instance.ScheduleUserInput(startBeat, 1f, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, ComboStartWrongAction, ComboStartOut, ComboStartOut);
path = 1;
break;
case ItemType.ComboPot2:
@ -124,15 +124,15 @@ namespace HeavenStudio.Games.Scripts_KarateMan
break;
case ItemType.ComboBarrel:
//check for button release
KarateManNew.instance.ScheduleInput(startBeat, 1f, InputType.STANDARD_ALT_UP, ComboEndJustOrNg, ComboEndThrough, ComboEndOut);
KarateMan.instance.ScheduleInput(startBeat, 1f, InputType.STANDARD_ALT_UP, ComboEndJustOrNg, ComboEndThrough, ComboEndOut);
//button presses
KarateManNew.instance.ScheduleUserInput(startBeat, 1f, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, ComboEndWrongAction, ItemOut, ItemOut);
KarateManNew.instance.ScheduleUserInput(startBeat, 1f, InputType.STANDARD_ALT_DOWN, ComboEndWrongActionAlt, ItemOut, ItemOut);
KarateMan.instance.ScheduleUserInput(startBeat, 1f, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, ComboEndWrongAction, ItemOut, ItemOut);
KarateMan.instance.ScheduleUserInput(startBeat, 1f, InputType.STANDARD_ALT_DOWN, ComboEndWrongActionAlt, ItemOut, ItemOut);
path = 5;
break;
default:
KarateManNew.instance.ScheduleInput(startBeat, 1f, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, ItemJustOrNg, ItemThrough, ItemOut);
KarateManNew.instance.ScheduleUserInput(startBeat, 1f, InputType.STANDARD_ALT_DOWN, ItemWrongAction, ItemOut, ItemOut);
KarateMan.instance.ScheduleInput(startBeat, 1f, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, ItemJustOrNg, ItemThrough, ItemOut);
KarateMan.instance.ScheduleUserInput(startBeat, 1f, InputType.STANDARD_ALT_DOWN, ItemWrongAction, ItemOut, ItemOut);
path = 1;
comboId = -1;
break;
@ -145,7 +145,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
mobjAnim.Play(awakeAnim, -1, 0);
transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z + (-360f * Time.deltaTime) + UnityEngine.Random.Range(0f, 360f));
ShadowInstance = GameObject.Instantiate(Shadow, KarateManNew.instance.ItemHolder);
ShadowInstance = GameObject.Instantiate(Shadow, KarateMan.instance.ItemHolder);
ShadowInstance.SetActive(true);
ShadowInstance.transform.position = new Vector3(transform.position.x, floorHeight - 0.5f, transform.position.z);
}
@ -255,7 +255,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan
void JoeComboSequence()
{
var joe = KarateManNew.instance.Joe;
if (GameManager.instance.currentGame != "karateman") return;
var joe = KarateMan.instance.Joe;
if (joe.GetShouldComboId() != comboId || !joe.inCombo) return;
switch (type)
{
@ -286,6 +287,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
else
{
joe.ComboSequence(1);
joe.lockedInCombo = true;
ItemHitEffect();
}
break;
@ -304,7 +306,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan
public void ItemJustOrNg(PlayerActionEvent caller, float state)
{
var joe = KarateManNew.instance.Joe;
if (GameManager.instance.currentGame != "karateman") return;
var joe = KarateMan.instance.Joe;
if (status == FlyStatus.Fly && !joe.inCombo) {
joe.Punch(ItemPunchHand());
if (state <= -1f || state >= 1f) {
@ -320,9 +323,10 @@ namespace HeavenStudio.Games.Scripts_KarateMan
public void ItemWrongAction(PlayerActionEvent caller, float state)
{
if (GameManager.instance.currentGame != "karateman") return;
//hitting a normal object with the alt input
//WHEN SCORING THIS IS A MISS
var joe = KarateManNew.instance.Joe;
var joe = KarateMan.instance.Joe;
if (status == FlyStatus.Fly && !joe.inCombo) {
joe.ForceFailCombo(Conductor.instance.songPositionInBeats);
if (state <= -1f || state >= 1f) {
@ -339,6 +343,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
public void ItemThrough(PlayerActionEvent caller)
{
if (GameManager.instance.currentGame != "karateman") return;
if (status != FlyStatus.Fly || gameObject == null) return;
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
@ -351,7 +356,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan
public void ComboStartJustOrNg(PlayerActionEvent caller, float state)
{
var joe = KarateManNew.instance.Joe;
if (GameManager.instance.currentGame != "karateman") return;
var joe = KarateMan.instance.Joe;
if (status == FlyStatus.Fly && !joe.inCombo) {
joe.inCombo = true;
joe.Punch(1);
@ -375,9 +381,10 @@ namespace HeavenStudio.Games.Scripts_KarateMan
public void ComboStartWrongAction(PlayerActionEvent caller, float state)
{
if (GameManager.instance.currentGame != "karateman") return;
//hitting a combo start with the normal input
//WHEN SCORING THIS IS A MISS
var joe = KarateManNew.instance.Joe;
var joe = KarateMan.instance.Joe;
if (status == FlyStatus.Fly && !joe.inCombo) {
joe.Punch(ItemPunchHand());
if (state <= -1f || state >= 1f) {
@ -392,7 +399,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan
public void ComboEndJustOrNg(PlayerActionEvent caller, float state)
{
var joe = KarateManNew.instance.Joe;
if (GameManager.instance.currentGame != "karateman") return;
var joe = KarateMan.instance.Joe;
if (status == FlyStatus.Fly && joe.inCombo && joe.GetComboId() == comboId) {
joe.inCombo = false;
joe.SetComboId(-1);
@ -411,8 +419,9 @@ namespace HeavenStudio.Games.Scripts_KarateMan
public void ComboEndOut(PlayerActionEvent caller) {}
public void ComboEndThrough(PlayerActionEvent caller)
{
if (GameManager.instance.currentGame != "karateman") return;
if (status != FlyStatus.Fly || gameObject == null) return;
var joe = KarateManNew.instance.Joe;
var joe = KarateMan.instance.Joe;
if (joe.GetComboId() != comboId || !joe.inCombo) return;
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
@ -427,12 +436,14 @@ namespace HeavenStudio.Games.Scripts_KarateMan
public void ComboEndWrongAction(PlayerActionEvent caller, float state)
{
KarateManNew.instance.Joe.Punch(1);
if (GameManager.instance.currentGame != "karateman") return;
KarateMan.instance.Joe.Punch(1);
}
public void ComboEndWrongActionAlt(PlayerActionEvent caller, float state)
{
KarateManNew.instance.Joe.ForceFailCombo(Conductor.instance.songPositionInBeats);
if (GameManager.instance.currentGame != "karateman") return;
KarateMan.instance.Joe.ForceFailCombo(Conductor.instance.songPositionInBeats);
}
}
}

View file

@ -1,417 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HeavenStudio.Util;
namespace HeavenStudio.Games.Scripts_KarateMan
{
public class Pot : PlayerActionObject
{
public float startBeat;
public float createBeat;
[HideInInspector] public Animator anim;
public GameObject Holder;
private GameObject newHolder;
public GameObject Sprite;
public GameObject BulbLightSprite;
public GameObject CookingPotLid;
private SpriteRenderer spriteComp;
public GameObject Shadow;
private SpriteRenderer shadowSpriteComp;
private SpriteRenderer bulbLightSpriteComp;
public bool isThrown;
public bool isHit = false;
public float hitBeat;
private Vector3 lastPos;
private float lastShadowX;
public AnimationCurve hitCurve;
public AnimationCurve hitCurveY;
public AnimationCurve hitCurveX;
public AnimationCurve missCurve;
public AnimationCurve shadowCurve;
public AnimationCurve shadowCurveScale;
public int type;
public string hitSnd;
private float hitLength;
private float lastRot;
public bool kick;
public float lastPotRot;
public string throwAnim;
public bool combo;
public int comboIndex;
public Vector2 endShadowThrowPos;
private int missTimes = 0;
public void Init()
{
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;
hitLength = 14f;
if (type == 6)
CookingPotLid.SetActive(true);
/*if (combo)
{
if (comboIndex == 0)
{
isEligible = true;
// PlayerActionInit(this.gameObject, createBeat, KarateMan.instance.EligibleCombos);
}
else if (comboIndex == 5)
{
isEligible = true;
}
}
else
{
isEligible = true;
// PlayerActionInit(this.gameObject, createBeat, KarateMan.instance.EligibleHits);
}*/
PlayerActionInit(this.gameObject, createBeat);
spriteComp.enabled = false;
}
public override void OnAce()
{
if (combo)
{
if (comboIndex == 0)
{
KarateJoe.instance.Combo(this);
}
else if (comboIndex == 5)
{
KarateJoe.instance.ComboPow(this, true);
}
}
else
{
this.Hit();
}
// KarateJoe.instance.Swing(state);
}
private void Update()
{
if (Conductor.instance.songPositionInBeats >= createBeat)
{
spriteComp.enabled = true;
shadowSpriteComp.color = KarateMan.instance.GetShadowColor();
}
else
{
spriteComp.enabled = false;
}
float time2Destroy = Conductor.instance.GetPositionFromBeat(createBeat, 4);
if (time2Destroy >= 1)
Destroy(this.gameObject);
if (isThrown)
{
float animTime = 2.22000000002f;
float beatTime = 1f;
if (comboIndex == 5)
{
animTime = 2.27777777777f;
}
float normalizedBeatAnim = Conductor.instance.GetPositionFromBeat(startBeat, animTime);
anim.Play(throwAnim, 0, normalizedBeatAnim);
anim.speed = 0;
float normalizedBeat = Conductor.instance.GetPositionFromBeat(startBeat, beatTime);
Shadow.transform.localScale = Vector3.Lerp(new Vector3(4.12f, 4.12f), new Vector3(0.34f, 0.34f), shadowCurveScale.Evaluate(normalizedBeatAnim));
Shadow.transform.localPosition = new Vector3(Mathf.Lerp(7.63f, endShadowThrowPos.x, shadowCurve.Evaluate(normalizedBeatAnim)), Mathf.Lerp(-12.26f, endShadowThrowPos.y, shadowCurve.Evaluate(normalizedBeatAnim)));
lastPos = Holder.transform.localPosition;
lastPotRot = Holder.transform.eulerAngles.z;
lastShadowX = Shadow.transform.localPosition.x;
lastRot = Holder.transform.GetChild(0).eulerAngles.z;
if (combo && comboIndex == 0 || !combo)
{
if (!KarateJoe.instance.hitCombo)
{
if (normalizedBeat >= 2 && missTimes == 0)
{
if (KarateJoe.instance.missC != null) StopCoroutine(KarateJoe.instance.missC);
KarateJoe.instance.missC = KarateJoe.instance.StartCoroutine(KarateJoe.instance.Miss());
missTimes = 1;
}
}
}
StateCheck(normalizedBeat);
if (!combo)
{
if (PlayerInput.Pressed())
{
if (state.perfect)
{
Hit();
}
else if (state.notPerfect())
{
Miss();
}
}
}
else
{
if (comboIndex == 0)
{
if (PlayerInput.AltPressed())
{
if (state.perfect)
{
KarateJoe.instance.Combo(this);
}
}
}
else if (comboIndex == 5)
{
if (KarateJoe.instance.comboNormalizedBeat >= 2.05f)
if (PlayerInput.AltPressedUp())
{
KarateJoe.instance.ComboPow(this);
}
}
}
if (normalizedBeat > 1)
{
spriteComp.sortingOrder = -20;
bulbLightSpriteComp.sortingOrder = -20;
shadowSpriteComp.sortingOrder = -30;
}
else
{
// Pots closer to Joe are sorted further back.
int newOrder = 60 - Mathf.RoundToInt(10f * normalizedBeat);
spriteComp.sortingOrder = newOrder;
bulbLightSpriteComp.sortingOrder = newOrder;
}
}
if (!isHit && !isThrown)
{
float normalizedBeatAnim = Conductor.instance.GetPositionFromBeat(hitBeat, 1.5f);
newHolder.transform.localPosition = new Vector3(transform.localPosition.x, Mathf.Lerp(0, 0.55f, Conductor.instance.GetPositionFromBeat(hitBeat, 0.45f)));
Holder.transform.localPosition = new Vector3(Mathf.Lerp(lastPos.x, 0.9f, normalizedBeatAnim), Mathf.Lerp(lastPos.y, -3.43f, missCurve.Evaluate(normalizedBeatAnim)));
Holder.transform.GetChild(0).transform.eulerAngles = new Vector3(0, 0, Mathf.Lerp(lastRot, lastRot - 523.203f, normalizedBeatAnim));
Shadow.transform.localPosition = new Vector3(Mathf.Lerp(lastShadowX, 0.9f, normalizedBeatAnim), Shadow.transform.localPosition.y);
}
if (kick == false)
{
if (isHit)
{
float normalizedBeatAnim = Conductor.instance.GetPositionFromBeat(hitBeat, 1.5f);
var y = Mathf.Lerp(lastPos.y, -3.27f, hitCurve.Evaluate(normalizedBeatAnim));
var x = Mathf.Lerp(lastPos.x, hitLength, hitCurveX.Evaluate(normalizedBeatAnim));
newHolder.transform.localPosition = new Vector3(transform.localPosition.x, Mathf.Lerp(0, 0.45f, hitCurveY.Evaluate(normalizedBeatAnim)));
Holder.transform.localPosition = new Vector3(x, y);
Shadow.transform.localPosition = new Vector3(Mathf.Lerp(lastShadowX, hitLength, hitCurveX.Evaluate(normalizedBeatAnim)), Shadow.transform.localPosition.y);
Holder.transform.eulerAngles = new Vector3(0, 0, Mathf.Lerp(lastPotRot, lastPotRot - 360, normalizedBeatAnim));
// anim.Play("PotHit", 0, normalizedBeatAnim);
// anim.speed = 0;
}
}
else
{
if (isHit)
{
float normalizedBeatAnim = Conductor.instance.GetPositionFromBeat(hitBeat, 1.5f);
newHolder.transform.localPosition = new Vector3(transform.localPosition.x, Mathf.Lerp(0, 0.55f, Conductor.instance.GetPositionFromBeat(hitBeat, 0.45f)));
Holder.transform.localPosition = new Vector3(Mathf.Lerp(lastPos.x, 0.9f, normalizedBeatAnim), Mathf.Lerp(lastPos.y, -3.43f, missCurve.Evaluate(normalizedBeatAnim)));
Holder.transform.GetChild(0).transform.eulerAngles = new Vector3(0, 0, Mathf.Lerp(lastRot, lastRot - 523.203f, normalizedBeatAnim));
Shadow.transform.localPosition = new Vector3(Mathf.Lerp(lastShadowX, 0.9f, normalizedBeatAnim), Shadow.transform.localPosition.y);
}
}
}
public void Hit()
{
Jukebox.PlayOneShotGame(hitSnd);
KarateJoe.instance.Swing(this);
NewHolder();
switch (type)
{
case 0:
if(!combo) KarateMan.instance.potHitEffect.Play();
break;
case 1:
GameObject bulbHit = Instantiate(KarateJoe.instance.BulbHit);
bulbHit.transform.parent = KarateJoe.instance.BulbHit.transform.parent;
bulbHit.SetActive(true);
Destroy(bulbHit, 0.7f);
break;
case 2:
// TODO: Rock destroy particle effect
break;
case 4:
BarrelDestroy(false);
break;
case 6:
// TODO: Rock destroy particle effect
CookingPotLid.SetActive(false);
CookingPotDestroy();
break;
case 999:
Jukebox.PlayOneShotGame("karateman/rockHit");
break;
}
if (!kick)
{
}
else if (kick)
{
KarateMan.instance.CreateBomb(this.transform.parent, Holder.transform.localScale, ref Shadow);
Destroy(this.gameObject);
}
hitBeat = Conductor.instance.songPositionInBeats;
anim.enabled = false;
isThrown = false;
isHit = true;
spriteComp.sortingOrder = 49;
bulbLightSpriteComp.sortingOrder = 49;
}
public void Miss()
{
Jukebox.PlayOneShot("miss");
KarateJoe.instance.SetHead(3);
NewHolder();
Holder.transform.parent = newHolder.transform;
hitBeat = Conductor.instance.songPositionInBeats;
isHit = false;
isThrown = false;
anim.enabled = false;
spriteComp.sortingOrder = 49;
bulbLightSpriteComp.sortingOrder = 49;
}
private void NewHolder()
{
newHolder = new GameObject();
newHolder.transform.parent = this.gameObject.transform;
Holder.transform.parent = newHolder.transform;
}
public void CookingPotDestroy()
{
GameObject lid = new GameObject();
lid.transform.localPosition = Holder.transform.localPosition;
lid.transform.parent = transform.parent;
lid.transform.localScale = Holder.transform.localScale;
CookingPotDestroyEffect cpde = lid.AddComponent<CookingPotDestroyEffect>();
cpde.pot = Sprite;
}
public void BarrelDestroy(bool combo)
{
for (int i = 0; i < 8; i++)
{
GameObject be = new GameObject();
be.transform.localPosition = Holder.transform.localPosition;
be.transform.parent = this.transform.parent;
be.transform.localScale = Holder.transform.localScale;
BarrelDestroyEffect bde = be.AddComponent<BarrelDestroyEffect>();
Vector3 pos = be.transform.localPosition;
SpriteRenderer sprite = be.AddComponent<SpriteRenderer>();
bde.shadow = Instantiate(Shadow, transform.parent);
bde.shadow.transform.position = Shadow.transform.position;
bde.shadow.transform.localScale = Shadow.transform.lossyScale;
bde.index = i;
bde.combo = combo;
switch (i)
{
case 0:
be.transform.localPosition = new Vector3(pos.x, pos.y + 1.25f);
sprite.sortingOrder = 35;
bde.spriteIndex = 3;
break;
case 1:
be.transform.localPosition = new Vector3(pos.x, pos.y + -0.55f);
sprite.sortingOrder = 31;
bde.spriteIndex = 3;
break;
case 2:
be.transform.localPosition = new Vector3(pos.x - 0.8f, pos.y + 0.45f);
sprite.sortingOrder = 32;
bde.spriteIndex = 0;
break;
case 3:
be.transform.localPosition = new Vector3(pos.x - 0.5f, pos.y + 0.45f);
sprite.sortingOrder = 33;
bde.spriteIndex = 1;
break;
case 4:
be.transform.localPosition = new Vector3(pos.x, pos.y + 0.45f);
sprite.sortingOrder = 34;
bde.spriteIndex = 2;
break;
case 5:
be.transform.localPosition = new Vector3(pos.x + 0.5f, pos.y + 0.45f);
sprite.sortingOrder = 33;
sprite.flipX = true;
bde.spriteIndex = 1;
break;
case 6:
be.transform.localPosition = new Vector3(pos.x + 0.8f, pos.y + 0.45f);
sprite.sortingOrder = 32;
sprite.flipX = true;
bde.spriteIndex = 0;
break;
case 7:
be.transform.localPosition = new Vector3(pos.x, pos.y + 1.25f);
sprite.sortingOrder = 39;
bde.spriteIndex = 4;
break;
}
bde.Init();
}
}
}
}

View file

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