Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Scenecontrol Features #23

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions Assets/Editor/EmmyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,8 @@ public class EmmyTest : Editor
[MenuItem("ArcCreate/TestEmmy/Scenecontrol")]
public static void GenerateTestScenecontrolEmmy()
{
Assembly scAssembly = Assembly.GetAssembly(typeof(ScenecontrolService));
var emmy = LuaRunner.GetCommonEmmySharp();
emmy.AppendAssembly(scAssembly);
emmy.AppendFunction(typeof(ScenecontrolLuaEnvironment).GetMethod("AddScenecontrol"));
emmy.AppendFunction(typeof(ScenecontrolLuaEnvironment).GetMethod("Notify"));
emmy.AppendFunction(typeof(ScenecontrolLuaEnvironment).GetMethod("NotifyWarn"));
emmy.AppendFunction(typeof(ScenecontrolLuaEnvironment).GetMethod("NotifyError"));
emmy.Build(Path.GetDirectoryName(Application.dataPath));
ScenecontrolLuaEnvironment env = new ScenecontrolLuaEnvironment();
env.GenerateEmmyLua(Path.Combine(Application.dataPath, ".."));
}
}
}
43 changes: 43 additions & 0 deletions Assets/Editor/ScenecontrolChecks.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System;
using System.IO;
using System.Linq;
using ArcCreate.Gameplay.Scenecontrol;
using ArcCreate.Utility.Animation;
using DG.DOTweenEditor;
using DG.Tweening;
using UnityEditor;
using UnityEngine;

