Power Calligraphy fixed (#778)

* Power Calligraphy (WIP)

* modified:   Assets/Scripts/Games/PowerCalligraphy/Writing.cs

* comma

* onore

* sweep

* sun

* kokoro

* Power Calligraphy (WIP)

* Changed object to prefab

* Force Prepare

* Changed so that the next paper is set correctly.

* updated controllers
This commit is contained in:
フマジメ
2024-03-11 21:22:30 +09:00
committed by GitHub
parent 3eefc631b1
commit 85b6fe8bdb
79 changed files with 9037 additions and 11810 deletions

View File

@ -2,7 +2,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using HeavenStudio.Util;
@ -10,368 +10,168 @@ namespace HeavenStudio.Games.Scripts_PowerCalligraphy
{
public class Writing : MonoBehaviour
{
// Declaring the same enum in another class is not beautiful.
public enum CharacterType
[Serializable]
public struct PatternItem
{
re,
comma,
chikara,
onore,
sun,
kokoro,
face,
face_kr,
NONE,
public double beat;
public SoundType soundType;
public float soundVolume;
public StrokeType stroke;
public FudeType fudeAnim;
}
public enum SoundType {
None = 0,
brushTap,
brush1,
brush2,
brush3,
reShout,
comma1,
comma2,
comma3,
}
public double targetBeat;
public CharacterType characterType;
public Animator paperAnim;
public Animator fudePosAnim;
public Animator fudeAnim;
public enum StrokeType {
None = 0,
TOME = 1,
HANE,
HARAI,
}
public enum FudeType {
None = 0,
Release,
Tap,
Prepare,
}
public double startBeat;
public double nextBeat;
[SerializeField] PatternItem[] AnimPattern;
private Animator paperAnim;
private SortingGroup paperSort;
public Vector3 scrollSpeed;
Vector3 scrollRate => scrollSpeed / (Conductor.instance.pitchedSecPerBeat * 2f);
public bool onGoing = false;
bool isFinish = false;
int num;
enum StrokeType {
TOME = 0,
HANE,
HARAI,
}
int process_num;
StrokeType stroke;
public int Stroke { get { return (int)stroke; }}
Sound releaseSound = null;
private PowerCalligraphy game;
public void Init()
{
game = PowerCalligraphy.instance;
Anim(0);
paperAnim = GetComponent<Animator>();
paperSort = GetComponent<SortingGroup>();
nextBeat = AnimPattern[^1].beat;
}
public void Play()
{
switch(characterType)
paperSort.sortingOrder++;
var sounds = new List<MultiSound.Sound>();
var actions = new List<BeatAction.Action>();
int anim_num = 0;
foreach (var item in AnimPattern)
{
case CharacterType.re:
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("powerCalligraphy/reShout", targetBeat),
new MultiSound.Sound("powerCalligraphy/brushTap", targetBeat+2f),
new MultiSound.Sound("powerCalligraphy/brush1", targetBeat+3f),
});
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(targetBeat, delegate { fudeAnim.DoScaledAnimationAsync("fude-prepare", 0.5f);}),
new BeatAction.Action(targetBeat+2f, delegate
{
fudeAnim.DoScaledAnimationAsync("fude-tap", 0.5f);
Anim(1);
}),
new BeatAction.Action(targetBeat+3f, delegate { Anim(2);}),
new BeatAction.Action(targetBeat+4f, delegate { Sweep(); stroke = StrokeType.HANE;}),
new BeatAction.Action(targetBeat+6.5f, delegate { Anim(4, "end");}),
new BeatAction.Action(targetBeat+7f, delegate { Finish();}),
});
game.ScheduleInput(targetBeat+4f, 2f, PowerCalligraphy.InputAction_FlickPress, writeSuccess, writeMiss, Empty, CanSuccess);
break;
double itemBeat = startBeat + item.beat;
string sound = item.soundType switch {
SoundType.brushTap => "powerCalligraphy/brushTap",
SoundType.brush1 => "powerCalligraphy/brush1",
SoundType.brush2 => "powerCalligraphy/brush2",
SoundType.brush3 => "powerCalligraphy/brush3",
SoundType.reShout => "powerCalligraphy/reShout",
SoundType.comma1 => "powerCalligraphy/comma1",
SoundType.comma2 => "powerCalligraphy/comma2",
SoundType.comma3 => "powerCalligraphy/comma3",
_ => ""
};
if (!string.IsNullOrEmpty(sound)) sounds.Add(new MultiSound.Sound(sound, itemBeat, volume:item.soundVolume));
case CharacterType.comma:
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("powerCalligraphy/comma1", targetBeat),
new MultiSound.Sound("powerCalligraphy/comma2", targetBeat+2f),
new MultiSound.Sound("powerCalligraphy/comma2", targetBeat+3f),
new MultiSound.Sound("powerCalligraphy/comma3", targetBeat+4f),
});
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(targetBeat, delegate { fudeAnim.DoScaledAnimationAsync("fude-prepare", 0.5f);}),
new BeatAction.Action(targetBeat+2f, delegate { fudeAnim.DoScaledAnimationAsync("fude-prepare", 0.5f);}),
new BeatAction.Action(targetBeat+3f, delegate { fudeAnim.DoScaledAnimationAsync("fude-prepare", 0.5f);}),
new BeatAction.Action(targetBeat+4f, delegate { Anim(1);}),
new BeatAction.Action(targetBeat+5f, delegate { Halt(); stroke = StrokeType.TOME;}),
new BeatAction.Action(targetBeat+6.5f, delegate { Anim(3, "end");}),
new BeatAction.Action(targetBeat+7f, delegate { Finish();}),
});
game.ScheduleInput(targetBeat+5f, 1f, PowerCalligraphy.InputAction_BasicPress, writeSuccess, writeMiss, Empty, CanSuccess);
break;
int current_anim_num;
switch (item.fudeAnim)
{
case FudeType.Release:
anim_num++;
current_anim_num = anim_num;
actions.Add(new BeatAction.Action(itemBeat, delegate { Anim(current_anim_num); game.fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);}));
break;
case FudeType.Tap:
anim_num++;
current_anim_num = anim_num;
actions.Add(new BeatAction.Action(itemBeat, delegate { Anim(current_anim_num); game.fudeAnim.DoScaledAnimationAsync("fude-tap", 0.5f);}));
break;
case FudeType.Prepare:
actions.Add(new BeatAction.Action(itemBeat, delegate { game.fudeAnim.DoScaledAnimationAsync("fude-prepare", 0.5f);}));
break;
default:
break;
}
case CharacterType.chikara:
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("powerCalligraphy/brushTap", targetBeat),
new MultiSound.Sound("powerCalligraphy/brush1", targetBeat+0.5f),
new MultiSound.Sound("powerCalligraphy/brush2", targetBeat+1f),
new MultiSound.Sound("powerCalligraphy/brush3", targetBeat+2f),
new MultiSound.Sound("powerCalligraphy/brushTap", targetBeat+3f),
});
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(targetBeat, delegate
{
fudeAnim.DoScaledAnimationAsync("fude-tap", 0.5f);
Anim(1);
}),
new BeatAction.Action(targetBeat+0.5f, delegate { Anim(2);}),
new BeatAction.Action(targetBeat+1f, delegate { Anim(3);}),
new BeatAction.Action(targetBeat+2f, delegate
{
fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
Anim(4);
}),
new BeatAction.Action(targetBeat+2.5f, delegate { Anim(5);}),
new BeatAction.Action(targetBeat+3f, delegate {
fudeAnim.DoScaledAnimationAsync("fude-tap", 0.5f);
Anim(6);
}),
new BeatAction.Action(targetBeat+4f, delegate { Sweep(); stroke = StrokeType.HARAI;}),
new BeatAction.Action(targetBeat+6.5f, delegate { Anim(8, "end");}),
new BeatAction.Action(targetBeat+7f, delegate { Finish();}),
});
game.ScheduleInput(targetBeat+4f, 2f, PowerCalligraphy.InputAction_FlickPress, writeSuccess, writeMiss, Empty, CanSuccess);
break;
case CharacterType.onore:
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("powerCalligraphy/brushTap", targetBeat),
new MultiSound.Sound("powerCalligraphy/brush3", targetBeat+1f),
new MultiSound.Sound("powerCalligraphy/brush3", targetBeat+1.5f),
new MultiSound.Sound("powerCalligraphy/brushTap", targetBeat+2f),
new MultiSound.Sound("powerCalligraphy/brush1", targetBeat+3f),
new MultiSound.Sound("powerCalligraphy/brush2", targetBeat+4f),
});
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(targetBeat, delegate
{
fudeAnim.DoScaledAnimationAsync("fude-tap", 0.5f);
Anim(1);
}),
new BeatAction.Action(targetBeat+1f, delegate { Anim(2);}),
new BeatAction.Action(targetBeat+1.5f, delegate { Anim(3);}),
new BeatAction.Action(targetBeat+2f, delegate { Anim(4);}),
new BeatAction.Action(targetBeat+3f, delegate { Anim(5);}),
new BeatAction.Action(targetBeat+4f, delegate
{
Anim(6);
Sweep(); stroke = StrokeType.HANE;
}),
new BeatAction.Action(targetBeat+6.5f, delegate { Anim(8, "end");}),
new BeatAction.Action(targetBeat+7f, delegate { Finish();}),
});
game.ScheduleInput(targetBeat+4f, 2f, PowerCalligraphy.InputAction_FlickPress, writeSuccess, writeMiss, Empty, CanSuccess);
break;
case CharacterType.sun:
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("powerCalligraphy/brushTap", targetBeat),
new MultiSound.Sound("powerCalligraphy/brush3", targetBeat+0.5f),
new MultiSound.Sound("powerCalligraphy/brush2", targetBeat+1f),
new MultiSound.Sound("powerCalligraphy/brush3", targetBeat+1.5f),
});
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(targetBeat, delegate
{
fudeAnim.DoScaledAnimationAsync("fude-tap", 0.5f);
Anim(1);
}),
new BeatAction.Action(targetBeat+0.5f, delegate { Anim(2);}),
new BeatAction.Action(targetBeat+1f, delegate { Anim(3);}),
new BeatAction.Action(targetBeat+1.5f, delegate { Anim(4);}),
new BeatAction.Action(targetBeat+2f, delegate { Sweep(); stroke = StrokeType.HANE; num = 1;}),
new BeatAction.Action(targetBeat+5f, delegate
{
Anim(6);
Halt(); stroke = StrokeType.TOME; num = 2;
}),
new BeatAction.Action(targetBeat+6.5f, delegate { Anim(8, "end");}),
new BeatAction.Action(targetBeat+7f, delegate { Finish();}),
});
game.ScheduleInput(targetBeat+2f, 2f, PowerCalligraphy.InputAction_FlickPress, writeSuccess, writeMiss, Empty, CanSuccess);
game.ScheduleInput(targetBeat+5f, 1f, PowerCalligraphy.InputAction_BasicPress, writeSuccess, writeMiss, Empty, CanSuccess);
break;
case CharacterType.kokoro:
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("powerCalligraphy/brush3", targetBeat),
new MultiSound.Sound("powerCalligraphy/brush2", targetBeat+1f),
new MultiSound.Sound("powerCalligraphy/brushTap", targetBeat+4f),
new MultiSound.Sound("powerCalligraphy/brush3", targetBeat+4.5f, volume:0.3f), // +Agb
});
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(targetBeat, delegate
{
fudeAnim.DoScaledAnimationAsync("fude-tap", 0.5f);
Anim(1);
}),
new BeatAction.Action(targetBeat+0.5f, delegate
{
fudeAnim.DoScaledAnimationAsync("fude-tap", 0.5f);
Anim(2);
}),
new BeatAction.Action(targetBeat+1f, delegate
{
Anim(3);
Sweep(); stroke = StrokeType.HANE; num = 1;
}),
new BeatAction.Action(targetBeat+3.5f, delegate
{
fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
Anim(5);
}),
new BeatAction.Action(targetBeat+4f, delegate
{
fudeAnim.DoScaledAnimationAsync("fude-tap", 0.5f);
Anim(6);
}),
new BeatAction.Action(targetBeat+4.5f, delegate
{
fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
Anim(7);
}),
new BeatAction.Action(targetBeat+5f, delegate { Halt(); stroke = StrokeType.TOME; num = 2;}),
new BeatAction.Action(targetBeat+6.5f, delegate { Anim(9, "end");}),
new BeatAction.Action(targetBeat+7f, delegate { Finish();}),
});
game.ScheduleInput(targetBeat+1f, 2f, PowerCalligraphy.InputAction_FlickPress, writeSuccess, writeMiss, Empty, CanSuccess);
game.ScheduleInput(targetBeat+5f, 1f, PowerCalligraphy.InputAction_BasicPress, writeSuccess, writeMiss, Empty, CanSuccess);
break;
case CharacterType.face:
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("powerCalligraphy/brush1", targetBeat),
new MultiSound.Sound("powerCalligraphy/brush2", targetBeat+1f),
new MultiSound.Sound("powerCalligraphy/brush3", targetBeat+2f),
new MultiSound.Sound("powerCalligraphy/brush3", targetBeat+2.5f),
new MultiSound.Sound("powerCalligraphy/brush1", targetBeat+3f),
new MultiSound.Sound("powerCalligraphy/brush1", targetBeat+4f),
new MultiSound.Sound("powerCalligraphy/brush1", targetBeat+4.5f),
new MultiSound.Sound("powerCalligraphy/brush2", targetBeat+5f),
new MultiSound.Sound("powerCalligraphy/brush2", targetBeat+5.5f),
new MultiSound.Sound("powerCalligraphy/brush1", targetBeat+6f),
new MultiSound.Sound("powerCalligraphy/brush1", targetBeat+6.5f),
new MultiSound.Sound("powerCalligraphy/brush3", targetBeat+7f),
new MultiSound.Sound("powerCalligraphy/brush3", targetBeat+7.25f),
new MultiSound.Sound("powerCalligraphy/brushTap", targetBeat+7.5f),
});
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(targetBeat, delegate { Anim(1);}),
new BeatAction.Action(targetBeat+1f, delegate { Anim(2);}),
new BeatAction.Action(targetBeat+1.5f, delegate { Anim(3);}),
new BeatAction.Action(targetBeat+2f, delegate { Anim(4);}),
new BeatAction.Action(targetBeat+2.5f, delegate { Anim(5);}),
new BeatAction.Action(targetBeat+3f, delegate { Anim(6);}),
new BeatAction.Action(targetBeat+3.5f, delegate { Anim(7);}),
new BeatAction.Action(targetBeat+4f, delegate { Anim(8);}),
new BeatAction.Action(targetBeat+4.5f, delegate { Anim(9);}),
new BeatAction.Action(targetBeat+4.75f, delegate { Anim(10);}),
new BeatAction.Action(targetBeat+5f, delegate { Anim(11);}),
new BeatAction.Action(targetBeat+5.25f, delegate { Anim(12);}),
new BeatAction.Action(targetBeat+5.5f, delegate { Anim(13);}),
new BeatAction.Action(targetBeat+6f, delegate { Anim(14);}),
new BeatAction.Action(targetBeat+6.5f, delegate { Anim(15);}),
new BeatAction.Action(targetBeat+7f, delegate { Anim(16);}),
new BeatAction.Action(targetBeat+7.25f, delegate { Anim(17);}),
new BeatAction.Action(targetBeat+7.5f, delegate { Anim(18);}),
new BeatAction.Action(targetBeat+7.75f, delegate { Anim(19);}),
new BeatAction.Action(targetBeat+8f, delegate
{
Anim(20);
Sweep(); stroke = StrokeType.HARAI;
}),
new BeatAction.Action(targetBeat+10.5f, delegate { Anim(22, "end");}),
new BeatAction.Action(targetBeat+11f, delegate { Finish();}),
});
game.ScheduleInput(targetBeat+8f, 2f, PowerCalligraphy.InputAction_FlickPress, writeSuccess, writeMiss, Empty, CanSuccess);
break;
case CharacterType.face_kr:
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("powerCalligraphy/brush1", targetBeat),
new MultiSound.Sound("powerCalligraphy/brush2", targetBeat+1f),
new MultiSound.Sound("powerCalligraphy/brushTap", targetBeat+2f), // korean
new MultiSound.Sound("powerCalligraphy/brush3", targetBeat+2.5f), // korean
new MultiSound.Sound("powerCalligraphy/brush3", targetBeat+3.25f), // korean
new MultiSound.Sound("powerCalligraphy/brush1", targetBeat+4f),
new MultiSound.Sound("powerCalligraphy/brush1", targetBeat+4.5f),
new MultiSound.Sound("powerCalligraphy/brush2", targetBeat+5f),
new MultiSound.Sound("powerCalligraphy/brush2", targetBeat+5.5f),
new MultiSound.Sound("powerCalligraphy/brush1", targetBeat+6f),
new MultiSound.Sound("powerCalligraphy/brush1", targetBeat+6.5f),
new MultiSound.Sound("powerCalligraphy/brush3", targetBeat+7f),
new MultiSound.Sound("powerCalligraphy/brush3", targetBeat+7.25f),
new MultiSound.Sound("powerCalligraphy/brushTap", targetBeat+7.5f),
});
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(targetBeat, delegate { Anim(1);}),
new BeatAction.Action(targetBeat+1f, delegate { Anim(2);}),
new BeatAction.Action(targetBeat+1.75f, delegate { Anim(3);}),
new BeatAction.Action(targetBeat+2f, delegate { Anim(4);}),
new BeatAction.Action(targetBeat+2.5f, delegate { Anim(5);}),
new BeatAction.Action(targetBeat+3.25f, delegate { Anim(6);}),
new BeatAction.Action(targetBeat+3.5f, delegate { Anim(7);}),
new BeatAction.Action(targetBeat+4f, delegate { Anim(8);}),
new BeatAction.Action(targetBeat+4.5f, delegate { Anim(9);}),
new BeatAction.Action(targetBeat+4.75f, delegate { Anim(10);}),
new BeatAction.Action(targetBeat+5f, delegate { Anim(11);}),
new BeatAction.Action(targetBeat+5.25f, delegate { Anim(12);}),
new BeatAction.Action(targetBeat+5.5f, delegate { Anim(13);}),
new BeatAction.Action(targetBeat+6f, delegate { Anim(14);}),
new BeatAction.Action(targetBeat+6.5f, delegate { Anim(15);}),
new BeatAction.Action(targetBeat+7f, delegate { Anim(16);}),
new BeatAction.Action(targetBeat+7.25f, delegate { Anim(17);}),
new BeatAction.Action(targetBeat+7.5f, delegate { Anim(18);}),
new BeatAction.Action(targetBeat+7.75f, delegate { Anim(19);}),
new BeatAction.Action(targetBeat+8f, delegate
{
Anim(20);
Sweep(); stroke = StrokeType.HARAI;
}),
new BeatAction.Action(targetBeat+10.5f, delegate { Anim(22, "end");}),
new BeatAction.Action(targetBeat+11f, delegate { Finish();}),
});
game.ScheduleInput(targetBeat+8f, 2f, PowerCalligraphy.InputAction_FlickPress, writeSuccess, writeMiss, Empty, CanSuccess);
break;
int current_anim_num_1;
switch(item.stroke)
{
case StrokeType.TOME:
anim_num++;
current_anim_num_1 = anim_num;
actions.Add(new BeatAction.Action(itemBeat, delegate {
Halt(); stroke = StrokeType.TOME; process_num = current_anim_num_1;}));
actions.Add(new BeatAction.Action(itemBeat, delegate { onGoing = true;}));
game.ScheduleInput(itemBeat, 1f, PowerCalligraphy.InputAction_BasicPress, writeSuccess, writeMiss, Empty, CanSuccess);
break;
case StrokeType.HANE:
anim_num++;
current_anim_num_1 = anim_num;
actions.Add(new BeatAction.Action(itemBeat, delegate {
Sweep(); stroke = StrokeType.HANE; process_num = current_anim_num_1;}));
actions.Add(new BeatAction.Action(itemBeat+1, delegate { onGoing = true;}));
game.ScheduleInput(itemBeat, 2f, PowerCalligraphy.InputAction_FlickPress, writeSuccess, writeMiss, Empty, CanSuccess);
break;
case StrokeType.HARAI:
anim_num++;
current_anim_num_1 = anim_num;
actions.Add(new BeatAction.Action(itemBeat, delegate {
Sweep(); stroke = StrokeType.HARAI; process_num = current_anim_num_1;}));
actions.Add(new BeatAction.Action(itemBeat+1, delegate { onGoing = true;}));
game.ScheduleInput(itemBeat, 2f, PowerCalligraphy.InputAction_FlickPress, writeSuccess, writeMiss, Empty, CanSuccess);
break;
default:
break;
}
}
actions.Add(new BeatAction.Action(startBeat + nextBeat, delegate { Finish();}));
if (sounds.Count > 0) MultiSound.Play(sounds.ToArray());
if (actions.Count > 0) BeatAction.New(game, actions);
}
// TOME
private void Halt()
{
onGoing = true;
fudeAnim.Play("fude-halt");
releaseSound = SoundByte.PlayOneShotGame("powerCalligraphy/releaseB1", forcePlay: true);
game.fudeAnim.Play("fude-halt");
SoundByte.PlayOneShotGame("powerCalligraphy/releaseB1");
}
// HANE HARAI
private void Sweep()
{
onGoing = true;
fudeAnim.Play("fude-sweep");
releaseSound = SoundByte.PlayOneShotGame("powerCalligraphy/releaseA1", forcePlay: true);
game.fudeAnim.Play("fude-sweep");
SoundByte.PlayOneShotGame("powerCalligraphy/releaseA1", forcePlay: true);
}
private void Finish()
{
isFinish = true;
fudeAnim.Play("fude-none");
game.fudeAnim.Play("fude-none");
paperAnim.enabled = false;
}
private void writeSuccess(PlayerActionEvent caller, float state)
{
if (state >= 1f)
@ -398,90 +198,20 @@ namespace HeavenStudio.Games.Scripts_PowerCalligraphy
public void ProcessInput(string input)
{
onGoing = false;
switch(characterType)
{
case CharacterType.re:
fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
Anim(3, input);
break;
case CharacterType.comma:
switch (input) {
case "just":
fudeAnim.DoScaledAnimationAsync("fude-tap", 0.5f);
break;
default:
fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
break;
}
Anim(2, input);
break;
Anim(process_num, input);
case CharacterType.chikara:
fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
Anim(7, input);
break;
case CharacterType.onore:
fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
Anim(7, input);
break;
case CharacterType.sun:
if (num==1) {
fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
Anim(5, input);
} else {
switch (input) {
case "just":
fudeAnim.DoScaledAnimationAsync("fude-tap", 0.5f);
break;
default:
fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
break;
}
Anim(7, input);
}
break;
case CharacterType.kokoro:
if (num==1) {
fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
Anim(4, input);
} else {
switch (input) {
case "just":
fudeAnim.DoScaledAnimationAsync("fude-tap", 0.5f);
break;
default:
fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
break;
}
Anim(8, input);
}
break;
case CharacterType.face:
fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
Anim(21, input);
break;
case CharacterType.face_kr:
fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
Anim(21, input);
break;
}
switch (input)
{
case "just":
switch (stroke) {
case StrokeType.TOME:
game.fudeAnim.DoScaledAnimationAsync("fude-tap", 0.5f);
SoundByte.PlayOneShotGame("powerCalligraphy/releaseB2");
break;
case StrokeType.HANE:
case StrokeType.HARAI:
game.fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
SoundByte.PlayOneShotGame("powerCalligraphy/releaseA2");
break;
}
@ -491,12 +221,15 @@ namespace HeavenStudio.Games.Scripts_PowerCalligraphy
case "fast":
switch (stroke) { // WIP
case StrokeType.TOME:
game.fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
SoundByte.PlayOneShotGame("powerCalligraphy/8");
break;
case StrokeType.HANE:
game.fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
SoundByte.PlayOneShotGame("powerCalligraphy/6");
break;
case StrokeType.HARAI:
game.fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
SoundByte.PlayOneShotGame("powerCalligraphy/9");
break;
}
@ -504,76 +237,32 @@ namespace HeavenStudio.Games.Scripts_PowerCalligraphy
default:
break;
}
// not work
if (input == "fast" && releaseSound is not null)
{
releaseSound.Stop();
releaseSound = null;
}
}
public void Miss()
{
onGoing = false;
SoundByte.PlayOneShotGame("powerCalligraphy/7"); // WIP
switch(characterType)
{
case CharacterType.re:
fudeAnim.DoScaledAnimationAsync("fude-sweep-end", 0.5f);
break;
case CharacterType.comma:
fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
fudePosAnim.DoScaledAnimationAsync("fudePos-comma02-miss", 0.5f);
break;
Anim(process_num, "miss");
case CharacterType.chikara:
fudeAnim.DoScaledAnimationAsync("fude-sweep-end", 0.5f);
switch (stroke) {
case StrokeType.TOME:
game.fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
break;
case CharacterType.onore:
fudeAnim.DoScaledAnimationAsync("fude-sweep-end", 0.5f);
break;
case CharacterType.sun:
if (num==1) {
fudeAnim.DoScaledAnimationAsync("fude-sweep-end", 0.5f);
} else {
fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
fudePosAnim.DoScaledAnimationAsync("fudePos-sun07-miss", 0.5f);
}
break;
case CharacterType.kokoro:
if (num==1) {
fudeAnim.DoScaledAnimationAsync("fude-sweep-end", 0.5f);
} else {
fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
fudePosAnim.DoScaledAnimationAsync("fudePos-kokoro08-miss", 0.5f);
}
break;
case CharacterType.face:
fudeAnim.DoScaledAnimationAsync("fude-sweep-end", 0.5f);
break;
case CharacterType.face_kr:
fudeAnim.DoScaledAnimationAsync("fude-sweep-end", 0.5f);
case StrokeType.HANE:
case StrokeType.HARAI:
game.fudeAnim.DoScaledAnimationAsync("fude-sweep-end", 0.5f);
break;
}
}
private void Anim(int num, string str = "")
{
string pattern =
characterType.ToString()
+ num.ToString("D2") + ((str != "") ? "-" + str : str);
string pattern = num.ToString() + str;
fudePosAnim.DoScaledAnimationAsync("fudePos-" + pattern, 0.5f);
paperAnim.DoScaledAnimationAsync("paper-" + pattern, 0.5f);
game.fudePosAnim.DoScaledAnimationAsync(pattern, 0.5f);
paperAnim.DoScaledAnimationAsync(pattern, 0.5f);
}
private void Update()
@ -588,15 +277,9 @@ namespace HeavenStudio.Games.Scripts_PowerCalligraphy
// Paper scroll.
var paperPos = transform.localPosition;
transform.localPosition = paperPos + (scrollRate * Time.deltaTime);
if (beat >= targetBeat + 24) Destroy(gameObject);
if (beat >= startBeat + 24) Destroy(gameObject);
}
}
}
public void TheEnd()
{
fudePosAnim.Play("fudePos-end");
paperAnim.Play("paper-end");
}
}
}