Merge pull request #24 from CarsonKompon/rhythm-rally-camera-rotate-events

Added Camera Events to Rhythm Rally
This commit is contained in:
Jenny Crowe
2022-02-28 14:10:51 -07:00
committed by GitHub
3 changed files with 65 additions and 15 deletions

View File

@ -13,7 +13,7 @@ namespace RhythmHeavenMania.Games.RhythmRally
[Header("Camera")]
public Transform renderQuadTrans;
public Transform cameraPos;
public Transform cameraPivot;
[Header("Ball and curve info")]
@ -341,6 +341,13 @@ namespace RhythmHeavenMania.Games.RhythmRally
inPose = true;
}
public void ChangeCameraAngle(Vector3 rotation, float camZoom, float length, Ease ease, RotateMode rotateMode)
{
var len = length * Conductor.instance.secPerBeat;
cameraPivot.DORotate(rotation, len, rotateMode).SetEase(ease);
cameraPivot.DOScale(camZoom, len).SetEase(ease);
}
public void PrepareFastRally(float beat, RallySpeed speedChange)
{
if (speedChange == RallySpeed.Fast)

View File

@ -1,6 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
using RhythmHeavenMania.Util;
@ -326,6 +327,16 @@ namespace RhythmHeavenMania
new GameAction("fast rally", delegate { RhythmRally.instance.PrepareFastRally(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.Fast); }, 6f),
new GameAction("superfast rally", delegate { RhythmRally.instance.PrepareFastRally(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.SuperFast); }, 12f),
new GameAction("pose", delegate { RhythmRally.instance.Pose(); }, 0.5f),
new GameAction("camera", delegate {
var e = eventCaller.currentEntity;
var rotation = new Vector3(0, e.valA, 0);
RhythmRally.instance.ChangeCameraAngle(rotation, e.valB, e.length, (Ease)e.type, (RotateMode)e.type2);
}, 4, true, new List<Param>() {
new Param("valA", new EntityTypes.Integer(-360, 360, 0), "Angle"),
new Param("valB", new EntityTypes.Float(0.5f, 4f, 1), "Zoom"),
new Param("type", Ease.Linear, "Ease"),
new Param("type2", RotateMode.Fast, "Rotation Mode")
} ),
}),
new Minigame("builtToScaleDS", "Built To Scale (DS) \n<color=#eb5454>[WIP don't use]</color>", "00BB00", true, false, new List<GameAction>()
{