namespace ArcCreate.EditorScripts
{
public static class ScenecontrolChecks
{
public const string IOFolder = "Assets/Scripts/Gameplay/Scenecontrol/IO";
public const string DeserializationFile = IOFolder + "/ScenecontrolDeserialization.cs";
public const string SerializationFile = IOFolder + "/ScenecontrolSerialization.cs";

[InitializeOnLoadMethod]
public static void CheckScenecontrol()
{
var allChannelTypes = TypeCache.GetTypesDerivedFrom<IChannel>();

var deser = File.ReadAllText(DeserializationFile);
var ser = File.ReadAllText(SerializationFile);

foreach (var chanType in allChannelTypes.Where(t => !Attribute.IsDefined(t, typeof(SerializationExemptAttribute))))
{
var chan = chanType.Name;

if (!deser.Contains(chan))
{
Debug.LogError($"Channel type {chanType} is missing deserialization code! Please add it!");
}

if (!ser.Contains(chan))
{
Debug.LogError($"Channel type {chanType} is missing serialization code! Please add it!");
}
}
}
}
}
11 changes: 11 additions & 0 deletions Assets/Editor/ScenecontrolChecks.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Assets/Materials/Compose/Waveform.mat
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Material:
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _ToSample: 10478160
- _ToSample: 14773500
- _UVSec: 0
- _ZWrite: 1
m_Colors:
Expand Down
46 changes: 46 additions & 0 deletions Assets/Prefabs/Gameplay/ScenecontrolNoteIndividual.prefab
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &9148057743627579955
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6791676609819765838}
- component: {fileID: 5835389651473541310}
m_Layer: 0
m_Name: ScenecontrolNoteIndividual
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6791676609819765838
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9148057743627579955}
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: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &5835389651473541310
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9148057743627579955}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 992745bc6c6c41d4f9dbd4512489c76e, type: 3}
m_Name:
m_EditorClassIdentifier:
isPersistent: 1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 37 additions & 32 deletions Assets/Scenes/Gameplay.unity
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.37311956, g: 0.3807402, b: 0.35872734, a: 1}
m_IndirectSpecularColor: {r: 0.37311918, g: 0.3807398, b: 0.35872716, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
Expand Down Expand Up @@ -589,10 +589,11 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Title
m_text:
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: c7ac2a5a49fae4b4bb4d928c18726d16, type: 2}
m_sharedMaterial: {fileID: 2100000, guid: 7d94f1e4755948de58fab75d76ecc932, type: 2}
m_fontAsset: {fileID: 11400000, guid: fc246767bf759519bb5f459275194444, type: 2}
m_sharedMaterial: {fileID: 3714936077332224653, guid: fc246767bf759519bb5f459275194444,
type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
Expand All @@ -616,22 +617,22 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 29
m_fontSizeBase: 29
m_fontSize: 36
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 20
m_fontSizeMax: 29
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 512
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 30
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
Expand Down Expand Up @@ -2012,7 +2013,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 25, y: -200.00002}
m_AnchoredPosition: {x: 25, y: -200}
m_SizeDelta: {x: 300, y: 50}
m_Pivot: {x: 0, y: 1}
--- !u!114 &377893499
Expand Down Expand Up @@ -8281,7 +8282,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 25, y: -200.00002}
m_AnchoredPosition: {x: 25, y: -200}
m_SizeDelta: {x: 300, y: 50}
m_Pivot: {x: 0, y: 1}
--- !u!114 &1409023644
Expand Down Expand Up @@ -9401,6 +9402,8 @@ MonoBehaviour:
type: 3}
GroupPrefab: {fileID: 4044602181011751714, guid: 3a19ff92a7a5f7b529ca21daf779e77a,
type: 3}
IndividualPrefab: {fileID: 9148057743627579955, guid: 5f66e696345e59a4191b57a5ecf86d21,
type: 3}
DefaultMaterial: {fileID: 2100000, guid: 0077ff23d523e3c18aae9ce29959c184, type: 2}
ColorBurnMaterial: {fileID: 2100000, guid: 40f43e7d31b274b3aaf597edb06654e0, type: 2}
ColorDodgeMaterial: {fileID: 2100000, guid: 8be0bcbba0ce3e760adfbfe8df96f2ef, type: 2}
Expand Down Expand Up @@ -11539,10 +11542,11 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Composer
m_text:
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: c7ac2a5a49fae4b4bb4d928c18726d16, type: 2}
m_sharedMaterial: {fileID: 2100000, guid: 7d94f1e4755948de58fab75d76ecc932, type: 2}
m_fontAsset: {fileID: 11400000, guid: fc246767bf759519bb5f459275194444, type: 2}
m_sharedMaterial: {fileID: 3714936077332224653, guid: fc246767bf759519bb5f459275194444,
type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
Expand All @@ -11566,22 +11570,22 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 23
m_fontSizeBase: 23
m_fontSize: 36
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 23
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 512
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 50
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
Expand Down Expand Up @@ -12406,10 +12410,11 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Future ?
m_text:
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: b7b1b4ddbd331de42ac5353299efdd2d, type: 2}
m_sharedMaterial: {fileID: 2100000, guid: ea4b41747e7d6cd059f99e4c986f0c8a, type: 2}
m_fontAsset: {fileID: 11400000, guid: fc246767bf759519bb5f459275194444, type: 2}
m_sharedMaterial: {fileID: 3714936077332224653, guid: fc246767bf759519bb5f459275194444,
type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
Expand All @@ -12433,22 +12438,22 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 25
m_fontSizeBase: 25
m_fontSize: 36
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 15
m_fontSizeMax: 25
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_HorizontalAlignment: 1
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 50
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
Expand Down
8 changes: 4 additions & 4 deletions Assets/Scripts/Compose/Editing/NoteCreation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ private void Update()
float z = cursorPosition.z;

GroupProperties groupProperties = Services.Gameplay.Chart.GetTimingGroup(tg).GroupProperties;
Vector3 pos = (groupProperties.FallDirection * z) + new Vector3(ArcFormula.LaneToWorldX(cursorLane), 0, 0);
Vector3 pos = (groupProperties.GetFallDirection() * z) + new Vector3(ArcFormula.LaneToWorldX(cursorLane), 0, 0);
Quaternion rot = groupProperties.RotationIndividual;
Vector3 scl = groupProperties.ScaleIndividual;

Expand All @@ -363,11 +363,11 @@ private void Update()
previewHold.localScale = scl;
break;
case CreateNoteMode.Arc:
pos = (groupProperties.FallDirection * z) + new Vector3(cursorPosition.x, 1, 0);
pos = (groupProperties.GetFallDirection() * z) + new Vector3(cursorPosition.x, 1, 0);
previewArc.localPosition = pos;
break;
case CreateNoteMode.Trace:
pos = (groupProperties.FallDirection * z) + new Vector3(cursorPosition.x, 1, 0);
pos = (groupProperties.GetFallDirection() * z) + new Vector3(cursorPosition.x, 1, 0);
previewTrace.localPosition = pos;
break;
case CreateNoteMode.ArcTap:
Expand Down Expand Up @@ -414,7 +414,7 @@ private void Update()
previewArcTap.gameObject.SetActive(true);
float worldX = parentArc.WorldXAt(cursorTiming);
float worldY = parentArc.WorldYAt(cursorTiming);
pos = (groupProperties.FallDirection * z) + new Vector3(worldX, worldY, 0);
pos = (groupProperties.GetFallDirection() * z) + new Vector3(worldX, worldY, 0);
previewArcTap.localPosition = pos;
previewArcTap.localRotation = rot;
previewArcTap.localScale = scl;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using EmmySharp;
using MoonSharp.Interpreter;

namespace ArcCreate.Compose.EventsEditor
{
[MoonSharpUserData]
[EmmyAlias("ScenecontrolArgs")]
internal class LuaScenecontrol
{
public int Timing { get; set; }
Expand Down
Loading