First Contact & Tap Trial

First Contact:
Live is now offbeat
[alienSuccess] code block is a bit smaller
Mission Control is now stretchable

Tap Trial
- Started working on coding the inputs
- Animated monkey (tap, double, and triple (incomplete))
This commit is contained in:
Mytiaoga
2022-07-11 13:53:25 +08:00
parent 614059a4d3
commit 4f08887078
432 changed files with 115089 additions and 755 deletions

View File

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using UnityEngine;
@ -16,20 +17,27 @@ namespace HeavenStudio.Games.Loaders
{
new Param("toggle", true, "Bop", "Whether both will bop to the beat or not")
}),
new GameAction("and stop ooh", delegate { var e = eventCaller.currentEntity; DJSchool.instance.AndStop(e.beat, e.toggle); }, 2.5f, false, new List<Param>()
new GameAction("and stop ooh", delegate { var e = eventCaller.currentEntity; DJSchool.instance.AndStop(e.beat, e.toggle); }, 2.5f, false,
inactiveFunction: delegate { var e = eventCaller.currentEntity; DJSchool.WarnAndStop(e.beat, e.toggle); },
parameters: new List<Param>()
{
new Param("toggle", true, "Ooh", "Whether or not the \"ooh\" sound should be played")
}),
new GameAction("break c'mon ooh", delegate { var e = eventCaller.currentEntity; DJSchool.instance.BreakCmon(e.beat, e.type, e.toggle); }, 3f, false, new List<Param>()
new GameAction("break c'mon ooh", delegate { var e = eventCaller.currentEntity; DJSchool.instance.BreakCmon(e.beat, e.type, e.toggle); }, 3f, false,
inactiveFunction: delegate { var e = eventCaller.currentEntity; DJSchool.WarnBreakCmon(e.beat, e.type, e.toggle); },
parameters: new List<Param>()
{
new Param("type", DJSchool.DJVoice.Standard, "Voice", "The voice line to play"),
new Param("toggle", true, "Ooh", "Whether or not the \"ooh\" sound should be played")
}),
new GameAction("scratch-o hey", delegate { DJSchool.instance.ScratchoHey(eventCaller.currentEntity.beat, eventCaller.currentEntity.type); }, 3f, false, new List<Param>()
new GameAction("scratch-o hey", delegate { DJSchool.instance.ScratchoHey(eventCaller.currentEntity.beat, eventCaller.currentEntity.type, eventCaller.currentEntity.toggle); }, 3f, false, new List<Param>()
{
new Param("type", DJSchool.DJVoice.Standard, "Voice", "The voice line to play"),
new Param("toggle", false, "Fast Hey", "Activate Remix 4 (DS) beat")
}),
new GameAction("dj voice lines", delegate { DJSchool.instance.voiceLines(eventCaller.currentEntity.beat, eventCaller.currentEntity.type); }, 2f, false, new List<Param>()
new GameAction("dj voice lines", delegate { DJSchool.instance.voiceLines(eventCaller.currentEntity.beat, eventCaller.currentEntity.type); }, 2f, false,
inactiveFunction: delegate { DJSchool.WarnDJVoiceLines(eventCaller.currentEntity.beat, eventCaller.currentEntity.type); },
parameters: new List<Param>()
{
new Param("type", DJSchool.DJVoiceLines.CheckItOut, "Voice Lines", "The voice line to play"),
}),
@ -66,9 +74,7 @@ namespace HeavenStudio.Games
OhYeah,
OhYeahAlt,
Yay
}
}
[Header("Components")]
[SerializeField] private Student student;
@ -95,6 +101,30 @@ namespace HeavenStudio.Games
goBop = true;
}
//For inactive game purposes
static float wantBreak = Single.MinValue;
static float wantAndStop = Single.MinValue;
static float wantDJVoiceLines = Single.MinValue;
public override void OnGameSwitch(float beat)
{
if (wantBreak != Single.MinValue)
{
BreakCmon(wantBreak, 0, false, false);
wantBreak = Single.MinValue;
}
else if(wantAndStop != Single.MinValue)
{
AndStop(wantAndStop, false, false);
wantAndStop = Single.MinValue;
}
else if(wantDJVoiceLines != Single.MinValue)
{
voiceLines(wantDJVoiceLines, 0);
wantDJVoiceLines = Single.MinValue;
}
}
private void Update()
{
#region old script
@ -205,7 +235,7 @@ namespace HeavenStudio.Games
}
}
public void BreakCmon(float beat, int type, bool ooh)
public void BreakCmon(float beat, int type, bool ooh, bool doSound = true)
{
if (djYellowHolding) return;
@ -224,17 +254,21 @@ namespace HeavenStudio.Games
break;
}
var sound = new MultiSound.Sound[]
if (doSound)
{
new MultiSound.Sound(sounds[0], beat),
new MultiSound.Sound(sounds[1], beat + 1f, offset: 0.030f),
new MultiSound.Sound("", beat + 2f)
};
var sound = new MultiSound.Sound[]
{
new MultiSound.Sound(sounds[0], beat),
new MultiSound.Sound(sounds[1], beat + 1f, offset: 0.030f),
new MultiSound.Sound("", beat + 2f)
};
if (ooh)
sound[2] = new MultiSound.Sound(sounds[2], beat + 2f);
if (ooh)
sound[2] = new MultiSound.Sound(sounds[2], beat + 2f);
MultiSound.Play(sound);
MultiSound.Play(sound);
}
BeatAction.New(djYellow, new List<BeatAction.Action>()
{
@ -250,20 +284,26 @@ namespace HeavenStudio.Games
ScheduleInput(beat, 2f, InputType.STANDARD_DOWN, student.OnHitHold, student.OnMissHold, student.OnEmpty);
}
public void AndStop(float beat, bool ooh)
public void AndStop(float beat, bool ooh, bool doSound = true)
{
if (djYellowHolding) return;
var sound = new MultiSound.Sound[]
if (doSound)
{
new MultiSound.Sound("djSchool/andStop1", beat),
new MultiSound.Sound("djSchool/andStop2", beat + .5f, offset: 0.1200f),
new MultiSound.Sound("", beat + 1.5f)
};
var sound = new MultiSound.Sound[]
{
new MultiSound.Sound("djSchool/andStop1", beat),
new MultiSound.Sound("djSchool/andStop2", beat + .5f, offset: 0.1200f),
new MultiSound.Sound("", beat + 1.5f)
};
if (ooh)
sound[2] = new MultiSound.Sound("djSchool/oohAlt", beat + 1.5f);
if (ooh)
sound[2] = new MultiSound.Sound("djSchool/oohAlt", beat + 1.5f);
MultiSound.Play(sound);
MultiSound.Play(sound);
}
BeatAction.New(djYellow, new List<BeatAction.Action>()
{
@ -279,7 +319,7 @@ namespace HeavenStudio.Games
ScheduleInput(beat, 1.5f, InputType.STANDARD_DOWN, student.OnHitHold, student.OnMissHold, student.OnEmpty);
}
public void ScratchoHey(float beat, int type)
public void ScratchoHey(float beat, int type, bool remix4)
{
string[] sounds = new string[] { };
@ -296,23 +336,40 @@ namespace HeavenStudio.Games
sounds = new string[] { "djSchool/scratchoHeyLoud1", "djSchool/scratchoHeyLoud2", "djSchool/scratchoHeyLoud3", "djSchool/scratchoHeyLoud4", "djSchool/heyLoud" };
}
float timing = 0f;
float beatOffset = 0f;
float beatOffset2 = 0f;
if (!remix4)
{
timing = 2f;
beatOffset = 2f;
beatOffset2 = 2.05f;
}
else
{
timing = 1.5f;
beatOffset = 1.5f;
beatOffset2 = 1.55f;
}
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound(sounds[0], beat),
new MultiSound.Sound(sounds[1], beat + .25f),
new MultiSound.Sound(sounds[2], beat + .5f),
new MultiSound.Sound(sounds[3], beat + 1f, offset: 0.0500f),
new MultiSound.Sound(sounds[4], beat + 2f, offset: 0.070f),
new MultiSound.Sound(sounds[4], beat + beatOffset, offset: 0.070f),
});
BeatAction.New(djYellow, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { djYellow.GetComponent<Animator>().Play("Scratcho", 0, 0); }),
new BeatAction.Action(beat + .5f, delegate { djYellow.GetComponent<Animator>().Play("Scratcho2", 0, 0); }),
//new BeatAction.Action(beat + 1f, delegate { djYellow.GetComponent<Animator>().Play("Scratcho", 0, 0); SetupCue(beat, true); }),
new BeatAction.Action(beat + 1f, delegate { djYellow.GetComponent<Animator>().Play("Scratcho", 0, 0); }),
new BeatAction.Action(beat + 2.05f, delegate
{
new BeatAction.Action(beat + beatOffset2, delegate
{
djYellow.GetComponent<Animator>().Play("Hey", 0, 0);
djYellowHolding = false;
}),
@ -321,9 +378,12 @@ namespace HeavenStudio.Games
beatOfInstance = beat;
ScheduleInput(beat, 2f, InputType.STANDARD_UP, student.OnHitSwipe, student.OnMissSwipe, student.OnEmpty);
ScheduleInput(beat, timing, InputType.STANDARD_UP, student.OnHitSwipe, student.OnMissSwipe, student.OnEmpty);
andStop = false;
}
//void SetupCue(float beat, bool swipe)
@ -434,5 +494,114 @@ namespace HeavenStudio.Games
break;
}
}
#region Inactive Game Commands
public static void WarnBreakCmon(float beat, int type, bool ooh)
{
string[] sounds = new string[] { };
switch (type)
{
case 0:
sounds = new string[] { "djSchool/breakCmon1", "djSchool/breakCmon2", "djSchool/ooh" };
break;
case 1:
sounds = new string[] { "djSchool/breakCmonAlt1", "djSchool/breakCmonAlt2", "djSchool/oohAlt" };
break;
case 2:
sounds = new string[] { "djSchool/breakCmonLoud1", "djSchool/breakCmonLoud2", "djSchool/oohLoud" };
break;
}
var sound = new MultiSound.Sound[]
{
new MultiSound.Sound(sounds[0], beat),
new MultiSound.Sound(sounds[1], beat + 1f, offset: 0.030f),
new MultiSound.Sound("", beat + 2f)
};
if (ooh)
sound[2] = new MultiSound.Sound(sounds[2], beat + 2f);
MultiSound.Play(sound, forcePlay: true);
wantBreak = beat;
}
public static void WarnAndStop(float beat, bool ooh)
{
var sound = new MultiSound.Sound[]
{
new MultiSound.Sound("djSchool/andStop1", beat),
new MultiSound.Sound("djSchool/andStop2", beat + .5f, offset: 0.1200f),
new MultiSound.Sound("", beat + 1.5f)
};
if (ooh)
sound[2] = new MultiSound.Sound("djSchool/oohAlt", beat + 1.5f);
MultiSound.Play(sound, forcePlay: true);
wantAndStop = beat;
}
public static void WarnDJVoiceLines(float beat, int type)
{
string[] sounds;
var sound = new MultiSound.Sound[] { };
switch (type)
{
case 0:
sounds = new string[] { "djSchool/checkItOut1", "djSchool/checkItOut2", "djSchool/checkItOut3" };
sound = new MultiSound.Sound[]
{
new MultiSound.Sound(sounds[0], beat),
new MultiSound.Sound(sounds[1], beat + .25f),
new MultiSound.Sound(sounds[2], beat + .5f),
};
break;
case 1:
sounds = new string[] { "djSchool/letsGo1", "djSchool/letsGo2" };
sound = new MultiSound.Sound[]
{
new MultiSound.Sound(sounds[0], beat),
new MultiSound.Sound(sounds[1], beat + .5f),
};
break;
case 2:
sounds = new string[] { "djSchool/ohYeah1", "djSchool/ohYeah2" };
sound = new MultiSound.Sound[]
{
new MultiSound.Sound(sounds[0], beat),
new MultiSound.Sound(sounds[1], beat + .5f),
};
break;
case 3:
sounds = new string[] { "djSchool/ohYeahAlt1", "djSchool/ohYeahAlt2", "djSchool/ohYeahAlt3" };
sound = new MultiSound.Sound[]
{
new MultiSound.Sound(sounds[0], beat),
new MultiSound.Sound(sounds[1], beat + .5f),
new MultiSound.Sound(sounds[2], beat + 1f),
};
break;
case 4:
Jukebox.PlayOneShotGame("djSchool/yay");
break;
}
MultiSound.Play(sound, forcePlay: true);
wantDJVoiceLines = beat;
}
#endregion
}
}

