From 06ef8986c77dd62d9fe87959fcc6a2f20ebc0775 Mon Sep 17 00:00:00 2001 From: Braedon Date: Mon, 17 Jan 2022 14:23:18 -0500 Subject: [PATCH] Buggy timeline object resizing --- Assets/Resources/Cursors.meta | 8 + .../Resources/Cursors/horizontal_resize.png | Bin 0 -> 181 bytes .../Cursors/horizontal_resize.png.meta | 120 ++++++ Assets/Scenes/Editor.unity | 353 +++++++++++++++++- Assets/Scripts/EventCaller.cs | 111 +----- Assets/Scripts/GameManager.cs | 4 +- .../Games/ForkLifter/ForkLifterPlayer.cs | 7 +- Assets/Scripts/Games/KarateMan/KarateJoe.cs | 16 +- .../EventSelector/GridGameSelector.cs | 2 +- Assets/Scripts/LevelEditor/Timeline.cs | 27 +- .../Scripts/LevelEditor/TimelineEventObj.cs | 196 ++++++++-- Assets/Scripts/Minigames.cs | 101 +++++ Assets/Scripts/Minigames.cs.meta | 11 + 13 files changed, 798 insertions(+), 158 deletions(-) create mode 100644 Assets/Resources/Cursors.meta create mode 100644 Assets/Resources/Cursors/horizontal_resize.png create mode 100644 Assets/Resources/Cursors/horizontal_resize.png.meta create mode 100644 Assets/Scripts/Minigames.cs create mode 100644 Assets/Scripts/Minigames.cs.meta diff --git a/Assets/Resources/Cursors.meta b/Assets/Resources/Cursors.meta new file mode 100644 index 000000000..c4b094331 --- /dev/null +++ b/Assets/Resources/Cursors.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ec1e8097a1b4776448cb5c472786c398 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Cursors/horizontal_resize.png b/Assets/Resources/Cursors/horizontal_resize.png new file mode 100644 index 0000000000000000000000000000000000000000..4455290ddcffa96d0b9cb52a8d4e4ecb89a9ed63 GIT binary patch literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJ8c!F;kcif|ldbs<7;rcjPW>H! zQ&wte<22qYe09-wUGjo6I2BudNKE)5&2aXN$08Gr%I_W17X_%QOh4hgz}jZAL}Z1@ z+X)JsF|Yrfy3g>S`hjrgTkCheQ}_-jrA;_8gS|s2HhD+;?A%}jRV`y minigames = new List() + public List minigames = new List() { }; - [Serializable] - public class MiniGame - { - public string name; - public string displayName; - public string color; - public GameObject holder; - public List actions = new List(); - - public MiniGame(string name, string displayName, string color, List actions) - { - this.name = name; - this.displayName = displayName; - this.color = color; - this.actions = actions; - } - } - - public class GameAction - { - public string actionName; - public EventCallback function; - public bool playerAction = false; - public float defaultLength; - public bool resizable; - - public GameAction(string actionName, EventCallback function, float defaultLength = 1, bool playerAction = false, bool resizable = false) - { - this.actionName = actionName; - this.function = function; - this.playerAction = playerAction; - this.defaultLength = defaultLength; - this.resizable = resizable; - } - } - - public MiniGame GetMinigame(string gameName) + public Minigames.Minigame GetMinigame(string gameName) { return minigames.Find(c => c.name == gameName); } - public GameAction GetGameAction(MiniGame game, string action) + public Minigames.GameAction GetGameAction(Minigames.Minigame game, string action) { return game.actions.Find(c => c.actionName == action); } @@ -79,52 +36,10 @@ namespace RhythmHeavenMania public void Init() { instance = this; - minigames = new List() - { - new MiniGame("gameManager", "Game Manager", "", new List() - { - new GameAction("end", delegate { Debug.Log("end"); }), - new GameAction("switchGame", delegate { GameManager.instance.SwitchGame(currentSwitchGame); }) - }), - new MiniGame("forkLifter", "Fork Lifter", "FFFFFF", new List() - { - new GameAction("pea", delegate { ForkLifter.instance.Flick(currentBeat, 0); }, 3, true), - new GameAction("topbun", delegate { ForkLifter.instance.Flick(currentBeat, 1); }, 3, true), - new GameAction("burger", delegate { ForkLifter.instance.Flick(currentBeat, 2); }, 3, true), - new GameAction("bottombun", delegate { ForkLifter.instance.Flick(currentBeat, 3); }, 3, true), - new GameAction("prepare", delegate { ForkLifter.instance.ForkLifterHand.Prepare(); }, 0.5f, true), - new GameAction("gulp", delegate { ForkLifterPlayer.instance.Eat(); }), - new GameAction("sigh", delegate { Jukebox.PlayOneShot("sigh"); }) - }), - new MiniGame("clappyTrio", "The Clappy Trio", "29E7FF", new List() - { - new GameAction("clap", delegate { ClappyTrio.instance.Clap(currentBeat, currentLength); }, 3, true), - new GameAction("bop", delegate { ClappyTrio.instance.Bop(currentBeat); } ), - new GameAction("prepare", delegate { ClappyTrio.instance.Prepare(0); } ), - new GameAction("prepare_alt", delegate { ClappyTrio.instance.Prepare(3); } ), - }), - new MiniGame("spaceball", "Spaceball", "00A518", new List() - { - new GameAction("shoot", delegate { Spaceball.instance.Shoot(currentBeat, false, currentType); }, 2, true), - new GameAction("shootHigh", delegate { Spaceball.instance.Shoot(currentBeat, true, currentType); }, 3, true), - new GameAction("costume", delegate { Spaceball.instance.Costume(currentType); } ), - new GameAction("alien", delegate { Spaceball.instance.alien.Show(currentBeat); } ), - new GameAction("cameraZoom", delegate { } ), - }), - new MiniGame("karateman", "Karate Man", "70A8D8", new List() - { - new GameAction("bop", delegate { KarateMan.instance.Bop(currentBeat, currentLength); }, 0.5f, true, true), - new GameAction("pot", delegate { KarateMan.instance.Shoot(currentBeat, 0); }, 2, true), - new GameAction("bulb", delegate { KarateMan.instance.Shoot(currentBeat, 1); }, 2, true), - new GameAction("rock", delegate { KarateMan.instance.Shoot(currentBeat, 2); }, 2, true), - new GameAction("ball", delegate { KarateMan.instance.Shoot(currentBeat, 3); }, 2, true), - new GameAction("kick", delegate { KarateMan.instance.Shoot(currentBeat, 4); }, 4.5f, true), - new GameAction("bgfxon", delegate { KarateMan.instance.BGFXOn(); } ), - new GameAction("bgfxoff", delegate { KarateMan.instance.BGFXOff(); }), - }) - }; - List minigamesInBeatmap = new List(); + Minigames.Init(this); + + List minigamesInBeatmap = new List(); for (int i = 0; i < GameManager.instance.Beatmap.entities.Count; i++) { if (!minigamesInBeatmap.Contains(minigames.Find(c => c.name == GameManager.instance.Beatmap.entities[i].datamodel.Split('/')[0])) && GameManager.instance.Beatmap.entities[i].datamodel.Split('/')[0] != "gameManager") @@ -164,7 +79,7 @@ namespace RhythmHeavenMania public void CallEvent(string event_) { string[] details = event_.Split('/'); - MiniGame game = minigames.Find(c => c.name == details[0]); + Minigames.Minigame game = minigames.Find(c => c.name == details[0]); try { @@ -174,7 +89,7 @@ namespace RhythmHeavenMania if (details.Length > 2) currentSwitchGame = details[2]; - GameAction action = game.actions.Find(c => c.actionName == details[1]); + Minigames.GameAction action = game.actions.Find(c => c.actionName == details[1]); action.function.Invoke(); if (action.playerAction == true) diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index d6027d933..5fd4b24d7 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -279,13 +279,13 @@ namespace RhythmHeavenMania preloadedGames.Add(g); } - public EventCaller.MiniGame GetGame(string name) + public Minigames.Minigame GetGame(string name) { return eventCaller.minigames.Find(c => c.name == name); } // never gonna use this - public EventCaller.MiniGame GetCurrentGame() + public Minigames.Minigame GetCurrentGame() { return eventCaller.minigames.Find(c => c.name == transform.GetComponentsInChildren()[1].name); } diff --git a/Assets/Scripts/Games/ForkLifter/ForkLifterPlayer.cs b/Assets/Scripts/Games/ForkLifter/ForkLifterPlayer.cs index 0dd93c5c2..054aac212 100644 --- a/Assets/Scripts/Games/ForkLifter/ForkLifterPlayer.cs +++ b/Assets/Scripts/Games/ForkLifter/ForkLifterPlayer.cs @@ -251,12 +251,11 @@ namespace RhythmHeavenMania.Games.ForkLifter RemovePea(); } } - else - { - Jukebox.PlayOneShotGame("forkLifter/stabnohit"); - } } + if (!canHit) + Jukebox.PlayOneShotGame("forkLifter/stabnohit", false); + anim.Play("Player_Stab", 0, 0); } diff --git a/Assets/Scripts/Games/KarateMan/KarateJoe.cs b/Assets/Scripts/Games/KarateMan/KarateJoe.cs index 7c6ee4d74..ca9f14b23 100644 --- a/Assets/Scripts/Games/KarateMan/KarateJoe.cs +++ b/Assets/Scripts/Games/KarateMan/KarateJoe.cs @@ -162,15 +162,15 @@ namespace RhythmHeavenMania.Games.KarateMan p.isEligible = false; p.RemoveObject(currentHitInList); } - else - { - Jukebox.PlayOneShotGame("karateman/swingNoHit"); - } - if (punchLeft) - anim.Play("PunchLeft", 0, 0); - else - anim.Play("PunchRight", 0, 0); } + + if (!canHit) + Jukebox.PlayOneShotGame("karateman/swingNoHit"); + + if (punchLeft) + anim.Play("PunchLeft", 0, 0); + else + anim.Play("PunchRight", 0, 0); } public void HitEffectF(Vector3 pos) diff --git a/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs b/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs index c56ae1538..2a8141f53 100644 --- a/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs +++ b/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs @@ -20,7 +20,7 @@ namespace RhythmHeavenMania.Editor private RectTransform eventsParent; [Header("Properties")] - private EventCaller.MiniGame mg; + private Minigames.Minigame mg; private bool gameOpen; [SerializeField] private int currentEventIndex; private int dragTimes; diff --git a/Assets/Scripts/LevelEditor/Timeline.cs b/Assets/Scripts/LevelEditor/Timeline.cs index 5ef7dd156..9bf6df0b3 100644 --- a/Assets/Scripts/LevelEditor/Timeline.cs +++ b/Assets/Scripts/LevelEditor/Timeline.cs @@ -21,6 +21,7 @@ namespace RhythmHeavenMania.Editor private bool lastFrameDrag; public int LayerCount = 4; public bool metronomeEnabled; + public bool resizable; [Header("Timeline Components")] [SerializeField] private RectTransform TimelineSlider; @@ -305,13 +306,28 @@ namespace RhythmHeavenMania.Editor else eventObj.Icon.sprite = Editor.GameIcon(eventName.Split(0)); - EventCaller.GameAction gameAction = EventCaller.instance.GetGameAction(EventCaller.instance.GetMinigame(eventName.Split(0)), eventName.Split(1)); + Minigames.GameAction gameAction = EventCaller.instance.GetGameAction(EventCaller.instance.GetMinigame(eventName.Split(0)), eventName.Split(1)); if (gameAction != null) { - g.GetComponent().sizeDelta = new Vector2(gameAction.defaultLength, LayerHeight()); - float length = gameAction.defaultLength; - eventObj.length = length; + if (gameAction.resizable == false) + { + g.GetComponent().sizeDelta = new Vector2(gameAction.defaultLength, LayerHeight()); + float length = gameAction.defaultLength; + eventObj.length = length; + } + else + { + eventObj.resizable = true; + if (gameAction.defaultLength != GameManager.instance.Beatmap.entities[entityId].length) + { + g.GetComponent().sizeDelta = new Vector2(GameManager.instance.Beatmap.entities[entityId].length, LayerHeight()); + } + else + { + g.GetComponent().sizeDelta = new Vector2(gameAction.defaultLength, LayerHeight()); + } + } } g.SetActive(true); @@ -335,7 +351,6 @@ namespace RhythmHeavenMania.Editor else { var entity = GameManager.instance.Beatmap.entities[entityId]; - var e = GameManager.instance.Beatmap.entities[entityId]; entity.eventObj = g.GetComponent(); entity.track = (int)(g.transform.localPosition.y / LayerHeight() * -1); @@ -361,7 +376,7 @@ namespace RhythmHeavenMania.Editor public bool IsEventsDragging() { - return Timeline.instance.eventObjs.FindAll(c => c.isDragging == true).Count > 0; + return eventObjs.FindAll(c => c.isDragging == true).Count > 0 || eventObjs.FindAll(c => c.resizing == true).Count > 0; } public float SnapToLayer(float y) diff --git a/Assets/Scripts/LevelEditor/TimelineEventObj.cs b/Assets/Scripts/LevelEditor/TimelineEventObj.cs index 0edc13f37..02a396310 100644 --- a/Assets/Scripts/LevelEditor/TimelineEventObj.cs +++ b/Assets/Scripts/LevelEditor/TimelineEventObj.cs @@ -15,6 +15,7 @@ namespace RhythmHeavenMania.Editor public bool isDragging; private Vector3 lastPos; + private RectTransform rectTransform; [Header("Components")] [SerializeField] private RectTransform PosPreview; @@ -28,15 +29,28 @@ namespace RhythmHeavenMania.Editor private bool lastVisible; public bool selected; public bool mouseHovering; + public bool resizable; + public bool resizing; [Header("Colors")] public Color NormalCol; + private void Start() + { + rectTransform = GetComponent(); + + if (!resizable) + { + Destroy(transform.GetChild(5).gameObject); + Destroy(transform.GetChild(6).gameObject); + } + } + private void Update() { entity = GameManager.instance.Beatmap.entities.Find(a => a.eventObj == this); - mouseHovering = RectTransformUtility.RectangleContainsScreenPoint(GetComponent(), Input.mousePosition, Camera.main); + mouseHovering = RectTransformUtility.RectangleContainsScreenPoint(rectTransform, Input.mousePosition, Camera.main); #region Optimizations @@ -67,7 +81,25 @@ namespace RhythmHeavenMania.Editor transform.GetChild(3).gameObject.SetActive(true); for (int i = 0; i < transform.GetChild(4).childCount; i++) + { transform.GetChild(4).GetChild(i).GetComponent().color = Color.cyan; + } + + Vector3 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition); + + Vector3[] v = new Vector3[4]; + rectTransform.GetWorldCorners(v); + + if (mouseHovering) + { + if (mousePos.x > transform.position.x && mousePos.x < transform.position.x + 0.1f) + { + } + else if (mousePos.x > v[3].x - 0.1f && mousePos.x < v[3].x) + { + + } + } } else { @@ -83,50 +115,143 @@ namespace RhythmHeavenMania.Editor return; } - - if (Input.GetMouseButtonDown(0) && Timeline.instance.IsMouseAboveEvents()) + if (!resizing) { - if (selected) + if (Input.GetMouseButtonDown(0) && Timeline.instance.IsMouseAboveEvents()) + { + if (selected) + { + Vector3 mousePos; + mousePos = Input.mousePosition; + mousePos = Camera.main.ScreenToWorldPoint(mousePos); + startPosX = mousePos.x - this.transform.position.x; + startPosY = mousePos.y - this.transform.position.y; + + isDragging = true; + } + } + else if (Input.GetMouseButtonUp(0)) + { + if (!mouseHovering && !isDragging && !BoxSelection.instance.selecting) + { + if (!Input.GetKey(KeyCode.LeftShift)) + { + Selections.instance.Deselect(this); + } + } + + OnUp(); + } + if (isDragging && selected) { Vector3 mousePos; mousePos = Input.mousePosition; mousePos = Camera.main.ScreenToWorldPoint(mousePos); - startPosX = mousePos.x - this.transform.position.x; - startPosY = mousePos.y - this.transform.position.y; - isDragging = true; + this.transform.position = new Vector3(mousePos.x - startPosX, mousePos.y - startPosY - 0.40f, 0); + this.transform.localPosition = new Vector3(Mathf.Clamp(Mathp.Round2Nearest(this.transform.localPosition.x, 0.25f), 0, Mathf.Infinity), Timeline.instance.SnapToLayer(this.transform.localPosition.y)); + + if (lastPos != transform.localPosition) + OnMove(); + + lastPos = this.transform.localPosition; } } - else if (Input.GetMouseButtonUp(0)) - { - if (!mouseHovering && !isDragging && !BoxSelection.instance.selecting) - { - if (!Input.GetKey(KeyCode.LeftShift)) - { - Selections.instance.Deselect(this); - } - } - - OnUp(); - } - - if (isDragging && selected) - { - Vector3 mousePos; - mousePos = Input.mousePosition; - mousePos = Camera.main.ScreenToWorldPoint(mousePos); - - this.transform.position = new Vector3(mousePos.x - startPosX, mousePos.y - startPosY - 0.40f, 0); - this.transform.localPosition = new Vector3(Mathf.Clamp(Mathp.Round2Nearest(this.transform.localPosition.x, 0.25f), 0, Mathf.Infinity), Timeline.instance.SnapToLayer(this.transform.localPosition.y)); - - if (lastPos != transform.localPosition) - OnMove(); - - lastPos = this.transform.localPosition; - } } + #region ResizeEvents + + public void DragEnter() + { + if (selected) + Cursor.SetCursor(Resources.Load("Cursors/horizontal_resize"), new Vector2(8, 8), CursorMode.Auto); + } + + public void DragExit() + { + if (!resizing) + Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto); + } + + public void OnLeftDown() + { + if (selected) + { + SetPivot(new Vector2(1, rectTransform.pivot.y)); + resizing = true; + } + } + + public void DragLeft() + { + if (!resizing) return; + + Vector2 sizeDelta = rectTransform.sizeDelta; + + Vector2 mousePos; + RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, Input.mousePosition, Camera.main, out mousePos); + + sizeDelta = new Vector2(-mousePos.x + 0.1f, sizeDelta.y); + sizeDelta = new Vector2(Mathf.Clamp(sizeDelta.x, 0.25f, rectTransform.localPosition.x), sizeDelta.y); + + rectTransform.sizeDelta = new Vector2(Mathp.Round2Nearest(sizeDelta.x, 0.25f), sizeDelta.y); + } + + public void OnLeftUp() + { + SetPivot(new Vector2(0, rectTransform.pivot.y)); + resizing = false; + OnComplete(); + } + + public void OnRightDown() + { + if (selected) + { + SetPivot(new Vector2(0, rectTransform.pivot.y)); + resizing = true; + } + } + + public void DragRight() + { + if (!resizing) return; + // if (!mouseHovering) return; + + Vector2 sizeDelta = rectTransform.sizeDelta; + + Vector2 mousePos; + RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, Input.mousePosition, Camera.main, out mousePos); + + sizeDelta = new Vector2(mousePos.x, sizeDelta.y); + sizeDelta = new Vector2(Mathf.Clamp(sizeDelta.x, 0.25f, Mathf.Infinity), sizeDelta.y); + + rectTransform.sizeDelta = new Vector2(Mathp.Round2Nearest(sizeDelta.x, 0.25f), sizeDelta.y); + } + + public void OnRightUp() + { + resizing = false; + + OnComplete(); + } + + private void SetPivot(Vector2 pivot) + { + if (rectTransform == null) return; + + Vector2 size = rectTransform.rect.size; + Vector2 deltaPivot = rectTransform.pivot - pivot; + Vector3 deltaPosition = new Vector3(deltaPivot.x * size.x, deltaPivot.y * size.y); + rectTransform.pivot = pivot; + rectTransform.localPosition -= deltaPosition; + } + + #endregion + + #region OnEvents + private void OnMove() { if (GameManager.instance.Beatmap.entities.FindAll(c => c.beat == this.transform.localPosition.x && c.track == GetTrack()).Count > 0) @@ -141,11 +266,14 @@ namespace RhythmHeavenMania.Editor private void OnComplete() { + entity.length = rectTransform.sizeDelta.x; entity.beat = this.transform.localPosition.x; GameManager.instance.SortEventsList(); entity.track = GetTrack(); } + #endregion + #region ClickEvents public void OnDown() diff --git a/Assets/Scripts/Minigames.cs b/Assets/Scripts/Minigames.cs new file mode 100644 index 000000000..816b78b98 --- /dev/null +++ b/Assets/Scripts/Minigames.cs @@ -0,0 +1,101 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +using RhythmHeavenMania.Util; + +using RhythmHeavenMania.Games.ForkLifter; +using RhythmHeavenMania.Games.ClappyTrio; +using RhythmHeavenMania.Games.Spaceball; +using RhythmHeavenMania.Games.KarateMan; + +namespace RhythmHeavenMania +{ + public class Minigames + { + public class Minigame + { + public string name; + public string displayName; + public string color; + public GameObject holder; + public List actions = new List(); + + public Minigame(string name, string displayName, string color, List actions) + { + this.name = name; + this.displayName = displayName; + this.color = color; + this.actions = actions; + } + } + + public class GameAction + { + public string actionName; + public EventCallback function; + public bool playerAction = false; + public float defaultLength; + public bool resizable; + + public GameAction(string actionName, EventCallback function, float defaultLength = 1, bool playerAction = false, bool resizable = false) + { + this.actionName = actionName; + this.function = function; + this.playerAction = playerAction; + this.defaultLength = defaultLength; + this.resizable = resizable; + } + } + + public delegate void EventCallback(); + + public static void Init(EventCaller eventCaller) + { + eventCaller.minigames = new List() + { + new Minigame("gameManager", "Game Manager", "", new List() + { + new GameAction("end", delegate { Debug.Log("end"); }), + new GameAction("switchGame", delegate { GameManager.instance.SwitchGame(eventCaller.currentSwitchGame); }) + }), + new Minigame("forkLifter", "Fork Lifter", "FFFFFF", new List() + { + new GameAction("pea", delegate { ForkLifter.instance.Flick(eventCaller.currentBeat, 0); }, 3, true), + new GameAction("topbun", delegate { ForkLifter.instance.Flick(eventCaller.currentBeat, 1); }, 3, true), + new GameAction("burger", delegate { ForkLifter.instance.Flick(eventCaller.currentBeat, 2); }, 3, true), + new GameAction("bottombun", delegate { ForkLifter.instance.Flick(eventCaller.currentBeat, 3); }, 3, true), + new GameAction("prepare", delegate { ForkLifter.instance.ForkLifterHand.Prepare(); }, 0.5f, true), + new GameAction("gulp", delegate { ForkLifterPlayer.instance.Eat(); }), + new GameAction("sigh", delegate { Jukebox.PlayOneShot("sigh"); }) + }), + new Minigame("clappyTrio", "The Clappy Trio", "29E7FF", new List() + { + new GameAction("clap", delegate { ClappyTrio.instance.Clap(eventCaller.currentBeat, eventCaller.currentLength); }, 3, true), + new GameAction("bop", delegate { ClappyTrio.instance.Bop(eventCaller.currentBeat); } ), + new GameAction("prepare", delegate { ClappyTrio.instance.Prepare(0); } ), + new GameAction("prepare_alt", delegate { ClappyTrio.instance.Prepare(3); } ), + }), + new Minigame("spaceball", "Spaceball", "00A518", new List() + { + new GameAction("shoot", delegate { Spaceball.instance.Shoot(eventCaller.currentBeat, false, eventCaller.currentType); }, 2, true), + new GameAction("shootHigh", delegate { Spaceball.instance.Shoot(eventCaller.currentBeat, true, eventCaller.currentType); }, 3, true), + new GameAction("costume", delegate { Spaceball.instance.Costume(eventCaller.currentType); } ), + new GameAction("alien", delegate { Spaceball.instance.alien.Show(eventCaller.currentBeat); } ), + new GameAction("cameraZoom", delegate { }, 4, false, true ), + }), + new Minigame("karateman", "Karate Man", "70A8D8", new List() + { + new GameAction("bop", delegate { KarateMan.instance.Bop(eventCaller.currentBeat, eventCaller.currentLength); }, 0.5f, true, true), + new GameAction("pot", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 0); }, 2, true), + new GameAction("bulb", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 1); }, 2, true), + new GameAction("rock", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 2); }, 2, true), + new GameAction("ball", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 3); }, 2, true), + new GameAction("kick", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 4); }, 4.5f, true), + new GameAction("bgfxon", delegate { KarateMan.instance.BGFXOn(); } ), + new GameAction("bgfxoff", delegate { KarateMan.instance.BGFXOff(); }), + }) + }; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Minigames.cs.meta b/Assets/Scripts/Minigames.cs.meta new file mode 100644 index 000000000..110d89591 --- /dev/null +++ b/Assets/Scripts/Minigames.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6d314b8e6c105df4b9bffa399e9c2dcd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: