Rhythm Rally Camera Event

Rotate the camera with different easing functions and the option to add/remove from current rotation.
This commit is contained in:
Carson Kompon 2022-02-28 14:31:28 -05:00
parent 77af919722
commit 1ba9a3c1dc
3 changed files with 61 additions and 14 deletions

View file

@ -27,7 +27,7 @@ Transform:
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 6509993024069972873} - {fileID: 5472155158897914726}
- {fileID: 3078425781313688086} - {fileID: 3078425781313688086}
- {fileID: 4228713593463920381} - {fileID: 4228713593463920381}
- {fileID: 4959957736091286558} - {fileID: 4959957736091286558}
@ -231,6 +231,37 @@ TrailRenderer:
m_MinVertexDistance: 0 m_MinVertexDistance: 0
m_Autodestruct: 0 m_Autodestruct: 0
m_Emitting: 1 m_Emitting: 1
--- !u!1 &1501271021389222783
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5472155158897914726}
m_Layer: 10
m_Name: CameraPivot
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5472155158897914726
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1501271021389222783}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 6509993024069972873}
m_Father: {fileID: 4631944531018638297}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1668061868608559892 --- !u!1 &1668061868608559892
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -831,9 +862,9 @@ MonoBehaviour:
perfect: 0 perfect: 0
late: 0 late: 0
createBeat: 0 createBeat: 0
isEligible: 0
eligibleHitsList: [] eligibleHitsList: []
aceTimes: 0 aceTimes: 0
isEligible: 0
--- !u!1 &3340141389927785323 --- !u!1 &3340141389927785323
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1008,7 +1039,7 @@ Transform:
m_LocalPosition: {x: -1.86, y: 2.2, z: -3.9} m_LocalPosition: {x: -1.86, y: 2.2, z: -3.9}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 4631944531018638297} m_Father: {fileID: 5472155158897914726}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 20.97, y: 27.3, z: 0} m_LocalEulerAnglesHint: {x: 20.97, y: 27.3, z: 0}
--- !u!20 &6268063764140376526 --- !u!20 &6268063764140376526
@ -1709,6 +1740,7 @@ MonoBehaviour:
firstEnable: 0 firstEnable: 0
renderQuadTrans: {fileID: 743597382397742394} renderQuadTrans: {fileID: 743597382397742394}
cameraPos: {fileID: 6509993024069972873} cameraPos: {fileID: 6509993024069972873}
cameraPivot: {fileID: 5472155158897914726}
ball: {fileID: 1668061868608559892} ball: {fileID: 1668061868608559892}
ballShadow: {fileID: 7207398029238753263} ballShadow: {fileID: 7207398029238753263}
ballTrail: {fileID: 4238313091838702597} ballTrail: {fileID: 4238313091838702597}
@ -2048,16 +2080,16 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: cebeb8610d89fb34688750080a285ddb, type: 3} m_SourcePrefab: {fileID: 100100000, guid: cebeb8610d89fb34688750080a285ddb, type: 3}
--- !u!4 &397144130134918796 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: cebeb8610d89fb34688750080a285ddb, type: 3}
m_PrefabInstance: {fileID: 146447278275535207}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1065418898597387318 stripped --- !u!1 &1065418898597387318 stripped
GameObject: GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: cebeb8610d89fb34688750080a285ddb, type: 3} m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: cebeb8610d89fb34688750080a285ddb, type: 3}
m_PrefabInstance: {fileID: 146447278275535207} m_PrefabInstance: {fileID: 146447278275535207}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!4 &397144130134918796 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: cebeb8610d89fb34688750080a285ddb, type: 3}
m_PrefabInstance: {fileID: 146447278275535207}
m_PrefabAsset: {fileID: 0}
--- !u!95 &4559734961269837672 --- !u!95 &4559734961269837672
Animator: Animator:
serializedVersion: 3 serializedVersion: 3
@ -2702,16 +2734,16 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: cebeb8610d89fb34688750080a285ddb, type: 3} m_SourcePrefab: {fileID: 100100000, guid: cebeb8610d89fb34688750080a285ddb, type: 3}
--- !u!4 &7291063904195614871 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: cebeb8610d89fb34688750080a285ddb, type: 3}
m_PrefabInstance: {fileID: 7108288251017691004}
m_PrefabAsset: {fileID: 0}
--- !u!4 &2075964892847120759 stripped --- !u!4 &2075964892847120759 stripped
Transform: Transform:
m_CorrespondingSourceObject: {fileID: 9109367605909020171, guid: cebeb8610d89fb34688750080a285ddb, type: 3} m_CorrespondingSourceObject: {fileID: 9109367605909020171, guid: cebeb8610d89fb34688750080a285ddb, type: 3}
m_PrefabInstance: {fileID: 7108288251017691004} m_PrefabInstance: {fileID: 7108288251017691004}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!4 &7291063904195614871 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: cebeb8610d89fb34688750080a285ddb, type: 3}
m_PrefabInstance: {fileID: 7108288251017691004}
m_PrefabAsset: {fileID: 0}
--- !u!1 &7954728381481796141 stripped --- !u!1 &7954728381481796141 stripped
GameObject: GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: cebeb8610d89fb34688750080a285ddb, type: 3} m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: cebeb8610d89fb34688750080a285ddb, type: 3}

View file

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

View file

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