View File

@ -18,7 +18,7 @@ namespace HeavenStudio.Games.Loaders
}),
new GameAction("alien turnover", delegate { FirstContact.instance.alienTurnOver(eventCaller.currentEntity.beat); }, 0.5f, false),
new GameAction("alien success", delegate { FirstContact.instance.alienSuccess(eventCaller.currentEntity.beat); }, 1f, false),
new GameAction("mission control", delegate { FirstContact.instance.missionControlDisplay(eventCaller.currentEntity.beat, eventCaller.currentEntity.toggle); }, 1f, false, new List<Param>
new GameAction("mission control", delegate { FirstContact.instance.missionControlDisplay(eventCaller.currentEntity.beat, eventCaller.currentEntity.toggle, eventCaller.currentEntity.length); }, 1f, true, new List<Param>
{
new Param("toggle", false, "Stay", "If it's the end of the remix/song")
}),
@ -32,7 +32,7 @@ namespace HeavenStudio.Games.Loaders
//{
// new Param("type", FirstContact.VersionOfContact.FirstContact, "Version", "Version of First Contact to play"),
//}),
});
});
}
}
}
@ -49,7 +49,7 @@ namespace HeavenStudio.Games
public int alienSpeakCount;
public int translatorSpeakCount;
public bool hasMissed;
private float lastReportedBeat = 0f;
private float lastReportedBeat = 0;
[Header("Components")]
[SerializeField] GameObject alien;
@ -108,7 +108,7 @@ namespace HeavenStudio.Games
private void Update()
{
//This is taken from the conductor script
if (Conductor.instance.ReportBeat(ref lastReportedBeat))
if (Conductor.instance.ReportBeat(ref lastReportedBeat, offset: .5f))
{
liveBar.GetComponent<Animator>().Play("liveBar", 0, 0);
}
@ -162,11 +162,6 @@ namespace HeavenStudio.Games
public void alienSpeak(float beat, float pitch)
{
//if (!intervalStarted)
//{
// SetIntervalStart(beat, beatInterval);
//}
//missionControl.SetActive(false);
Jukebox.PlayOneShotGame("firstContact/alien", beat, pitch);
++alienSpeakCount;
var random = Random.Range(0, 2);
@ -193,7 +188,6 @@ namespace HeavenStudio.Games
}
}),
});
}
public void alienTurnOver(float beat)
@ -228,52 +222,45 @@ namespace HeavenStudio.Games
public void alienSuccess(float beat)
{
//Make this codeblock smaller
string[] sfxStrings = { "", "" };
string animString = "";
if (alienSpeakCount == translatorSpeakCount)
{
string[] sounds = new string[] { "firstContact/success_1", "firstContact/success_2" };
var sound = new MultiSound.Sound[]
{
new MultiSound.Sound(sounds[0], beat),
new MultiSound.Sound(sounds[1], beat + .5f, offset: .15f)
};
MultiSound.Play(sound);
BeatAction.New(alien, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { alien.GetComponent<Animator>().Play("alien_success", 0, 0); }),
new BeatAction.Action(beat + .5f, delegate { alien.GetComponent<Animator>().Play("alien_success", 0, 0); })
});
BeatAction.New(translator.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + .5f, delegate { translator.GetComponent<Animator>().Play("translator_idle", 0, 0); }),
});
sfxStrings[0] = "firstContact/success_1";
sfxStrings[1] = "firstContact/success_2";
animString = "alien_success";
Debug.Log("success");
}
else if (alienSpeakCount != translatorSpeakCount)
{
string[] sounds = new string[] { "firstContact/failAlien_1", "firstContact/failAlien_2" };
var sound = new MultiSound.Sound[]
{
new MultiSound.Sound(sounds[0], beat),
new MultiSound.Sound(sounds[1], beat + .5f)
};
MultiSound.Play(sound);
BeatAction.New(alien, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { alien.GetComponent<Animator>().Play("alien_fail", 0, 0); }),
new BeatAction.Action(beat + .5f, delegate { alien.GetComponent<Animator>().Play("alien_fail", 0, 0); })
});
BeatAction.New(translator.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + .5f, delegate { translator.GetComponent<Animator>().Play("translator_idle", 0, 0); }),
});
sfxStrings[0] = "firstContact/failAlien_1";
sfxStrings[1] = "firstContact/failAlien_2";
animString = "alien_fail";
Debug.Log("fail");
}
string[] sounds = new string[] { sfxStrings[0], sfxStrings[0] };
var sound = new MultiSound.Sound[]
{
new MultiSound.Sound(sounds[0], beat),
new MultiSound.Sound(sounds[1], beat + .5f)
};
MultiSound.Play(sound);
BeatAction.New(alien, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { alien.GetComponent<Animator>().Play(animString, 0, 0); }),
new BeatAction.Action(beat + .5f, delegate { alien.GetComponent<Animator>().Play(animString, 0, 0); })
});
BeatAction.New(translator.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { translator.GetComponent<Animator>().Play("translator_idle", 0, 0); }),
});
alienSpeakCount = 0;
translatorSpeakCount = 0;
isSpeaking = false;
@ -281,7 +268,7 @@ namespace HeavenStudio.Games
noHitOnce = false;
}
public void missionControlDisplay(float beat, bool stay)
public void missionControlDisplay(float beat, bool stay, float length)
{
missionControl.SetActive(true);
string textToPut = "";
@ -297,9 +284,9 @@ namespace HeavenStudio.Games
BeatAction.New(missionControl, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { missionControl.GetComponentInParent<Animator>().Play(textToPut, 0, 0); }),
new BeatAction.Action(beat, delegate { alien.GetComponentInParent<Animator>().Play("alien_idle", 0, 0); }),
new BeatAction.Action(beat, delegate { translator.GetComponent<Animator>().Play("translator_idle", 0, 0); }),
new BeatAction.Action(length, delegate { missionControl.GetComponentInParent<Animator>().Play(textToPut, 0, 0); }),
new BeatAction.Action(length, delegate { alien.GetComponentInParent<Animator>().Play("alien_idle", 0, 0); }),
new BeatAction.Action(length, delegate { translator.GetComponent<Animator>().Play("translator_idle", 0, 0); }),
});
@ -307,7 +294,7 @@ namespace HeavenStudio.Games
{
BeatAction.New(missionControl, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 1f, delegate { missionControl.SetActive(false); }),
new BeatAction.Action(length + 1f, delegate { missionControl.SetActive(false); }),
});
}
else
@ -357,7 +344,6 @@ namespace HeavenStudio.Games
});
}
public void AlienEmpty(PlayerActionEvent caller) //OnEmpty
{
//empty
@ -367,54 +353,6 @@ namespace HeavenStudio.Games
{
return Random.Range(1, 11);
}
//public void alienSuccessTest(PlayerActionEvent caller, float beat)
//{
// string[] sfxStrings = { "", "" };
// string animString = "";
// float off = 0f;
// if (alienSpeakCount == translatorSpeakCount)
// {
// sfxStrings[0] = "firstContact/success_1";
// sfxStrings[1] = "firstContact/success_2";
// animString = "alien_success";
// off = .15f;
// }
// else if(alienSpeakCount != translatorSpeakCount)
// {
// sfxStrings[0] = "firstContact/failAlien_1";
// sfxStrings[1] = "firstContact/failAlien_2";
// animString = "alien_fail";
// off = .5f;
// }
// string[] sounds = new string[] { sfxStrings[0], sfxStrings[0] };
// var sound = new MultiSound.Sound[]
// {
// new MultiSound.Sound(sounds[0], beat),
// new MultiSound.Sound(sounds[1], beat + .5f, offset: off)
// };
// MultiSound.Play(sound);
// BeatAction.New(alien, new List<BeatAction.Action>()
// {
// new BeatAction.Action(beat, delegate { alien.GetComponent<Animator>().Play(animString, 0, 0); }),
// new BeatAction.Action(beat + .5f, delegate { alien.GetComponent<Animator>().Play(animString, 0, 0); })
// });
// BeatAction.New(translator.gameObject, new List<BeatAction.Action>()
// {
// new BeatAction.Action(beat, delegate { translator.GetComponent<Animator>().Play("translator_idle", 0, 0); }),
// });
// alienSpeakCount = 0;
// translatorSpeakCount = 0;
// isSpeaking = false;
// hasMissed = false;
// noHitOnce = false;
//}
}
}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2cb19f3c4fb4b5d45957acebed87a7cf
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,202 @@
using HeavenStudio.Util;
using System;
using System.Collections.Generic;
using UnityEngine;
namespace HeavenStudio.Games.Loaders
{
using static Minigames;
public static class AgbSpaceDanceLoader
{
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("spaceDance", "Space Dance \n<color=#eb5454>[WIP don't use]</color>", "000000", false, false, new List<GameAction>()
{
new GameAction("turn right", delegate { SpaceDance.instance.DoTurnRight(eventCaller.currentEntity.beat); }, 2.0f, false),
new GameAction("sit down", delegate { SpaceDance.instance.DoSitDown(eventCaller.currentEntity.beat); }, 2.0f, false),
new GameAction("punch", delegate { SpaceDance.instance.DoPunch(eventCaller.currentEntity.beat); }, 2.0f, false),
new GameAction("bop", delegate { SpaceDance.instance.Bop(eventCaller.currentEntity.beat); }, 1.0f, false),
});
}
}
}
namespace HeavenStudio.Games
{
// using Scripts_SpaceDance;
public class SpaceDance : Minigame
{
public Animator DancerP;
public Animator Dancer1;
public Animator Dancer2;
public Animator Dancer3;
public Animator Gramps;
public Animator Hit;
public GameObject Player;
public static SpaceDance instance;
// Start is called before the first frame update
void Awake()
{
instance = this;
}
// Update is called once per frame
void Update()
{
if (PlayerInput.Pressed() && !IsExpectingInputNow())
{
Jukebox.PlayOneShotGame("spaceDance/inputBad");
// Look at this later, sound effect has some weird clipping on it sometimes?? popping. like. fucking popopop idk why its doing that its fine theres no sample weirdness ughh
}
}
public void DoTurnRight(float beat)
{
ScheduleInput(beat, 1f, InputType.DIRECTION_RIGHT_DOWN, RightSuccess, RightMiss, RightEmpty);
MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("spaceDance/voicelessTurn", beat),
new MultiSound.Sound("spaceDance/dancerTurn", beat),
new MultiSound.Sound("spaceDance/dancerRight", beat + 1.0f),
});
BeatAction.New(Player, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { DancerP.Play("TurnRightStart", -1, 0);}),
new BeatAction.Action(beat, delegate { Dancer1.Play("TurnRightStart", -1, 0);}),
new BeatAction.Action(beat, delegate { Dancer2.Play("TurnRightStart", -1, 0);}),
new BeatAction.Action(beat, delegate { Dancer3.Play("TurnRightStart", -1, 0);}),
new BeatAction.Action(beat + 1f, delegate { Dancer1.Play("TurnRightDo", -1, 0);}),
new BeatAction.Action(beat + 1f, delegate { Dancer2.Play("TurnRightDo", -1, 0);}),
new BeatAction.Action(beat + 1f, delegate { Dancer3.Play("TurnRightDo", -1, 0);}),
});
}
public void DoSitDown(float beat)
{
ScheduleInput(beat, 1f, InputType.DIRECTION_DOWN_DOWN, SitSuccess, SitMiss, SitEmpty);
MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("spaceDance/voicelessSit", beat),
new MultiSound.Sound("spaceDance/dancerLets", beat),
new MultiSound.Sound("spaceDance/dancerSit", beat + 0.5f),
new MultiSound.Sound("spaceDance/dancerDown", beat + 1f),
});
BeatAction.New(Player, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { DancerP.Play("SitDownStart", -1, 0);}),
new BeatAction.Action(beat, delegate { Dancer1.Play("SitDownStart", -1, 0);}),
new BeatAction.Action(beat, delegate { Dancer2.Play("SitDownStart", -1, 0);}),
new BeatAction.Action(beat, delegate { Dancer3.Play("SitDownStart", -1, 0);}),
new BeatAction.Action(beat + 1f, delegate { Dancer1.Play("SitDownDo", -1, 0);}),
new BeatAction.Action(beat + 1f, delegate { Dancer2.Play("SitDownDo", -1, 0);}),
new BeatAction.Action(beat + 1f, delegate { Dancer3.Play("SitDownDo", -1, 0);}),
});
}
public void DoPunch(float beat)
{
ScheduleInput(beat, 1.5f, InputType.STANDARD_DOWN, PunchSuccess, PunchMiss, PunchEmpty);
MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("spaceDance/voicelessPunch", beat),
new MultiSound.Sound("spaceDance/dancerPa", beat),
new MultiSound.Sound("spaceDance/voicelessPunch", beat + 0.5f),
new MultiSound.Sound("spaceDance/dancerPa", beat + 0.5f),
new MultiSound.Sound("spaceDance/voicelessPunch", beat + 1f),
new MultiSound.Sound("spaceDance/dancerPa", beat + 1f),
new MultiSound.Sound("spaceDance/dancerPunch", beat + 1.5f),
});
BeatAction.New(Player, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { DancerP.Play("PunchStartInner", -1, 0);}),
new BeatAction.Action(beat, delegate { Dancer1.Play("PunchStartInner", -1, 0);}),
new BeatAction.Action(beat, delegate { Dancer2.Play("PunchStartInner", -1, 0);}),
new BeatAction.Action(beat, delegate { Dancer3.Play("PunchStartInner", -1, 0);}),
new BeatAction.Action(beat + 0.5f, delegate { DancerP.Play("PunchStartOuter", -1, 0);}),
new BeatAction.Action(beat + 0.5f, delegate { Dancer1.Play("PunchStartOuter", -1, 0);}),
new BeatAction.Action(beat + 0.5f, delegate { Dancer2.Play("PunchStartOuter", -1, 0);}),
new BeatAction.Action(beat + 0.5f, delegate { Dancer3.Play("PunchStartOuter", -1, 0);}),
new BeatAction.Action(beat + 1f, delegate { DancerP.Play("PunchStartInner", -1, 0);}),
new BeatAction.Action(beat + 1f, delegate { Dancer1.Play("PunchStartInner", -1, 0);}),
new BeatAction.Action(beat + 1f, delegate { Dancer2.Play("PunchStartInner", -1, 0);}),
new BeatAction.Action(beat + 1f, delegate { Dancer3.Play("PunchStartInner", -1, 0);}),
new BeatAction.Action(beat + 1.5f, delegate { Dancer1.Play("PunchDo", -1, 0);}),
new BeatAction.Action(beat + 1.5f, delegate { Dancer2.Play("PunchDo", -1, 0);}),
new BeatAction.Action(beat + 1.5f, delegate { Dancer3.Play("PunchDo", -1, 0);}),
});
}
public void Bop(float beat)
{
BeatAction.New(Player, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { DancerP.Play("Bop", -1, 0);}),
new BeatAction.Action(beat, delegate { Dancer1.Play("Bop", -1, 0);}),
new BeatAction.Action(beat, delegate { Dancer2.Play("Bop", -1, 0);}),
new BeatAction.Action(beat, delegate { Dancer3.Play("Bop", -1, 0);}),
});
}
public void RightSuccess(PlayerActionEvent caller, float state)
{
Jukebox.PlayOneShotGame("spaceDance/inputGood");
DancerP.Play("TurnRightDo", -1, 0);
}
public void RightMiss(PlayerActionEvent caller)
{
Jukebox.PlayOneShotGame("spaceDance/inputBad2");
DancerP.Play("Ouch", -1, 0);
Hit.Play("HitTurn", -1, 0);
}
public void RightEmpty(PlayerActionEvent caller)
{
}
public void SitSuccess(PlayerActionEvent caller, float state)
{
Jukebox.PlayOneShotGame("spaceDance/inputGood");
DancerP.Play("SitDownDo", -1, 0);
}
public void SitMiss(PlayerActionEvent caller)
{
Jukebox.PlayOneShotGame("spaceDance/inputBad2");
DancerP.Play("Ouch", -1, 0);
Hit.Play("HitSit", -1, 0);
}
public void SitEmpty(PlayerActionEvent caller)
{
}
public void PunchSuccess(PlayerActionEvent caller, float state)
{
Jukebox.PlayOneShotGame("spaceDance/inputGood");
DancerP.Play("PunchDo", -1, 0);
}
public void PunchMiss(PlayerActionEvent caller)
{
Jukebox.PlayOneShotGame("spaceDance/inputBad2");
DancerP.Play("Ouch", -1, 0);
Hit.Play("HitPunch", -1, 0);
}
public void PunchEmpty(PlayerActionEvent caller)
{
}
}
}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 9557e460670800e458d7bb141135de55
guid: 8dbd5e988233f9a4f931eddbafe8719a
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@ -12,6 +12,10 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("tapTrial", "Tap Trial \n<color=#eb5454>[WIP don't use]</color>", "93ffb3", false, false, new List<GameAction>()
{
new GameAction("bop", delegate { TapTrial.instance.Bop(eventCaller.currentEntity.toggle); }, .5f, false, new List<Param>()
{
new Param("toggle", true, "Bop", "Whether both will bop to the beat or not")
}),
new GameAction("tap", delegate { TapTrial.instance.Tap(eventCaller.currentEntity.beat); }, 2.0f, false),
new GameAction("double tap", delegate { TapTrial.instance.DoubleTap(eventCaller.currentEntity.beat); }, 2.0f, false),
new GameAction("triple tap", delegate { TapTrial.instance.TripleTap(eventCaller.currentEntity.beat); }, 4.0f, false),
@ -31,6 +35,9 @@ namespace HeavenStudio.Games
[Header("References")]
public TapTrialPlayer player;
public GameObject tap;
[SerializeField] List<Animator> monkeys;
bool goBop;
float lastReportedBeat = 0f;
public static TapTrial instance { get; set; }
@ -39,14 +46,72 @@ namespace HeavenStudio.Games
instance = this;
}
// The following is all solely animations for placeholder. This isn't playable
private void Update()
{
if (goBop)
{
if (Conductor.instance.ReportBeat(ref lastReportedBeat))
{
monkeys[0].Play("Bop", 0, 0);
monkeys[1].Play("Bop", 0, 0);
}
else if (Conductor.instance.songPositionInBeats < lastReportedBeat)
{
lastReportedBeat = Mathf.Round(Conductor.instance.songPositionInBeats);
}
}
}
public void Bop(bool isBopping)
{
if (isBopping)
{
goBop = true;
}
else
{
goBop = false;
}
}
public void Tap(float beat)
{
Jukebox.PlayOneShotGame("tapTrial/ook");
player.anim.Play("TapPrepare", 0, 0);
CreateTap(beat);
//Monkey Tap Prepare Anim
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { monkeys[0].Play("TapPrepare"); }),
new BeatAction.Action(beat, delegate { monkeys[1].Play("TapPrepare"); }),
new BeatAction.Action(beat + 1f, delegate { monkeys[0].Play("Tap"); }),
new BeatAction.Action(beat + 1f, delegate { monkeys[1].Play("Tap"); }),
});
//CreateTap(beat);
ScheduleInput(beat, 1f, InputType.STANDARD_DOWN, OnTap, OnTapMiss, OnEmpty);
}
public void OnTap(PlayerActionEvent caller, float beat)
{
Jukebox.PlayOneShotGame("tapTrial/tap");
player.anim.Play("Tap", 0, 0);
}
public void OnDoubleTap(PlayerActionEvent caller, float beat)
{
Jukebox.PlayOneShotGame("tapTrial/tap");
player.anim.Play("DoubleTap", 0, 0);
}
public void OnTapMiss(PlayerActionEvent caller)
{
}
public void OnEmpty(PlayerActionEvent caller)
{
//empty
}
public void DoubleTap(float beat)
@ -59,13 +124,24 @@ namespace HeavenStudio.Games
player.anim.Play("DoubleTapPrepare", 0, 0);
GameObject beatAction = new GameObject();
beatAction.transform.SetParent(this.transform);
BeatAction.New(beatAction, new List<BeatAction.Action>()
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.0f, delegate { CreateTap(beat, 1); }),
new BeatAction.Action(beat + 0.5f, delegate { CreateTap(beat + 0.5f, 1); }),
new BeatAction.Action(beat, delegate { monkeys[0].Play("DoubleTapPrepare", 0, 0); }),
new BeatAction.Action(beat + .5f, delegate { monkeys[0].Play("DoubleTapPrepare_2", 0, 0); }),
new BeatAction.Action(beat + 1f, delegate { monkeys[0].Play("DoubleTap", 0, 0); }),
new BeatAction.Action(beat + 1.5f, delegate { monkeys[0].Play("DoubleTap", 0, 0); }),
});
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { monkeys[1].Play("DoubleTapPrepare", 0, 0); }),
new BeatAction.Action(beat + .5f, delegate { monkeys[1].Play("DoubleTapPrepare_2", 0, 0); }),
new BeatAction.Action(beat + 1f, delegate { monkeys[1].Play("DoubleTap", 0, 0); }),
new BeatAction.Action(beat + 1.5f, delegate { monkeys[1].Play("DoubleTap", 0, 0); }),
});
ScheduleInput(beat, 1f, InputType.STANDARD_DOWN, OnDoubleTap, OnTapMiss, OnEmpty);
ScheduleInput(beat, 1.5f, InputType.STANDARD_DOWN, OnDoubleTap, OnTapMiss, OnEmpty);
}
public void TripleTap(float beat)
@ -76,17 +152,38 @@ namespace HeavenStudio.Games
new MultiSound.Sound("tapTrial/ooki2", beat + 0.5f)
});
player.anim.Play("PosePrepare", 0, 0);
//player.anim.Play("PosePrepare", 0, 0);
player.tripleOffset = 0;
GameObject beatAction = new GameObject();
beatAction.transform.SetParent(this.transform);
BeatAction.New(beatAction, new List<BeatAction.Action>()
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 1.0f, delegate { CreateTap(beat + 1.0f, 2); }),
new BeatAction.Action(beat + 1.5f, delegate { CreateTap(beat + 1.5f, 2); }),
new BeatAction.Action(beat + 2.0f, delegate { CreateTap(beat + 2.0f, 2); }),
new BeatAction.Action(beat, delegate { player.anim.Play("PosePrepare_1", 0, 0);}),
new BeatAction.Action(beat + .5f, delegate { player.anim.Play("PosePrepare_2", 0, 0);}),
});
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { monkeys[0].Play("PostPrepare_1", 0, 0); }),
new BeatAction.Action(beat + .5f, delegate { monkeys[0].Play("PostPrepare_2", 0, 0); }),
new BeatAction.Action(beat + 2f, delegate { monkeys[0].Play("PostTap", 0, 0); }),
new BeatAction.Action(beat + 2.5f, delegate { monkeys[0].Play("PostTap", 0, 0);}),
new BeatAction.Action(beat + 3f, delegate { monkeys[0].Play("PostTap", 0, 0);}),
});
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { monkeys[1].Play("PostPrepare_1", 0, 0); }),
new BeatAction.Action(beat + .5f, delegate { monkeys[1].Play("PostPrepare_2", 0, 0); }),
new BeatAction.Action(beat + 2f, delegate { monkeys[1].Play("PostTap", 0, 0); }),
new BeatAction.Action(beat + 2.5f, delegate { monkeys[1].Play("PostTap", 0, 0);}),
new BeatAction.Action(beat + 3f, delegate { monkeys[1].Play("PostTap", 0, 0);}),
});
ScheduleInput(beat, 2f, InputType.STANDARD_DOWN, OnTap, OnTapMiss, OnEmpty);
ScheduleInput(beat, 2.5f, InputType.STANDARD_DOWN, OnDoubleTap, OnTapMiss, OnEmpty);
ScheduleInput(beat, 3f, InputType.STANDARD_DOWN, OnTap, OnTapMiss, OnEmpty);
}
public void JumpTap(float beat)

View File

@ -21,6 +21,15 @@ namespace HeavenStudio
public static string levelLocation;
public static bool officialLevel;
public static int CustomScreenWidth = 1280;
public static int CustomScreenHeight = 720;
public static readonly (int width, int height)[] DEFAULT_SCREEN_SIZES = new[] { (1280, 720), (1920, 1080), (2560, 1440), (3840, 2160)};
public static readonly string[] DEFAULT_SCREEN_SIZES_STRING = new[] { "1280x720", "1920x1080", "2560x1440", "3840x2160", "Custom" };
public static int ScreenSizeIndex = 0;
public static float MasterVolume = 0.8f;
public enum Scenes : int
{
SplashScreen = 0,
@ -97,6 +106,40 @@ namespace HeavenStudio
fade.GetComponent<SpriteRenderer>().color = new Color(0, 0, 0, 0);
fade.GetComponent<SpriteRenderer>().DOColor(Color.black, fadeDuration).OnComplete(() => { SceneManager.LoadScene(loadedScene); fade.GetComponent<SpriteRenderer>().DOColor(new Color(0, 0, 0, 0), fadeDuration).OnComplete(() => { Destroy(fade); }); });
}
}
public static void WindowFullScreen()
{
Debug.Log("WindowFullScreen");
if (!Screen.fullScreen)
{
// Set the resolution to the display's current resolution
Screen.SetResolution(Display.main.systemWidth, Display.main.systemHeight, FullScreenMode.FullScreenWindow);
Screen.fullScreen = true;
}
else
{
Screen.SetResolution(1280, 720, FullScreenMode.Windowed);
Screen.fullScreen = false;
}
}
public static void ChangeScreenSize()
{
FullScreenMode mode = Screen.fullScreenMode;
if (ScreenSizeIndex == DEFAULT_SCREEN_SIZES_STRING.Length - 1)
{
Screen.SetResolution(CustomScreenWidth, CustomScreenHeight, mode);
}
else
{
Screen.SetResolution(DEFAULT_SCREEN_SIZES[ScreenSizeIndex].width, DEFAULT_SCREEN_SIZES[ScreenSizeIndex].height, mode);
}
}
public static void ChangeMasterVolume(float value)
{
MasterVolume = value;
AudioListener.volume = MasterVolume;
}
}
}

View File

@ -171,4 +171,38 @@ namespace HeavenStudio.Editor.Commands
}
}
}
public class Duplicate : IAction
{
List<TimelineEventObj> eventObjs;
List<TimelineEventObj> copiedObjs;
public Duplicate(List<TimelineEventObj> eventObjs)
{
this.eventObjs = eventObjs;
}
public void Execute()
{
}
public void Redo()
{
for (int i = 0; i < copiedObjs.Count; i++)
{
Beatmap.Entity e = copiedObjs[i].entity;
eventObjs[i] = Timeline.instance.AddEventObject(e.datamodel, false, new Vector3(e.beat, -e.track * Timeline.instance.LayerHeight()), e, true, e.eventObj.eventObjID);
}
}
public void Undo()
{
copiedObjs = eventObjs;
for (int i = 0; i < eventObjs.Count; i++)
{
Selections.instance.Deselect(eventObjs[i]);
Timeline.instance.DestroyEventObject(eventObjs[i].entity);
}
}
}
}

View File

@ -9,10 +9,8 @@ namespace HeavenStudio.Editor
{
public EventParameterManager eventParameterManager;
// this is programmed on duct tape https://youtu.be/zMWA0ipQ94w?t=868
private void LateUpdate()
{
eventParameterManager.canDisable = true;
for (int i = 0; i < transform.childCount; i++)
{
if (Editor.MouseInRectTransform(transform.GetChild(i).GetComponent<RectTransform>()))

View File

@ -13,6 +13,7 @@ using TMPro;
using Starpelly;
using SFB;
using HeavenStudio.Editor;
using HeavenStudio.Editor.Track;
using HeavenStudio.Util;
@ -63,10 +64,11 @@ namespace HeavenStudio.Editor
private bool loadedMusic = false;
private string currentRemixPath = "";
private string remixName = "";
private bool fullscreen;
public bool fullscreen;
public bool discordDuringTesting = false;
public bool canSelect = true;
public bool editingInputField = false;
public bool isCursorEnabled = true;
public static Editor instance { get; private set; }
@ -199,7 +201,8 @@ namespace HeavenStudio.Editor
for (int i = 0; i < selectedEvents.Count; i++)
{
if (selectedEvents[i].isCreating == false)
//TODO: this is in LateUpdate, so this will never run! change this to something that works properly
if (!(selectedEvents[i].isCreating || selectedEvents[i].wasDuplicated))
{
result.Add(selectedEvents[i]);
}
@ -412,6 +415,7 @@ namespace HeavenStudio.Editor
bytes = ms.ToArray();
Conductor.instance.musicSource.clip = OggVorbis.VorbisPlugin.ToAudioClip(bytes, "music");
loadedMusic = true;
Timeline.FitToSong();
}
}
}
@ -455,7 +459,7 @@ namespace HeavenStudio.Editor
MainCanvas.enabled = true;
EditorCamera.enabled = true;
GameCamera.instance.camera.targetTexture = ScreenRenderTexture;
GameManager.instance.CursorCam.enabled = true;
GameManager.instance.CursorCam.enabled = true && isCursorEnabled;
GameManager.instance.OverlayCamera.targetTexture = ScreenRenderTexture;
fullscreen = false;

View File

@ -49,6 +49,7 @@ namespace HeavenStudio.Editor
Disable();
}
}
canDisable = true;
}
public void Disable()

View File

@ -10,6 +10,7 @@ namespace HeavenStudio.Editor
public class SettingsDialog : MonoBehaviour
{
[SerializeField] private GameObject settingsMenu;
//this may all be moved to a different script in the future
private void Start() {}

View File

@ -0,0 +1,20 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HeavenStudio.Editor.Track;
using TMPro;
namespace HeavenStudio.Editor
{
public class TabButton : MonoBehaviour
{
[SerializeField] GameObject Content;
public void OnClick()
{
var tabsManager = transform.parent.GetComponent<TabsManager>();
tabsManager.SetActiveContent(Content);
}
}
}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: f32d53b1d58c64e41b71bd7520435169
guid: 72c5153eb89ce5d4eb324d72a9627670
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f40824f5d4f2d0545ab42811c01c4470
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,54 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HeavenStudio.Editor.Track;
using HeavenStudio.Util;
using HeavenStudio.StudioDance;
using TMPro;
namespace HeavenStudio.Editor
{
public class CreditsLegalSettings : MonoBehaviour
{
private int SecretCounter = 0;
private bool SecretActive = false;
[SerializeField] private GameObject secretObject;
[SerializeField] private StudioDanceManager secretContent;
private void Start()
{
SecretCounter = 0;
secretObject.SetActive(false);
}
public void OnClickCountUp()
{
SecretCounter++;
Debug.Log("SecretCounter: " + SecretCounter);
if (SecretCounter == 10)
{
secretObject.SetActive(true);
}
}
public void OnClickSecret()
{
if (SecretActive) return;
SecretActive = true;
Jukebox.PlayOneShot("applause");
Debug.Log("Activating Studio Dance...");
secretContent.OpenDanceWindow();
}
public void MakeSecretInactive()
{
SecretCounter = 0;
secretObject.SetActive(false);
SecretActive = false;
secretContent.CloseDanceWindow();
}
}
}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 1b489f3aef16a65499f9596abda39c35
guid: 406705ab8ec428e439d9138fd4984a9e
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@ -0,0 +1,75 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
namespace HeavenStudio.Editor
{
public class DispAudioSettings : MonoBehaviour
{
public TMP_Dropdown resolutionsDropdown;
public GameObject customSetter;
public TMP_InputField widthInputField, heightInputField;
public Slider volSlider;
public TMP_InputField volLabel;
private void Start() {
List<TMP_Dropdown.OptionData> dropDownData = new List<TMP_Dropdown.OptionData>();
var vals = GlobalGameManager.DEFAULT_SCREEN_SIZES_STRING;
for (int i = 0; i < vals.Length; i++)
{
TMP_Dropdown.OptionData optionData = new TMP_Dropdown.OptionData();
optionData.text = vals[i];
dropDownData.Add(optionData);
}
resolutionsDropdown.AddOptions(dropDownData);
resolutionsDropdown.value = GlobalGameManager.ScreenSizeIndex;
resolutionsDropdown.onValueChanged.AddListener(delegate
{
GlobalGameManager.ScreenSizeIndex = resolutionsDropdown.value;
customSetter.SetActive(resolutionsDropdown.value == GlobalGameManager.DEFAULT_SCREEN_SIZES_STRING.Length - 1);
});
widthInputField.onEndEdit.AddListener(delegate
{
GlobalGameManager.CustomScreenWidth = System.Math.Max(int.Parse(widthInputField.text), 64);
widthInputField.text = GlobalGameManager.CustomScreenWidth.ToString();
});
heightInputField.onEndEdit.AddListener(delegate
{
GlobalGameManager.CustomScreenHeight = System.Math.Max(int.Parse(heightInputField.text), 64);
heightInputField.text = GlobalGameManager.CustomScreenHeight.ToString();
});
volSlider.value = GlobalGameManager.MasterVolume;
volLabel.text = System.Math.Round(volSlider.value * 100, 2).ToString();
}
public void WindowFullScreen()
{
GlobalGameManager.WindowFullScreen();
}
public void WindowConfirmSize()
{
GlobalGameManager.ChangeScreenSize();
}
public void OnVolSliderChanged()
{
GlobalGameManager.ChangeMasterVolume(volSlider.value);
volLabel.text = System.Math.Round(volSlider.value * 100, 2).ToString();
}
public void OnVolLabelChanged()
{
volSlider.value = (float)System.Math.Round(System.Convert.ToSingle(volLabel.text), 2);
GlobalGameManager.ChangeMasterVolume(volSlider.value);
}
}
}

View File

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

View File

@ -0,0 +1,20 @@
using UnityEngine;
using UnityEngine.UI;
using TMPro;
namespace HeavenStudio.Editor
{
public class EditorSettings : MonoBehaviour
{
public Toggle cursorCheckbox;
public void OnCursorCheckboxChanged()
{
Editor.instance.isCursorEnabled = cursorCheckbox.isOn;
if (!Editor.instance.fullscreen)
{
GameManager.instance.CursorCam.enabled = Editor.instance.isCursorEnabled;
}
}
}
}

View File

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

View File

@ -0,0 +1,24 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HeavenStudio.Editor.Track;
using TMPro;
namespace HeavenStudio.Editor
{
public class TabsManager : MonoBehaviour
{
[SerializeField] GameObject activeContent;
public void SetActiveContent(GameObject content)
{
if (activeContent != null)
{
activeContent.SetActive(false);
}
activeContent = content;
activeContent.SetActive(true);
}
}
}

View File

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

View File

@ -1,28 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace HeavenStudio.Editor
{
public class SnapDialog : MonoBehaviour
{
[SerializeField] private GameObject snapSetter;
private void Awake()
{
}
public void SwitchSnapDialog()
{
if(snapSetter.activeSelf) {
snapSetter.SetActive(false);
} else {
snapSetter.SetActive(true);
}
}
private void Update()
{
}
}
}

View File

@ -1,43 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace HeavenStudio.Editor
{
public class TempoFinder : MonoBehaviour
{
[SerializeField] private GameObject tempoFinder;
private bool pressed;
private float timePressed;
[SerializeField] private BPMText bpmText;
private void Awake()
{
pressed = false;
timePressed = 0f;
}
public void SwitchTempoDialog()
{
if(tempoFinder.activeSelf) {
tempoFinder.SetActive(false);
timePressed = 0;
bpmText.ResetText();
} else {
tempoFinder.SetActive(true);
}
}
public void TapBPM()
{
pressed = true;
}
private void Update()
{
timePressed += Time.deltaTime;
if(pressed)
{
pressed = false;
bpmText.ChangeText(timePressed);
timePressed = 0;
}
}
}
}

View File

@ -1,20 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
namespace HeavenStudio.Editor
{
public class TempoFinderButton : Button, IPointerDownHandler
{
public TempoFinder tempoFinder;
public override void OnPointerDown(PointerEventData eventData)
{
if (eventData.button == PointerEventData.InputButton.Left)
{
tempoFinder.TapBPM();
}
}
}
}

View File

@ -330,11 +330,10 @@ namespace HeavenStudio.Editor.Track
{
movingPlayback = true;
}
else if (Input.GetMouseButtonUp(1))
else if (Input.GetMouseButtonUp(1) || Conductor.instance.isPlaying)
{
movingPlayback = false;
}
if (movingPlayback)
{
RectTransformUtility.ScreenPointToLocalPointInRectangle(TimelineContent, Input.mousePosition, Editor.instance.EditorCamera, out lastMousePos);
@ -554,7 +553,7 @@ namespace HeavenStudio.Editor.Track
else
{
entity.eventObj = g.GetComponent<TimelineEventObj>();
entity.track = (int)(g.transform.localPosition.y / LayerHeight() * -1);
entity.track = entity.eventObj.GetTrack();
}
@ -611,14 +610,22 @@ namespace HeavenStudio.Editor.Track
return eventObj;
}
public TimelineEventObj CopyEventObject(Beatmap.Entity e)
private List<TimelineEventObj> duplicatedEventObjs = new List<TimelineEventObj>();
public TimelineEventObj CopyEventObject(TimelineEventObj e)
{
Beatmap.Entity clone = e.DeepCopy();
Beatmap.Entity clone = e.entity.DeepCopy();
TimelineEventObj dup = AddEventObject(clone.datamodel, false, new Vector3(clone.beat, -clone.track * Timeline.instance.LayerHeight()), clone, true, RandomID());
duplicatedEventObjs.Add(dup);
return dup;
}
public void FinalizeDuplicateEventStack()
{
CommandManager.instance.Execute(new Commands.Duplicate(duplicatedEventObjs));
duplicatedEventObjs = new List<TimelineEventObj>();
}
public void DestroyEventObject(Beatmap.Entity entity)
{
if (EventParameterManager.instance.entity == entity)
@ -645,12 +652,12 @@ namespace HeavenStudio.Editor.Track
public float SnapToLayer(float y)
{
float size = LayerHeight();
return Mathf.Clamp(Mathp.Round2Nearest(y, size), -size * 3, 0);
return Mathf.Clamp(Mathp.Round2Nearest(y, size), -size * 3f, 0f);
}
public float LayerHeight()
{
return LayersRect.rect.height / 4;
return LayersRect.rect.height / 4f;
}
public void SetPlaybackSpeed(float speed)

View File

@ -38,11 +38,10 @@ namespace HeavenStudio.Editor.Track
public bool resizable;
public bool resizing;
public bool moving;
public bool wasDuplicated;
private bool resizingLeft;
private bool resizingRight;
private bool inResizeRegion;
private bool wasDuplicated;
public Vector2 lastMovePos;
public bool isCreating;
public string eventObjID;
@ -60,8 +59,6 @@ namespace HeavenStudio.Editor.Track
Destroy(resizeGraphic.gameObject);
}
lastMovePos = transform.localPosition;
// what the fuck????
// moveTemp = new GameObject();
// moveTemp.transform.SetParent(this.transform.parent);
@ -120,7 +117,10 @@ namespace HeavenStudio.Editor.Track
selectedImage.gameObject.SetActive(true);
for (int i = 0; i < outline.childCount; i++)
{
outline.GetChild(i).GetComponent<Image>().color = Color.cyan;
if (moving)
outline.GetChild(i).GetComponent<Image>().color = Color.magenta;
else
outline.GetChild(i).GetComponent<Image>().color = Color.cyan;
}
}
else
@ -153,29 +153,33 @@ namespace HeavenStudio.Editor.Track
if (!resizing)
{
if (Input.GetMouseButtonUp(0) && Timeline.instance.timelineState.selected)
{
if (Timeline.instance.eventObjs.FindAll(c => c.mouseHovering).Count == 0 && Timeline.instance.eventObjs.FindAll(c => c.moving).Count == 0 && !BoxSelection.instance.selecting && Timeline.instance.eventObjs.FindAll(c => c.resizing).Count == 0)
{
if (!Input.GetKey(KeyCode.LeftShift))
{
// Selections.instance.Deselect(this);
}
}
// OnUp();
}
if (Timeline.instance.eventObjs.FindAll(c => c.moving).Count > 0 && selected)
{
//duplicate the entity if holding alt or r-click
if ((!wasDuplicated) && (Input.GetKey(KeyCode.LeftAlt) || Input.GetMouseButton(1)))
Vector3 mousePos = Editor.instance.EditorCamera.ScreenToWorldPoint(Input.mousePosition);
//duplicate the entity if holding alt or m-click
if ((!wasDuplicated) && (Input.GetKey(KeyCode.LeftAlt) || Input.GetMouseButton(2)))
{
wasDuplicated = true;
var te = Timeline.instance.CopyEventObject(entity);
Selections.instance.Deselect(this);
this.wasDuplicated = false;
this.moving = false;
var te = Timeline.instance.CopyEventObject(this);
Selections.instance.DragSelect(te);
te.wasDuplicated = true;
te.transform.localPosition = transform.localPosition;
te.lastPos_ = transform.localPosition;
for (int i = 0; i < Timeline.instance.eventObjs.Count; i++)
{
Timeline.instance.eventObjs[i].startPosX = mousePos.x - Timeline.instance.eventObjs[i].transform.position.x;
Timeline.instance.eventObjs[i].startPosY = mousePos.y - Timeline.instance.eventObjs[i].transform.position.y;
}
te.moving = true;
}
Vector3 mousePos = Editor.instance.EditorCamera.ScreenToWorldPoint(Input.mousePosition);
lastPos_ = transform.localPosition;
@ -192,6 +196,9 @@ namespace HeavenStudio.Editor.Track
}
else if (resizingLeft)
{
if (moving)
moving = false;
SetPivot(new Vector2(1, rectTransform.pivot.y));
Vector2 sizeDelta = rectTransform.sizeDelta;
@ -207,6 +214,9 @@ namespace HeavenStudio.Editor.Track
}
else if (resizingRight)
{
if (moving)
moving = false;
Vector2 sizeDelta = rectTransform.sizeDelta;
Vector2 mousePos;
@ -231,7 +241,12 @@ namespace HeavenStudio.Editor.Track
if (resizable)
Cursor.SetCursor(Resources.Load<Texture2D>("Cursors/horizontal_resize"), new Vector2(8, 8), CursorMode.Auto);
}
else if (Timeline.instance.eventObjs.FindAll(c => c.inResizeRegion).Count == 0 && Timeline.instance.eventObjs.FindAll(c => c.resizing).Count == 0)
// should consider adding this someday
// else if (moving && selected || mouseHovering && selected)
// {
// Cursor.SetCursor(Resources.Load<Texture2D>("Cursors/move"), new Vector2(8, 8), CursorMode.Auto);
// }
else
{
Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
}
@ -276,8 +291,6 @@ namespace HeavenStudio.Editor.Track
}
moving = true;
// lastMovePos = transform.localPosition;
// OnComplete();
}
}
else if (Input.GetMouseButton(1))
@ -293,13 +306,17 @@ namespace HeavenStudio.Editor.Track
if (selected && Timeline.instance.timelineState.selected)
{
if (wasDuplicated)
{
Timeline.instance.FinalizeDuplicateEventStack();
wasDuplicated = false;
}
if (eligibleToMove)
{
OnComplete(true);
}
moving = false;
wasDuplicated = false;
Cancel();
if (isCreating == true)
@ -390,7 +407,7 @@ namespace HeavenStudio.Editor.Track
private void OnMove()
{
if (GameManager.instance.Beatmap.entities.FindAll(c => c.beat == this.transform.localPosition.x && c.track == GetTrack()).Count > 0)
if (GameManager.instance.Beatmap.entities.FindAll(c => c.beat == this.transform.localPosition.x && c.track == GetTrack() && c != this.entity).Count > 0)
{
eligibleToMove = false;
}
@ -451,7 +468,7 @@ namespace HeavenStudio.Editor.Track
public int GetTrack()
{
return (int)(this.transform.localPosition.y / Timeline.instance.LayerHeight()) * -1;
return (int)Mathf.Round(this.transform.localPosition.y / Timeline.instance.LayerHeight()) * -1;
}
private void OnDestroy()

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 865b25422d0ff654cacdd7387de6873c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,57 @@
using UnityEngine;
using HeavenStudio.Util;
namespace HeavenStudio.StudioDance
{
public class Dancer : MonoBehaviour
{
private Animator animator;
private float lastReportedBeat = 0f;
private float currentBeat = 0f;
private bool isDance = false;
private void Start()
{
animator = GetComponent<Animator>();
}
private void Update()
{
var cond = Conductor.instance;
if (cond == null || !cond.isPlaying)
{
if (!isDance) return;
if (currentBeat % 2 != 0)
{
animator.DoScaledAnimationAsync("PoseL");
}
else
{
animator.DoScaledAnimationAsync("PoseR");
}
isDance = false;
return;
}
isDance = true;
if (cond.ReportBeat(ref lastReportedBeat))
{
currentBeat = lastReportedBeat;
}
else if (cond.songPositionInBeats < lastReportedBeat)
{
lastReportedBeat = Mathf.Round(cond.songPositionInBeats);
}
if (currentBeat % 2 != 0)
{
animator.DoScaledAnimation("DanceL", currentBeat);
}
else
{
animator.DoScaledAnimation("DanceR", currentBeat);
}
}
}
}

View File

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

View File

@ -0,0 +1,26 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HeavenStudio;
namespace HeavenStudio.StudioDance
{
public class StudioDanceManager : MonoBehaviour
{
[SerializeField] private GameObject windowBase;
[SerializeField] private Transform windowHolder;
[SerializeField] private GameObject content;
public void OpenDanceWindow()
{
var mobj = GameObject.Instantiate(windowBase, windowHolder);
mobj.SetActive(true);
content.SetActive(true);
}
public void CloseDanceWindow()
{
content.SetActive(false);
}
}
}

View File

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