diff --git a/Assets/GameController.cs b/Assets/GameController.cs index 39009e2..63b6561 100644 --- a/Assets/GameController.cs +++ b/Assets/GameController.cs @@ -177,6 +177,16 @@ public void SetBPM(int bpm) { scheduler.UpdateBPM(bpm); } + + public void Play() + { + scheduler.StartTick(); + } + + public void Pause() + { + scheduler.StopTick(); + } } @@ -278,6 +288,8 @@ public class Scheduler int ticks = 0; int next = 0; + bool is_ticking = false; + DecorationStyleScheduler decor_sched; ChuckSubInstance instance; @@ -348,12 +360,16 @@ public void Clear() //Start event tick public void StartTick() { + if (is_ticking) return; + instance.StartListeningForChuckEvent("notifier", callback); + is_ticking = true; } //Stop event tick public void StopTick() { + is_ticking = false; instance.StopListeningForChuckEvent("notifier", callback); } diff --git a/Assets/GameInput.cs b/Assets/GameInput.cs index bd7570c..c82529c 100644 --- a/Assets/GameInput.cs +++ b/Assets/GameInput.cs @@ -137,6 +137,11 @@ void OnBegin(Touch t, GameObject obj) { obj.GetComponent().Click(); } + else if (obj.name.Contains("Play")) + { + obj.GetComponent().Click(); + Debug.Log("Play hit"); + } else if (isNode(obj)) input_state.SetNodeSelect(); else input_state.Clear(); } diff --git a/Assets/Objects/Play.prefab b/Assets/Objects/Play.prefab new file mode 100644 index 0000000..fc9f534 --- /dev/null +++ b/Assets/Objects/Play.prefab @@ -0,0 +1,106 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &5715440348792387555 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7816553599486336056} + - component: {fileID: 8948130470527913545} + - component: {fileID: 5773803267346637723} + - component: {fileID: 5985684635416365062} + - component: {fileID: 215016705234480695} + m_Layer: 0 + m_Name: Play + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7816553599486336056 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5715440348792387555} + m_LocalRotation: {x: -0.27059805, y: -0.6532815, z: -0.27059805, w: 0.6532815} + m_LocalPosition: {x: 0.047188073, y: -0.29889095, z: -1.19828} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: -45, y: -90, z: 0} +--- !u!33 &8948130470527913545 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5715440348792387555} + m_Mesh: {fileID: 4300000, guid: 1da88478e2fca074d84dd8ce4f8cc349, type: 3} +--- !u!23 &5773803267346637723 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5715440348792387555} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 1a2e6f913be23f0488e998335f69593a, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!135 &5985684635416365062 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5715440348792387555} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.009 + m_Center: {x: -0.00031593093, y: 0.004, z: -0.004} +--- !u!114 &215016705234480695 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5715440348792387555} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1f6c9bf63516ec94b8ad52b511a135a6, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/Objects/Play.prefab.meta b/Assets/Objects/Play.prefab.meta new file mode 100644 index 0000000..d478eab --- /dev/null +++ b/Assets/Objects/Play.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f6cc58ee930926140a275fc47893bdb9 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PlayController.cs b/Assets/PlayController.cs new file mode 100644 index 0000000..f7e6647 --- /dev/null +++ b/Assets/PlayController.cs @@ -0,0 +1,27 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class PlayController : MonoBehaviour +{ + bool toggle = false; + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + + } + + public void Click() + { + if (toggle) GameController.GetInstance().Play(); + else GameController.GetInstance().Pause(); + + toggle = !toggle; + } +} diff --git a/Assets/PlayController.cs.meta b/Assets/PlayController.cs.meta new file mode 100644 index 0000000..52c5371 --- /dev/null +++ b/Assets/PlayController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1f6c9bf63516ec94b8ad52b511a135a6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index a41e115..1981ec2 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -355,6 +355,95 @@ Transform: type: 3} m_PrefabInstance: {fileID: 403057162} m_PrefabAsset: {fileID: 0} +--- !u!1001 &464892512 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 5715440348792387555, guid: f6cc58ee930926140a275fc47893bdb9, + type: 3} + propertyPath: m_Name + value: Play + objectReference: {fileID: 0} + - target: {fileID: 7816553599486336056, guid: f6cc58ee930926140a275fc47893bdb9, + type: 3} + propertyPath: m_LocalPosition.x + value: 5.87 + objectReference: {fileID: 0} + - target: {fileID: 7816553599486336056, guid: f6cc58ee930926140a275fc47893bdb9, + type: 3} + propertyPath: m_LocalPosition.y + value: 3.96 + objectReference: {fileID: 0} + - target: {fileID: 7816553599486336056, guid: f6cc58ee930926140a275fc47893bdb9, + type: 3} + propertyPath: m_LocalPosition.z + value: -1.2 + objectReference: {fileID: 0} + - target: {fileID: 7816553599486336056, guid: f6cc58ee930926140a275fc47893bdb9, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.27059805 + objectReference: {fileID: 0} + - target: {fileID: 7816553599486336056, guid: f6cc58ee930926140a275fc47893bdb9, + type: 3} + propertyPath: m_LocalRotation.y + value: -0.6532815 + objectReference: {fileID: 0} + - target: {fileID: 7816553599486336056, guid: f6cc58ee930926140a275fc47893bdb9, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.27059805 + objectReference: {fileID: 0} + - target: {fileID: 7816553599486336056, guid: f6cc58ee930926140a275fc47893bdb9, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.6532815 + objectReference: {fileID: 0} + - target: {fileID: 7816553599486336056, guid: f6cc58ee930926140a275fc47893bdb9, + type: 3} + propertyPath: m_RootOrder + value: 13 + objectReference: {fileID: 0} + - target: {fileID: 7816553599486336056, guid: f6cc58ee930926140a275fc47893bdb9, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -45 + objectReference: {fileID: 0} + - target: {fileID: 7816553599486336056, guid: f6cc58ee930926140a275fc47893bdb9, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -90 + objectReference: {fileID: 0} + - target: {fileID: 7816553599486336056, guid: f6cc58ee930926140a275fc47893bdb9, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7816553599486336056, guid: f6cc58ee930926140a275fc47893bdb9, + type: 3} + propertyPath: m_LocalScale.x + value: 100 + objectReference: {fileID: 0} + - target: {fileID: 7816553599486336056, guid: f6cc58ee930926140a275fc47893bdb9, + type: 3} + propertyPath: m_LocalScale.y + value: 100 + objectReference: {fileID: 0} + - target: {fileID: 7816553599486336056, guid: f6cc58ee930926140a275fc47893bdb9, + type: 3} + propertyPath: m_LocalScale.z + value: 100 + objectReference: {fileID: 0} + - target: {fileID: 5773803267346637723, guid: f6cc58ee930926140a275fc47893bdb9, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: d0a86259d76e58c458769b84b43ccd31, type: 2} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: f6cc58ee930926140a275fc47893bdb9, type: 3} --- !u!1 &519420028 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/geom/play.fbx b/Assets/geom/play.fbx new file mode 100644 index 0000000..86853d3 Binary files /dev/null and b/Assets/geom/play.fbx differ diff --git a/Assets/geom/play.fbx.meta b/Assets/geom/play.fbx.meta new file mode 100644 index 0000000..c1bf9a9 --- /dev/null +++ b/Assets/geom/play.fbx.meta @@ -0,0 +1,105 @@ +fileFormatVersion: 2 +guid: 1da88478e2fca074d84dd8ce4f8cc349 +ModelImporter: + serializedVersion: 23 + fileIDToRecycleName: + 100000: Camera + 100002: Cube + 100004: Light + 100006: //RootNode + 400000: Camera + 400002: Cube + 400004: Light + 400006: //RootNode + 2000000: Camera + 2100000: Material + 2300000: Cube + 3300000: Cube + 4300000: Cube + 10800000: Light + externalObjects: {} + materials: + importMaterials: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + keepQuads: 0 + weldVertices: 1 + preserveHierarchy: 0 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + previousCalculatedGlobalScale: 1 + hasPreviousCalculatedGlobalScale: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + importAnimation: 1 + copyAvatar: 0 + humanDescription: + serializedVersion: 2 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 0 + humanoidOversampling: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: