mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-12-03 14:57:29 +00:00
Camera flashes (bug associated with fullscreen)
This commit is contained in:
parent
57b14c3f3e
commit
49ad157893
31 changed files with 2646 additions and 97 deletions
8
Assets/Plugins/Color picker.meta
Normal file
8
Assets/Plugins/Color picker.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 066a6ded0cf084c42b7d6cb71d6079d5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
615
Assets/Plugins/Color picker/Color picker sample scene.unity
Normal file
615
Assets/Plugins/Color picker/Color picker sample scene.unity
Normal file
|
@ -0,0 +1,615 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 9
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 3
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 12
|
||||
m_GIWorkflowMode: 1
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 0
|
||||
m_EnableRealtimeLightmaps: 0
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 12
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAmbientOcclusion: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 256
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 0
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVRBounces: 2
|
||||
m_PVREnvironmentSampleCount: 500
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_PVRFilteringMode: 2
|
||||
m_PVRDenoiserTypeDirect: 0
|
||||
m_PVRDenoiserTypeIndirect: 0
|
||||
m_PVRDenoiserTypeAO: 0
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVREnvironmentMIS: 0
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_LightingSettings: {fileID: 1057653236}
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
maxJobWorkers: 0
|
||||
preserveTilesOutsideBounds: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &345254171
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 345254174}
|
||||
- component: {fileID: 345254173}
|
||||
- component: {fileID: 345254172}
|
||||
m_Layer: 0
|
||||
m_Name: EventSystem
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &345254172
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 345254171}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalAxis: Horizontal
|
||||
m_VerticalAxis: Vertical
|
||||
m_SubmitButton: Submit
|
||||
m_CancelButton: Cancel
|
||||
m_InputActionsPerSecond: 10
|
||||
m_RepeatDelay: 0.5
|
||||
m_ForceModuleActive: 0
|
||||
--- !u!114 &345254173
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 345254171}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_FirstSelected: {fileID: 0}
|
||||
m_sendNavigationEvents: 1
|
||||
m_DragThreshold: 10
|
||||
--- !u!4 &345254174
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 345254171}
|
||||
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: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &352399579
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 352399580}
|
||||
- component: {fileID: 352399583}
|
||||
- component: {fileID: 352399582}
|
||||
- component: {fileID: 352399581}
|
||||
m_Layer: 5
|
||||
m_Name: Color preview image
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &352399580
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 352399579}
|
||||
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: 782062901}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 20, y: -20}
|
||||
m_SizeDelta: {x: 200, y: 100}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!114 &352399581
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 352399579}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5c2c42ee235f17049ab3792499eccc59, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
previewGraphic: {fileID: 352399582}
|
||||
colorPicker: {fileID: 382679909}
|
||||
--- !u!114 &352399582
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 352399579}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &352399583
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 352399579}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!1 &382679905
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 382679906}
|
||||
- component: {fileID: 382679908}
|
||||
- component: {fileID: 382679907}
|
||||
- component: {fileID: 382679909}
|
||||
m_Layer: 5
|
||||
m_Name: Color picker
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &382679906
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 382679905}
|
||||
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: 782062901}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: -40, y: -40}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &382679907
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 382679905}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 2100000, guid: 8a6d493ef83c61d45b80f5a22a814173, type: 2}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &382679908
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 382679905}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &382679909
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 382679905}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: af3ff511a986a5c4e8dc1a7939e7b981, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
colorPickerShader: {fileID: 0}
|
||||
--- !u!1 &519420028
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 519420032}
|
||||
- component: {fileID: 519420031}
|
||||
- component: {fileID: 519420029}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &519420029
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 519420028}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &519420031
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 519420028}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 2
|
||||
m_BackGroundColor: {r: 0.089088656, g: 0.102733016, b: 0.13207549, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 1
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 0
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 0
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 0
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &519420032
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 519420028}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -10}
|
||||
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!1 &782062897
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 782062901}
|
||||
- component: {fileID: 782062900}
|
||||
- component: {fileID: 782062899}
|
||||
- component: {fileID: 782062898}
|
||||
m_Layer: 5
|
||||
m_Name: Canvas
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &782062898
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 782062897}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreReversedGraphics: 1
|
||||
m_BlockingObjects: 0
|
||||
m_BlockingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
--- !u!114 &782062899
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 782062897}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_UiScaleMode: 0
|
||||
m_ReferencePixelsPerUnit: 100
|
||||
m_ScaleFactor: 1
|
||||
m_ReferenceResolution: {x: 800, y: 600}
|
||||
m_ScreenMatchMode: 0
|
||||
m_MatchWidthOrHeight: 0
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
m_PresetInfoIsWorld: 0
|
||||
--- !u!223 &782062900
|
||||
Canvas:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 782062897}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_RenderMode: 0
|
||||
m_Camera: {fileID: 0}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 0
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
--- !u!224 &782062901
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 782062897}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0, y: 0, z: 0}
|
||||
m_Children:
|
||||
- {fileID: 352399580}
|
||||
- {fileID: 382679906}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0, y: 0}
|
||||
--- !u!850595691 &1057653236
|
||||
LightingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Settings.lighting
|
||||
serializedVersion: 3
|
||||
m_GIWorkflowMode: 1
|
||||
m_EnableBakedLightmaps: 0
|
||||
m_EnableRealtimeLightmaps: 0
|
||||
m_RealtimeEnvironmentLighting: 1
|
||||
m_BounceScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_UsingShadowmask: 1
|
||||
m_BakeBackend: 0
|
||||
m_LightmapMaxSize: 1024
|
||||
m_BakeResolution: 40
|
||||
m_Padding: 2
|
||||
m_TextureCompression: 1
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAO: 0
|
||||
m_MixedBakeMode: 2
|
||||
m_LightmapsBakeMode: 1
|
||||
m_FilterMode: 1
|
||||
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_RealtimeResolution: 2
|
||||
m_ForceWhiteAlbedo: 0
|
||||
m_ForceUpdates: 0
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherRayCount: 256
|
||||
m_FinalGatherFiltering: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVREnvironmentSampleCount: 500
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_PVRBounces: 2
|
||||
m_PVRMinBounces: 2
|
||||
m_PVREnvironmentMIS: 0
|
||||
m_PVRFilteringMode: 2
|
||||
m_PVRDenoiserTypeDirect: 0
|
||||
m_PVRDenoiserTypeIndirect: 0
|
||||
m_PVRDenoiserTypeAO: 0
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f996ca77004b14b4696cfe52a839c2ab
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
38
Assets/Plugins/Color picker/ColorPicker Material.mat
Normal file
38
Assets/Plugins/Color picker/ColorPicker Material.mat
Normal file
|
@ -0,0 +1,38 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: ColorPicker Material
|
||||
m_Shader: {fileID: 4800000, guid: 1fe34ac173a0455499fd722bc6744230, type: 3}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- _ColorMask: 15
|
||||
- _HueCircleInner: 0.4
|
||||
- _HueSelectorInner: 0.8
|
||||
- _SVSquareSize: 0.25
|
||||
- _Stencil: 0
|
||||
- _StencilComp: 8
|
||||
- _StencilOp: 0
|
||||
- _StencilReadMask: 255
|
||||
- _StencilWriteMask: 255
|
||||
- _UseUIAlphaClip: 0
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8a6d493ef83c61d45b80f5a22a814173
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
228
Assets/Plugins/Color picker/ColorPicker shader.shader
Normal file
228
Assets/Plugins/Color picker/ColorPicker shader.shader
Normal file
|
@ -0,0 +1,228 @@
|
|||
|
||||
Shader "UI/ColorPicker"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
// Variables from default UI shader
|
||||
|
||||
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
|
||||
_Color ("Tint", Color) = (1,1,1,1)
|
||||
|
||||
_StencilComp ("Stencil Comparison", Float) = 8
|
||||
_Stencil ("Stencil ID", Float) = 0
|
||||
_StencilOp ("Stencil Operation", Float) = 0
|
||||
_StencilWriteMask ("Stencil Write Mask", Float) = 255
|
||||
_StencilReadMask ("Stencil Read Mask", Float) = 255
|
||||
|
||||
_ColorMask ("Color Mask", Float) = 15
|
||||
|
||||
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
|
||||
|
||||
// Color picker
|
||||
|
||||
_HueCircleInner("Hue circle inner radius", Range(0, .5)) = .4
|
||||
_HueSelectorInner("Hue selector inner radius", Range(0, 1)) = .8
|
||||
_SVSquareSize("SV Square size", Range(0, .5)) = .25
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"Queue"="Transparent"
|
||||
"IgnoreProjector"="True"
|
||||
"RenderType"="Transparent"
|
||||
"PreviewType"="Plane"
|
||||
"CanUseSpriteAtlas"="True"
|
||||
}
|
||||
|
||||
Stencil
|
||||
{
|
||||
Ref [_Stencil]
|
||||
Comp [_StencilComp]
|
||||
Pass [_StencilOp]
|
||||
ReadMask [_StencilReadMask]
|
||||
WriteMask [_StencilWriteMask]
|
||||
}
|
||||
|
||||
Cull Off
|
||||
Lighting Off
|
||||
ZWrite Off
|
||||
ZTest [unity_GUIZTestMode]
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
ColorMask [_ColorMask]
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "Default"
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "UnityUI.cginc"
|
||||
|
||||
#pragma multi_compile __ UNITY_UI_CLIP_RECT
|
||||
#pragma multi_compile __ UNITY_UI_ALPHACLIP
|
||||
|
||||
static const float recip2Pi = 0.159154943;
|
||||
static const float twoPi = 6.2831853;
|
||||
|
||||
float3 hsv2rgb(float3 c)
|
||||
{
|
||||
float4 K = float4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
||||
float3 p = abs(frac(c.xxx + K.xyz) * 6.0 - K.www);
|
||||
return c.z * lerp(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
||||
}
|
||||
|
||||
struct appdata_t
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float4 worldPosition : TEXCOORD1;
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
fixed4 _Color;
|
||||
fixed4 _TextureSampleAdd;
|
||||
float4 _ClipRect;
|
||||
float4 _MainTex_ST;
|
||||
|
||||
float _HueCircleInner, _HueSelectorInner;
|
||||
|
||||
float _SVSquareSize;
|
||||
|
||||
float3 _HSV;
|
||||
|
||||
float _AspectRatio;
|
||||
|
||||
v2f vert(appdata_t v)
|
||||
{
|
||||
v2f OUT;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
|
||||
OUT.worldPosition = v.vertex;
|
||||
OUT.vertex = UnityObjectToClipPos(OUT.worldPosition);
|
||||
|
||||
OUT.texcoord = v.texcoord;
|
||||
|
||||
OUT.color = v.color * _Color;
|
||||
return OUT;
|
||||
}
|
||||
|
||||
half4 hueRing(float2 uv)
|
||||
{
|
||||
float2 coords = uv - .5;
|
||||
|
||||
float r = length(coords);
|
||||
|
||||
float fw = fwidth(r);
|
||||
|
||||
float a = smoothstep(.5, .5 - fw, r) * smoothstep(_HueCircleInner - fw, _HueCircleInner, r);
|
||||
|
||||
float angle = atan2(coords.y, coords.x) * recip2Pi;
|
||||
|
||||
return half4(hsv2rgb(float3(angle, 1, 1)), a);
|
||||
}
|
||||
|
||||
half4 whiteRing(float2 uv, float2 pos, float inner, float outer)
|
||||
{
|
||||
float2 coords = uv - pos;
|
||||
|
||||
float r = length(coords);
|
||||
|
||||
float fw = fwidth(r);
|
||||
|
||||
float a = smoothstep(outer, outer - fw, r) * smoothstep(inner - fw, inner, r);
|
||||
|
||||
return half4(1, 1, 1, a);
|
||||
}
|
||||
|
||||
half4 svSquare(float2 uv)
|
||||
{
|
||||
float2 sv = (uv - .5) / (_SVSquareSize * 2) + .5;
|
||||
|
||||
float dx = abs(ddx(sv.x));
|
||||
float dy = abs(ddy(sv.y));
|
||||
|
||||
float a =
|
||||
smoothstep(0, dx, sv.x) * smoothstep(1, 1 - dx, sv.x) *
|
||||
smoothstep(0, dy, sv.y) * smoothstep(1, 1 - dy, sv.y);
|
||||
|
||||
return float4(hsv2rgb(float3(_HSV.x, sv)), a);
|
||||
}
|
||||
|
||||
fixed4 mix(fixed4 bot, fixed4 top)
|
||||
{
|
||||
return fixed4(lerp(bot.rgb, top.rgb, top.a), max(bot.a, top.a));
|
||||
}
|
||||
|
||||
fixed4 frag(v2f IN) : SV_Target
|
||||
{
|
||||
// Aspect ratio correction
|
||||
|
||||
float2 uv = _AspectRatio > 1 ?
|
||||
float2(.5 + (IN.texcoord.x - .5) * _AspectRatio, IN.texcoord.y) :
|
||||
float2(IN.texcoord.x, .5 + (IN.texcoord.y - .5) / _AspectRatio);
|
||||
|
||||
// Hue ring
|
||||
|
||||
half4 color = hueRing(uv);
|
||||
|
||||
// Hue ring selector
|
||||
|
||||
float hSelectorR = (.5 - _HueCircleInner) * .5;
|
||||
|
||||
half4 hSelector = whiteRing(
|
||||
uv,
|
||||
float2(cos(_HSV.x * twoPi), sin(_HSV.x * twoPi)) * (.5 - hSelectorR) + .5,
|
||||
hSelectorR * _HueSelectorInner, hSelectorR);
|
||||
|
||||
color = mix(color, hSelector);
|
||||
|
||||
// Saturation value Square
|
||||
|
||||
half4 sv = svSquare(uv);
|
||||
|
||||
color = sv.a > 0 ? sv : color;
|
||||
|
||||
// Saturation value selector
|
||||
|
||||
half4 svSelector = whiteRing(
|
||||
uv,
|
||||
.5 + 2 * _SVSquareSize * (_HSV.yz - .5),
|
||||
hSelectorR * _HueSelectorInner, hSelectorR);
|
||||
|
||||
color = mix(color, svSelector);
|
||||
|
||||
// Unity stuff
|
||||
|
||||
#ifdef UNITY_UI_CLIP_RECT
|
||||
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
|
||||
#endif
|
||||
|
||||
#ifdef UNITY_UI_ALPHACLIP
|
||||
clip (color.a - 0.001);
|
||||
#endif
|
||||
|
||||
#ifdef UNITY_COLORSPACE_GAMMA
|
||||
return color;
|
||||
#endif
|
||||
|
||||
return fixed4(GammaToLinearSpace(color.rgb), color.a);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1fe34ac173a0455499fd722bc6744230
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
197
Assets/Plugins/Color picker/ColorPicker.cs
Normal file
197
Assets/Plugins/Color picker/ColorPicker.cs
Normal file
|
@ -0,0 +1,197 @@
|
|||
// https://github.com/mmaletin/UnityColorPicker
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
using static UnityEngine.Mathf;
|
||||
|
||||
[ExecuteInEditMode, RequireComponent(typeof(Image))]
|
||||
public class ColorPicker : MonoBehaviour, IPointerDownHandler, IDragHandler, IPointerUpHandler
|
||||
{
|
||||
private const float recip2Pi = 0.159154943f;
|
||||
private const string colorPickerShaderName = "UI/ColorPicker";
|
||||
|
||||
private static readonly int _HSV = Shader.PropertyToID(nameof(_HSV));
|
||||
private static readonly int _AspectRatio = Shader.PropertyToID(nameof(_AspectRatio));
|
||||
private static readonly int _HueCircleInner = Shader.PropertyToID(nameof(_HueCircleInner));
|
||||
private static readonly int _SVSquareSize = Shader.PropertyToID(nameof(_SVSquareSize));
|
||||
|
||||
[SerializeField, HideInInspector] private Shader colorPickerShader;
|
||||
private Material generatedMaterial;
|
||||
|
||||
private enum PointerDownLocation { HueCircle, SVSquare, Outside }
|
||||
private PointerDownLocation pointerDownLocation = PointerDownLocation.Outside;
|
||||
|
||||
private RectTransform rectTransform;
|
||||
[UnityEngine.SerializeField] private Image image;
|
||||
|
||||
float h, s, v;
|
||||
|
||||
public Color color
|
||||
{
|
||||
get { return Color.HSVToRGB(h, s, v); }
|
||||
set {
|
||||
Color.RGBToHSV(value, out h, out s, out v);
|
||||
ApplyColor();
|
||||
}
|
||||
}
|
||||
|
||||
public event Action<Color> onColorChanged;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
rectTransform = transform as RectTransform;
|
||||
|
||||
h = s = v = 0;
|
||||
|
||||
if (WrongShader())
|
||||
{
|
||||
Debug.LogWarning($"Color picker requires image material with {colorPickerShaderName} shader.");
|
||||
|
||||
if (Application.isPlaying && colorPickerShader != null)
|
||||
{
|
||||
generatedMaterial = new Material(colorPickerShader);
|
||||
generatedMaterial.hideFlags = HideFlags.HideAndDontSave;
|
||||
}
|
||||
|
||||
image.material = generatedMaterial;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
ApplyColor();
|
||||
}
|
||||
|
||||
private void Reset()
|
||||
{
|
||||
colorPickerShader = Shader.Find(colorPickerShaderName);
|
||||
}
|
||||
|
||||
private bool WrongShader()
|
||||
{
|
||||
return image?.material?.shader?.name != colorPickerShaderName;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (WrongShader()) return;
|
||||
|
||||
var rect = rectTransform.rect;
|
||||
|
||||
image.material.SetFloat(_AspectRatio, rect.width / rect.height);
|
||||
}
|
||||
|
||||
public void OnDrag(PointerEventData eventData)
|
||||
{
|
||||
if (WrongShader()) return;
|
||||
|
||||
var pos = GetRelativePosition(eventData);
|
||||
|
||||
if (pointerDownLocation == PointerDownLocation.HueCircle)
|
||||
{
|
||||
h = (Atan2(pos.y, pos.x) * recip2Pi + 1) % 1;
|
||||
ApplyColor();
|
||||
}
|
||||
|
||||
if (pointerDownLocation == PointerDownLocation.SVSquare)
|
||||
{
|
||||
var size = image.material.GetFloat(_SVSquareSize);
|
||||
|
||||
s = InverseLerp(-size, size, pos.x);
|
||||
v = InverseLerp(-size, size, pos.y);
|
||||
ApplyColor();
|
||||
}
|
||||
}
|
||||
|
||||
public void OnPointerDown(PointerEventData eventData)
|
||||
{
|
||||
if (WrongShader()) return;
|
||||
|
||||
var pos = GetRelativePosition(eventData);
|
||||
|
||||
float r = pos.magnitude;
|
||||
|
||||
if (r < .5f && r > image.material.GetFloat(_HueCircleInner))
|
||||
{
|
||||
pointerDownLocation = PointerDownLocation.HueCircle;
|
||||
h = (Atan2(pos.y, pos.x) * recip2Pi + 1) % 1;
|
||||
ApplyColor();
|
||||
}
|
||||
else
|
||||
{
|
||||
var size = image.material.GetFloat(_SVSquareSize);
|
||||
|
||||
// s -> x, v -> y
|
||||
if (pos.x >= -size && pos.x <= size && pos.y >= -size && pos.y <= size)
|
||||
{
|
||||
pointerDownLocation = PointerDownLocation.SVSquare;
|
||||
s = InverseLerp(-size, size, pos.x);
|
||||
v = InverseLerp(-size, size, pos.y);
|
||||
ApplyColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OnPointerUp(PointerEventData eventData)
|
||||
{
|
||||
pointerDownLocation = PointerDownLocation.Outside;
|
||||
}
|
||||
|
||||
private void ApplyColor()
|
||||
{
|
||||
image.material.SetVector(_HSV, new Vector3(h, s, v));
|
||||
|
||||
onColorChanged?.Invoke(color);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (generatedMaterial != null)
|
||||
DestroyImmediate(generatedMaterial);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns position in range -0.5..0.5 when it's inside color picker square area
|
||||
/// </summary>
|
||||
public Vector2 GetRelativePosition(PointerEventData eventData)
|
||||
{
|
||||
var rect = GetSquaredRect();
|
||||
|
||||
Vector2 rtPos;
|
||||
|
||||
RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, eventData.position, eventData.pressEventCamera, out rtPos);
|
||||
|
||||
return new Vector2(InverseLerpUnclamped(rect.xMin, rect.xMax, rtPos.x), InverseLerpUnclamped(rect.yMin, rect.yMax, rtPos.y)) - Vector2.one * 0.5f;
|
||||
}
|
||||
|
||||
public Rect GetSquaredRect()
|
||||
{
|
||||
var rect = rectTransform.rect;
|
||||
var smallestDimension = Min(rect.width, rect.height);
|
||||
return new Rect(rect.center - Vector2.one * smallestDimension * 0.5f, Vector2.one * smallestDimension);
|
||||
}
|
||||
|
||||
public float InverseLerpUnclamped(float min, float max, float value)
|
||||
{
|
||||
return (value - min) / (max - min);
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
|
||||
[UnityEditor.MenuItem("GameObject/UI/Color Picker", false, 10)]
|
||||
private static void CreateColorPicker(UnityEditor.MenuCommand menuCommand)
|
||||
{
|
||||
GameObject go = new GameObject("Color Picker");
|
||||
|
||||
go.AddComponent<ColorPicker>();
|
||||
|
||||
UnityEditor.GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject);
|
||||
|
||||
UnityEditor.Undo.RegisterCreatedObjectUndo(go, "Create " + go.name);
|
||||
UnityEditor.Selection.activeObject = go;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
11
Assets/Plugins/Color picker/ColorPicker.cs.meta
Normal file
11
Assets/Plugins/Color picker/ColorPicker.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: af3ff511a986a5c4e8dc1a7939e7b981
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
43
Assets/Plugins/Color picker/ColorPreview.cs
Normal file
43
Assets/Plugins/Color picker/ColorPreview.cs
Normal file
|
@ -0,0 +1,43 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
using TMPro;
|
||||
using Starpelly;
|
||||
|
||||
public class ColorPreview : MonoBehaviour
|
||||
{
|
||||
public Graphic previewGraphic;
|
||||
|
||||
public ColorPicker colorPicker;
|
||||
|
||||
public TMP_InputField hex;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
previewGraphic.color = colorPicker.color;
|
||||
colorPicker.onColorChanged += OnColorChanged;
|
||||
}
|
||||
|
||||
public void ChangeColor(Color c)
|
||||
{
|
||||
colorPicker.color = c;
|
||||
hex.text = c.Color2Hex();
|
||||
}
|
||||
|
||||
public void OnColorChanged(Color c)
|
||||
{
|
||||
previewGraphic.color = c;
|
||||
hex.text = c.Color2Hex();
|
||||
}
|
||||
|
||||
public void SetColorFromHex(string hex)
|
||||
{
|
||||
colorPicker.color = Starpelly.Colors.Hex2RGB(hex);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (colorPicker != null)
|
||||
colorPicker.onColorChanged -= OnColorChanged;
|
||||
}
|
||||
}
|
11
Assets/Plugins/Color picker/ColorPreview.cs.meta
Normal file
11
Assets/Plugins/Color picker/ColorPreview.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5c2c42ee235f17049ab3792499eccc59
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -4,9 +4,10 @@ namespace Starpelly
|
|||
{
|
||||
public static class Colors
|
||||
{
|
||||
public static string Color2Hex(this Color32 color)
|
||||
public static string Color2Hex(this Color color)
|
||||
{
|
||||
string hex = color.r.ToString("X2") + color.g.ToString("X2") + color.b.ToString("X2");
|
||||
Color32 col = (Color32)color;
|
||||
string hex = col.r.ToString("X2") + col.g.ToString("X2") + col.b.ToString("X2");
|
||||
return hex;
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 631 B After Width: | Height: | Size: 38 KiB |
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using RhythmHeavenMania.Util;
|
||||
|
@ -20,8 +22,13 @@ namespace RhythmHeavenMania
|
|||
public int track;
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public float length;
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public float valA;
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public float valB;
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public float valC;
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public int type;
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public EasingFunction.Ease ease;
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public Color colorA;
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public Color colorB;
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public Color colorC;
|
||||
public string datamodel;
|
||||
[JsonIgnore] public Editor.Track.TimelineEventObj eventObj;
|
||||
|
||||
|
|
|
@ -73,6 +73,8 @@ namespace RhythmHeavenMania
|
|||
}
|
||||
|
||||
GameManager.instance.SetCurrentEventToClosest(beat);
|
||||
songPosBeat = beat;
|
||||
songPositionInBeats = songPosBeat;
|
||||
}
|
||||
|
||||
public void Play(float beat)
|
||||
|
|
|
@ -9,11 +9,8 @@ namespace RhythmHeavenMania
|
|||
public class EventCaller : MonoBehaviour
|
||||
{
|
||||
public Transform GamesHolder;
|
||||
public float currentBeat;
|
||||
public float currentLength;
|
||||
public float currentValA;
|
||||
public Beatmap.Entity currentEntity = new Beatmap.Entity();
|
||||
public string currentSwitchGame;
|
||||
public int currentType;
|
||||
|
||||
public delegate void EventCallback();
|
||||
|
||||
|
@ -37,6 +34,8 @@ namespace RhythmHeavenMania
|
|||
{
|
||||
instance = this;
|
||||
|
||||
currentEntity = new Beatmap.Entity();
|
||||
|
||||
Minigames.Init(this);
|
||||
|
||||
List<Minigames.Minigame> minigamesInBeatmap = new List<Minigames.Minigame>();
|
||||
|
@ -57,7 +56,7 @@ namespace RhythmHeavenMania
|
|||
private void Update()
|
||||
{
|
||||
if (GameManager.instance.currentEvent >= 0 && GameManager.instance.currentEvent < GameManager.instance.Beatmap.entities.Count)
|
||||
currentBeat = GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent].beat;
|
||||
currentEntity.beat = GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent].beat;
|
||||
}
|
||||
|
||||
public void CallEvent(string event_)
|
||||
|
@ -67,9 +66,7 @@ namespace RhythmHeavenMania
|
|||
|
||||
try
|
||||
{
|
||||
currentLength = GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent].length;
|
||||
currentType = GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent].type;
|
||||
currentValA = GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent].valA;
|
||||
currentEntity = (Beatmap.Entity)GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent].Clone();
|
||||
|
||||
if (details.Length > 2) currentSwitchGame = details[2];
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ namespace RhythmHeavenMania
|
|||
public Camera GameCamera, CursorCam;
|
||||
public CircleCursor CircleCursor;
|
||||
[HideInInspector] public GameObject GamesHolder;
|
||||
public Games.Global.Flash fade;
|
||||
|
||||
[Header("Games")]
|
||||
public string currentGame;
|
||||
|
@ -35,6 +36,9 @@ namespace RhythmHeavenMania
|
|||
public float startBeat;
|
||||
private GameObject currentGameO;
|
||||
public bool autoplay;
|
||||
|
||||
public event Action<float> onBeatChanged;
|
||||
|
||||
public int BeatmapEntities()
|
||||
{
|
||||
return Beatmap.entities.Count + Beatmap.tempoChanges.Count;
|
||||
|
@ -57,7 +61,10 @@ namespace RhythmHeavenMania
|
|||
sp.color = Color.black;
|
||||
sp.sprite = Resources.Load<Sprite>("Sprites/GeneralPurpose/Square");
|
||||
sp.sortingOrder = 30000;
|
||||
// this.gameObject.layer = 3;
|
||||
this.gameObject.layer = 3;
|
||||
|
||||
GameObject fade = new GameObject();
|
||||
this.fade = fade.AddComponent<Games.Global.Flash>();
|
||||
|
||||
if (txt != null)
|
||||
{
|
||||
|
@ -177,6 +184,7 @@ namespace RhythmHeavenMania
|
|||
public void Play(float beat)
|
||||
{
|
||||
StartCoroutine(PlayCo(beat));
|
||||
onBeatChanged?.Invoke(beat);
|
||||
}
|
||||
|
||||
private IEnumerator PlayCo(float beat)
|
||||
|
@ -204,6 +212,7 @@ namespace RhythmHeavenMania
|
|||
{
|
||||
Conductor.instance.Stop(beat);
|
||||
SetCurrentEventToClosest(beat);
|
||||
onBeatChanged?.Invoke(beat);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -219,6 +228,7 @@ namespace RhythmHeavenMania
|
|||
public void SetCurrentEventToClosest(float beat)
|
||||
{
|
||||
SortEventsList();
|
||||
onBeatChanged?.Invoke(beat);
|
||||
if (Beatmap.entities.Count > 0)
|
||||
{
|
||||
List<float> entities = Beatmap.entities.Select(c => c.beat).ToList();
|
||||
|
|
8
Assets/Scripts/Games/Global.meta
Normal file
8
Assets/Scripts/Games/Global.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2a3d05dfe6f7cf84398844e087744cd0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
116
Assets/Scripts/Games/Global/Flash.cs
Normal file
116
Assets/Scripts/Games/Global/Flash.cs
Normal file
|
@ -0,0 +1,116 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
using RhythmHeavenMania.Util;
|
||||
using System.Linq;
|
||||
|
||||
namespace RhythmHeavenMania.Games.Global
|
||||
{
|
||||
public class Flash : MonoBehaviour
|
||||
{
|
||||
public float startBeat;
|
||||
public float length;
|
||||
|
||||
public Color startColor;
|
||||
public Color endColor;
|
||||
|
||||
public EasingFunction.Ease ease;
|
||||
private EasingFunction.Function func;
|
||||
|
||||
private SpriteRenderer spriteRenderer;
|
||||
|
||||
[SerializeField] private Color currentCol;
|
||||
|
||||
private List<Beatmap.Entity> allFadeEvents = new List<Beatmap.Entity>();
|
||||
|
||||
private void Start()
|
||||
{
|
||||
this.gameObject.transform.SetParent(GameManager.instance.gameObject.transform);
|
||||
this.gameObject.layer = 3;
|
||||
this.gameObject.transform.localScale = new Vector3(1, 1);
|
||||
|
||||
spriteRenderer = this.gameObject.AddComponent<SpriteRenderer>();
|
||||
|
||||
spriteRenderer.color = startColor;
|
||||
spriteRenderer.sortingOrder = 30001;
|
||||
spriteRenderer.sprite = Resources.Load<Sprite>("Sprites/GeneralPurpose/Square");
|
||||
|
||||
func = EasingFunction.GetEasingFunction(EasingFunction.Ease.Linear);
|
||||
|
||||
GameManager.instance.onBeatChanged += OnBeatChanged;
|
||||
}
|
||||
|
||||
public void OnBeatChanged(float beat)
|
||||
{
|
||||
// I really need to create a class for objects that are constant like the Spaceball Camera
|
||||
// startColor = new Color(1, 1, 1, 0);
|
||||
// endColor = new Color(1, 1, 1, 0);
|
||||
|
||||
allFadeEvents = EventCaller.GetAllInGameManagerList("gameManager", new string[] { "flash" });
|
||||
Test(beat);
|
||||
}
|
||||
|
||||
private void Test(float beat)
|
||||
{
|
||||
Color startCol = Color.white;
|
||||
Color endCol = Color.white;
|
||||
|
||||
bool override_ = false;
|
||||
|
||||
if (allFadeEvents.Count > 0)
|
||||
{
|
||||
Beatmap.Entity startEntity = null;
|
||||
|
||||
for (int i = 0; i < allFadeEvents.Count; i++)
|
||||
{
|
||||
if (allFadeEvents[i].beat <= beat)
|
||||
{
|
||||
startEntity = allFadeEvents[i];
|
||||
}
|
||||
else if (i == 0 && allFadeEvents[i].beat > beat)
|
||||
{
|
||||
startEntity = allFadeEvents[i];
|
||||
override_ = true;
|
||||
startCol = new Color(1, 1, 1, 0);
|
||||
endCol = new Color(1, 1, 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (startEntity != null)
|
||||
{
|
||||
if (!override_)
|
||||
{
|
||||
Color colA = startEntity.colorA;
|
||||
Color colB = startEntity.colorB;
|
||||
|
||||
startCol = new Color(colA.r, colA.g, colA.b, startEntity.valA);
|
||||
endCol = new Color(colB.r, colB.g, colB.b, startEntity.valB);
|
||||
}
|
||||
|
||||
SetFade(startEntity.beat, startEntity.length, startCol, endCol, startEntity.ease);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetFade(float beat, float length, Color startCol, Color endCol, EasingFunction.Ease ease)
|
||||
{
|
||||
this.startBeat = beat;
|
||||
this.length = length;
|
||||
this.startColor = startCol;
|
||||
this.endColor = endCol;
|
||||
this.ease = ease;
|
||||
func = EasingFunction.GetEasingFunction(ease);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
Test(Conductor.instance.songPositionInBeats);
|
||||
float normalizedBeat = Conductor.instance.GetPositionFromBeat(startBeat, length);
|
||||
// normalizedBeat = Mathf.Clamp01(normalizedBeat);
|
||||
|
||||
currentCol = new Color(func(startColor.r, endColor.r, normalizedBeat), func(startColor.g, endColor.g, normalizedBeat), func(startColor.b, endColor.b, normalizedBeat), func(startColor.a, endColor.a, normalizedBeat));
|
||||
spriteRenderer.color = currentCol;
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Games/Global/Flash.cs.meta
Normal file
11
Assets/Scripts/Games/Global/Flash.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 16a839834af94a042a3feb7a4762bafd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -97,7 +97,6 @@ namespace RhythmHeavenMania.Games.Spaceball
|
|||
}
|
||||
else
|
||||
{
|
||||
EasingFunction.Ease ease = EasingFunction.Ease.EaseInOutCirc;
|
||||
EasingFunction.Function func = EasingFunction.GetEasingFunction(lastEase);
|
||||
|
||||
float newPosZ = func(lastCamDistance, currentZoomCamDistance, normalizedBeat);
|
||||
|
|
|
@ -146,7 +146,7 @@ namespace RhythmHeavenMania.Editor
|
|||
|
||||
private void SelectEvents()
|
||||
{
|
||||
if (!Input.GetKey(KeyCode.LeftShift) && !Timeline.instance.InteractingWithEvents() && !Timeline.instance.MouseInRectTransform(Editor.instance.eventSelectorBG)) Selections.instance.DeselectAll();
|
||||
if (!Input.GetKey(KeyCode.LeftShift) && !Timeline.instance.InteractingWithEvents() && Editor.instance.canSelect) Selections.instance.DeselectAll();
|
||||
|
||||
int selected = 0;
|
||||
|
||||
|
|
25
Assets/Scripts/LevelEditor/DisableSelectOnHover.cs
Normal file
25
Assets/Scripts/LevelEditor/DisableSelectOnHover.cs
Normal file
|
@ -0,0 +1,25 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
namespace RhythmHeavenMania.Editor
|
||||
{
|
||||
public class DisableSelectOnHover : MonoBehaviour
|
||||
{
|
||||
public EventParameterManager eventParameterManager;
|
||||
|
||||
// this is fucking retarded
|
||||
private void LateUpdate()
|
||||
{
|
||||
eventParameterManager.canDisable = true;
|
||||
for (int i = 0; i < transform.childCount; i++)
|
||||
{
|
||||
if (Editor.MouseInRectTransform(transform.GetChild(i).GetComponent<RectTransform>()))
|
||||
{
|
||||
eventParameterManager.canDisable = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/LevelEditor/DisableSelectOnHover.cs.meta
Normal file
11
Assets/Scripts/LevelEditor/DisableSelectOnHover.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c29b4f68c2b2e3849af4ab850c275cea
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -56,6 +56,7 @@ namespace RhythmHeavenMania.Editor
|
|||
private string remixName = "";
|
||||
private bool fullscreen;
|
||||
public bool discordDuringTesting = false;
|
||||
public bool canSelect = true;
|
||||
|
||||
public static Editor instance { get; private set; }
|
||||
|
||||
|
@ -63,6 +64,7 @@ namespace RhythmHeavenMania.Editor
|
|||
{
|
||||
instance = this;
|
||||
Initializer = GetComponent<Initializer>();
|
||||
canSelect = true;
|
||||
}
|
||||
|
||||
public void Init()
|
||||
|
@ -134,7 +136,7 @@ namespace RhythmHeavenMania.Editor
|
|||
}
|
||||
}
|
||||
|
||||
if (Timeline.instance.timelineState.selected)
|
||||
if (Timeline.instance.timelineState.selected && Editor.instance.canSelect)
|
||||
{
|
||||
if (Input.GetMouseButtonUp(0))
|
||||
{
|
||||
|
@ -408,5 +410,10 @@ namespace RhythmHeavenMania.Editor
|
|||
{
|
||||
GameEventSelectorTitle.text = txt;
|
||||
}
|
||||
|
||||
public static bool MouseInRectTransform(RectTransform rectTransform)
|
||||
{
|
||||
return (rectTransform.gameObject.activeSelf && RectTransformUtility.RectangleContainsScreenPoint(rectTransform, Input.mousePosition, Editor.instance.EditorCamera));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -16,6 +16,7 @@ namespace RhythmHeavenMania.Editor
|
|||
[SerializeField] private GameObject IntegerP;
|
||||
[SerializeField] private GameObject FloatP;
|
||||
[SerializeField] private GameObject DropdownP;
|
||||
[SerializeField] private GameObject ColorP;
|
||||
|
||||
public Beatmap.Entity entity;
|
||||
|
||||
|
@ -23,6 +24,8 @@ namespace RhythmHeavenMania.Editor
|
|||
|
||||
private int childCountAtStart;
|
||||
|
||||
public bool canDisable = true;
|
||||
|
||||
public static EventParameterManager instance { get; set; }
|
||||
|
||||
private void Awake()
|
||||
|
@ -39,7 +42,7 @@ namespace RhythmHeavenMania.Editor
|
|||
{
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
if (!Timeline.instance.MouseInRectTransform(Editor.instance.eventSelectorBG) && active)
|
||||
if (canDisable && active)
|
||||
{
|
||||
Disable();
|
||||
}
|
||||
|
@ -107,6 +110,10 @@ namespace RhythmHeavenMania.Editor
|
|||
{
|
||||
prefab = DropdownP;
|
||||
}
|
||||
else if (objType == typeof(Color))
|
||||
{
|
||||
prefab = ColorP;
|
||||
}
|
||||
|
||||
GameObject input = Instantiate(prefab);
|
||||
input.transform.SetParent(this.gameObject.transform);
|
||||
|
|
|
@ -4,6 +4,7 @@ using UnityEngine;
|
|||
using UnityEngine.UI;
|
||||
|
||||
using TMPro;
|
||||
using Starpelly;
|
||||
|
||||
using RhythmHeavenMania.Util;
|
||||
|
||||
|
@ -23,8 +24,14 @@ namespace RhythmHeavenMania.Editor
|
|||
[Space(10)]
|
||||
public TMP_Dropdown dropdown;
|
||||
|
||||
private string propertyName;
|
||||
[Header("Color")]
|
||||
[Space(10)]
|
||||
public Button ColorBTN;
|
||||
public RectTransform ColorTable;
|
||||
public bool colorTableActive;
|
||||
public ColorPreview colorPreview;
|
||||
|
||||
private string propertyName;
|
||||
|
||||
public void SetProperties(string propertyName, object type, string caption)
|
||||
{
|
||||
|
@ -97,6 +104,40 @@ namespace RhythmHeavenMania.Editor
|
|||
parameterManager.entity[propertyName] = (EasingFunction.Ease)dropdown.value;
|
||||
});
|
||||
}
|
||||
else if (objType == typeof(Color))
|
||||
{
|
||||
colorPreview.colorPicker.onColorChanged += delegate
|
||||
{
|
||||
parameterManager.entity[propertyName] = (Color)colorPreview.colorPicker.color;
|
||||
};
|
||||
|
||||
Color paramCol = (Color)parameterManager.entity[propertyName];
|
||||
|
||||
ColorBTN.onClick.AddListener(delegate
|
||||
{
|
||||
ColorTable.gameObject.SetActive(true);
|
||||
colorTableActive = true;
|
||||
colorPreview.ChangeColor(paramCol);
|
||||
});
|
||||
|
||||
colorPreview.ChangeColor(paramCol);
|
||||
ColorTable.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (colorTableActive)
|
||||
{
|
||||
if (!Editor.MouseInRectTransform(ColorTable))
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
ColorTable.gameObject.SetActive(false);
|
||||
colorTableActive = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -244,7 +244,7 @@ namespace RhythmHeavenMania.Editor.Track
|
|||
}
|
||||
|
||||
|
||||
if (Input.GetMouseButton(1) && !Conductor.instance.isPlaying && MouseInRectTransform(TimelineGridSelect))
|
||||
if (Input.GetMouseButton(1) && !Conductor.instance.isPlaying && Editor.MouseInRectTransform(TimelineGridSelect))
|
||||
{
|
||||
movingPlayback = true;
|
||||
}
|
||||
|
@ -429,11 +429,6 @@ namespace RhythmHeavenMania.Editor.Track
|
|||
{
|
||||
return (this.gameObject.activeSelf && RectTransformUtility.RectangleContainsScreenPoint(TimelineContent.transform.parent.gameObject.GetComponent<RectTransform>(), Input.mousePosition, Editor.instance.EditorCamera));
|
||||
}
|
||||
|
||||
public bool MouseInRectTransform(RectTransform rectTransform)
|
||||
{
|
||||
return (rectTransform.gameObject.activeSelf && RectTransformUtility.RectangleContainsScreenPoint(rectTransform, Input.mousePosition, Editor.instance.EditorCamera));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Functions
|
||||
|
|
|
@ -80,83 +80,112 @@ namespace RhythmHeavenMania
|
|||
new GameAction("switchGame", delegate { GameManager.instance.SwitchGame(eventCaller.currentSwitchGame); }, 0.5f),
|
||||
new GameAction("end", delegate { Debug.Log("end"); }),
|
||||
new GameAction("skill star", delegate { }, 1f, true),
|
||||
new GameAction("flash", delegate
|
||||
{
|
||||
|
||||
/*Color colA = eventCaller.currentEntity.colorA;
|
||||
Color colB = eventCaller.currentEntity.colorB;
|
||||
|
||||
Color startCol = new Color(colA.r, colA.g, colA.b, eventCaller.currentEntity.valA);
|
||||
Color endCol = new Color(colB.r, colB.g, colB.b, eventCaller.currentEntity.valB);
|
||||
|
||||
GameManager.instance.fade.SetFade(eventCaller.currentEntity.beat, eventCaller.currentEntity.length, startCol, endCol, eventCaller.currentEntity.ease);*/
|
||||
|
||||
}, 1f, true, new List<Param>()
|
||||
{
|
||||
new Param("colorA", Color.white, "Start Color"),
|
||||
new Param("colorB", Color.white, "End Color"),
|
||||
new Param("valA", new EntityTypes.Float(0, 1, 1), "Start Opacity"),
|
||||
new Param("valB", new EntityTypes.Float(0, 1, 0), "End Opacity"),
|
||||
new Param("ease", EasingFunction.Ease.Linear, "Ease")
|
||||
} ),
|
||||
}),
|
||||
new Minigame("countIn", "Count-Ins", "", false, true, new List<GameAction>()
|
||||
{
|
||||
new GameAction("cowbell", delegate { Jukebox.PlayOneShot("count-ins/cowbell"); }, 1f),
|
||||
new GameAction("one", delegate { Jukebox.PlayOneShot("count-ins/one1"); }, 1f),
|
||||
new GameAction("one (alt)", delegate { Jukebox.PlayOneShot("count-ins/one2"); }, 1f),
|
||||
new GameAction("two", delegate { Jukebox.PlayOneShot("count-ins/two1"); }, 1f),
|
||||
new GameAction("two (alt)", delegate { Jukebox.PlayOneShot("count-ins/two2"); }, 1f),
|
||||
new GameAction("three", delegate { Jukebox.PlayOneShot("count-ins/three1"); }, 1f),
|
||||
new GameAction("three (alt)", delegate { Jukebox.PlayOneShot("count-ins/three2"); }, 1f),
|
||||
new GameAction("four", delegate { Jukebox.PlayOneShot("count-ins/four1"); }, 1f),
|
||||
new GameAction("four (alt)", delegate { Jukebox.PlayOneShot("count-ins/four2"); }, 1f),
|
||||
new GameAction("and", delegate { Jukebox.PlayOneShot("count-ins/and"); }, 0.5f),
|
||||
new GameAction("go!", delegate { Jukebox.PlayOneShot("count-ins/go1"); }, 1f),
|
||||
new GameAction("go! (alt)", delegate { Jukebox.PlayOneShot("count-ins/go2"); }, 1f),
|
||||
new GameAction("ready!", delegate
|
||||
{
|
||||
new GameAction("one", delegate { Jukebox.PlayOneShot("count-ins/one1"); }, 1f),
|
||||
new GameAction("one (alt)", delegate { Jukebox.PlayOneShot("count-ins/one2"); }, 1f),
|
||||
new GameAction("two", delegate { Jukebox.PlayOneShot("count-ins/two1"); }, 1f),
|
||||
new GameAction("two (alt)", delegate { Jukebox.PlayOneShot("count-ins/two2"); }, 1f),
|
||||
new GameAction("three", delegate { Jukebox.PlayOneShot("count-ins/three1"); }, 1f),
|
||||
new GameAction("three (alt)", delegate { Jukebox.PlayOneShot("count-ins/three2"); }, 1f),
|
||||
new GameAction("four", delegate { Jukebox.PlayOneShot("count-ins/four1"); }, 1f),
|
||||
new GameAction("four (alt)", delegate { Jukebox.PlayOneShot("count-ins/four2"); }, 1f),
|
||||
new GameAction("and", delegate { Jukebox.PlayOneShot("count-ins/and"); }, 0.5f),
|
||||
new GameAction("go!", delegate { Jukebox.PlayOneShot("count-ins/go1"); }, 1f),
|
||||
new GameAction("go! (alt)", delegate { Jukebox.PlayOneShot("count-ins/go2"); }, 1f),
|
||||
new GameAction("ready!", delegate
|
||||
{
|
||||
MultiSound.Play(new MultiSound.Sound[]
|
||||
{
|
||||
new MultiSound.Sound("count-ins/ready1", eventCaller.currentBeat),
|
||||
new MultiSound.Sound("count-ins/ready2", eventCaller.currentBeat + 1f),
|
||||
new MultiSound.Sound("count-ins/ready1", eventCaller.currentEntity.beat),
|
||||
new MultiSound.Sound("count-ins/ready2", eventCaller.currentEntity.beat + 1f),
|
||||
}, false);
|
||||
}, 2f),
|
||||
}),
|
||||
new Minigame("forkLifter", "Fork Lifter", "FFFFFF", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("pea", delegate { ForkLifter.instance.Flick(eventCaller.currentBeat, 0); }, 3),
|
||||
new GameAction("topbun", delegate { ForkLifter.instance.Flick(eventCaller.currentBeat, 1); }, 3),
|
||||
new GameAction("burger", delegate { ForkLifter.instance.Flick(eventCaller.currentBeat, 2); }, 3),
|
||||
new GameAction("bottombun", delegate { ForkLifter.instance.Flick(eventCaller.currentBeat, 3); }, 3),
|
||||
new GameAction("pea", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 0); }, 3),
|
||||
new GameAction("topbun", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 1); }, 3),
|
||||
new GameAction("burger", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 2); }, 3),
|
||||
new GameAction("bottombun", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 3); }, 3),
|
||||
new GameAction("prepare", delegate { ForkLifter.instance.ForkLifterHand.Prepare(); }, 0.5f),
|
||||
new GameAction("gulp", delegate { ForkLifterPlayer.instance.Eat(); }),
|
||||
new GameAction("sigh", delegate { Jukebox.PlayOneShot("sigh"); })
|
||||
}),
|
||||
new Minigame("clappyTrio", "The Clappy Trio", "29E7FF", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("clap", delegate { ClappyTrio.instance.Clap(eventCaller.currentBeat, eventCaller.currentLength); }, 3, true),
|
||||
new GameAction("bop", delegate { ClappyTrio.instance.Bop(eventCaller.currentBeat); } ),
|
||||
new GameAction("clap", delegate { ClappyTrio.instance.Clap(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 3, true),
|
||||
new GameAction("bop", delegate { ClappyTrio.instance.Bop(eventCaller.currentEntity.beat); } ),
|
||||
new GameAction("prepare", delegate { ClappyTrio.instance.Prepare(0); } ),
|
||||
new GameAction("prepare_alt", delegate { ClappyTrio.instance.Prepare(3); } ),
|
||||
}),
|
||||
new Minigame("spaceball", "Spaceball", "00A518", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("shoot", delegate { Spaceball.instance.Shoot(eventCaller.currentBeat, false, eventCaller.currentType); }, 2, false),
|
||||
new GameAction("shootHigh", delegate { Spaceball.instance.Shoot(eventCaller.currentBeat, true, eventCaller.currentType); }, 3),
|
||||
new GameAction("costume", delegate { Spaceball.instance.Costume(eventCaller.currentType); }, 1f, false, new List<Param>() { new Param("type", new EntityTypes.Integer(0, 2), "type") } ),
|
||||
new GameAction("alien", delegate { Spaceball.instance.alien.Show(eventCaller.currentBeat); } ),
|
||||
new GameAction("camera", delegate { Spaceball.instance.OverrideCurrentZoom(); }, 4, true, new List<Param>() { new Param("valA", new EntityTypes.Integer(1, 320, 10), "zoom"), new Param("ease", EasingFunction.Ease.Linear, "ease") } ),
|
||||
new GameAction("shoot", delegate { Spaceball.instance.Shoot(eventCaller.currentEntity.beat, false, eventCaller.currentEntity.type); }, 2, false),
|
||||
new GameAction("shootHigh", delegate { Spaceball.instance.Shoot(eventCaller.currentEntity.beat, true, eventCaller.currentEntity.type); }, 3),
|
||||
new GameAction("costume", delegate { Spaceball.instance.Costume(eventCaller.currentEntity.type); }, 1f, false, new List<Param>()
|
||||
{
|
||||
new Param("type", new EntityTypes.Integer(0, 2), "Type")
|
||||
} ),
|
||||
new GameAction("alien", delegate { Spaceball.instance.alien.Show(eventCaller.currentEntity.beat); } ),
|
||||
new GameAction("camera", delegate { Spaceball.instance.OverrideCurrentZoom(); }, 4, true, new List<Param>()
|
||||
{
|
||||
new Param("valA", new EntityTypes.Integer(1, 320, 10), "Zoom"),
|
||||
new Param("ease", EasingFunction.Ease.Linear, "Ease")
|
||||
} ),
|
||||
new GameAction("prepare dispenser", delegate { Spaceball.instance.PrepareDispenser(); }, 1 ),
|
||||
}),
|
||||
new Minigame("karateman", "Karate Man", "70A8D8", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("bop", delegate { KarateMan.instance.Bop(eventCaller.currentBeat, eventCaller.currentLength); }, 0.5f, true),
|
||||
new GameAction("pot", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 0); }, 2),
|
||||
new GameAction("bulb", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 1); }, 2),
|
||||
new GameAction("rock", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 2); }, 2),
|
||||
new GameAction("ball", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 3); }, 2),
|
||||
new GameAction("kick", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 4); }, 4.5f),
|
||||
new GameAction("combo", delegate { KarateMan.instance.Combo(eventCaller.currentBeat); }, 4f),
|
||||
new GameAction("hit3", delegate { KarateMan.instance.Hit3(eventCaller.currentBeat); }),
|
||||
new GameAction("hit4", delegate { KarateMan.instance.Hit4(eventCaller.currentBeat); }),
|
||||
new GameAction("prepare", delegate { KarateMan.instance.Prepare(eventCaller.currentBeat, eventCaller.currentLength); }, 1f, true),
|
||||
new GameAction("bop", delegate { KarateMan.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 0.5f, true),
|
||||
new GameAction("pot", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 0); }, 2),
|
||||
new GameAction("bulb", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 1); }, 2),
|
||||
new GameAction("rock", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 2); }, 2),
|
||||
new GameAction("ball", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 3); }, 2),
|
||||
new GameAction("kick", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 4); }, 4.5f),
|
||||
new GameAction("combo", delegate { KarateMan.instance.Combo(eventCaller.currentEntity.beat); }, 4f),
|
||||
new GameAction("hit3", delegate { KarateMan.instance.Hit3(eventCaller.currentEntity.beat); }),
|
||||
new GameAction("hit4", delegate { KarateMan.instance.Hit4(eventCaller.currentEntity.beat); }),
|
||||
new GameAction("prepare", delegate { KarateMan.instance.Prepare(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 1f, true),
|
||||
new GameAction("bgfxon", delegate { KarateMan.instance.BGFXOn(); } ),
|
||||
new GameAction("bgfxoff", delegate { KarateMan.instance.BGFXOff(); }),
|
||||
new GameAction("tacobell", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 6); }, 2),
|
||||
new GameAction("tacobell", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 6); }, 2),
|
||||
}),
|
||||
new Minigame("spaceSoccer", "Space Soccer", "B888F8", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("ball dispense", delegate { SpaceSoccer.instance.Dispense(eventCaller.currentBeat); }, 2f),
|
||||
new GameAction("ball dispense", delegate { SpaceSoccer.instance.Dispense(eventCaller.currentEntity.beat); }, 2f),
|
||||
new GameAction("keep-up", delegate { }, 4f, true),
|
||||
new GameAction("high kick-toe!", delegate { }, 3f, false, new List<Param>() { new Param("valA", new EntityTypes.Float(0, 1), "swing") }),
|
||||
new GameAction("high kick-toe!", delegate { }, 3f, false, new List<Param>()
|
||||
{
|
||||
new Param("valA", new EntityTypes.Float(0, 1), "Swing")
|
||||
}),
|
||||
}),
|
||||
new Minigame("djSchool", "DJ School \n<color=#eb5454>[Non-Playable]</color>", "008c97", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("bop", delegate { DJSchool.instance.Bop(eventCaller.currentBeat, eventCaller.currentLength); }, 0.5f, true),
|
||||
new GameAction("break c'mon ooh", delegate { DJSchool.instance.BreakCmon(eventCaller.currentBeat); }, 3f),
|
||||
new GameAction("scratch-o hey", delegate { DJSchool.instance.ScratchoHey(eventCaller.currentBeat); }, 3f),
|
||||
new GameAction("bop", delegate { DJSchool.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 0.5f, true),
|
||||
new GameAction("break c'mon ooh", delegate { DJSchool.instance.BreakCmon(eventCaller.currentEntity.beat); }, 3f),
|
||||
new GameAction("scratch-o hey", delegate { DJSchool.instance.ScratchoHey(eventCaller.currentEntity.beat); }, 3f),
|
||||
}),
|
||||
/*new Minigame("rhythmRally", "Rhythm Rally", "B888F8", true, false, new List<GameAction>()
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@ TagManager:
|
|||
- UI
|
||||
- Debug
|
||||
- EventBlocks
|
||||
-
|
||||
- EventProperties
|
||||
-
|
||||
-
|
||||
-
|
||||
|
|
Loading…
Reference in a new issue