Merge branch 'main' into fix-materials

This commit is contained in:
Cat Flynn 2021-01-10 17:59:04 +00:00
commit 832a2f69d7
38 changed files with 1662 additions and 1750 deletions

BIN
Assets/.DS_Store vendored

Binary file not shown.

View File

@ -55,7 +55,7 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: LEMONMILK-Regular SDF Material
m_Shader: {fileID: 4800000, guid: 68e6db2ebdc24f95958faec2be5558d6, type: 3}
m_Shader: {fileID: 4800000, guid: dd89cf5b9246416f84610a006f916af7, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0

BIN
Assets/Images/crosshairs64.png (Stored with Git LFS)

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -65,7 +65,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NoiseMap:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 32d99a4d1161f0f4ca4fca2997778b37, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:

View File

@ -13,7 +13,7 @@ Material:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:

View File

@ -26,7 +26,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1738226812227614583}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1726.4172, y: 488.75378, z: 274.96027}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}

View File

@ -14,6 +14,8 @@ GameObject:
- component: {fileID: 233269787904781725}
- component: {fileID: 2766037370157449026}
- component: {fileID: 2122656558574222561}
- component: {fileID: -3971665732303992234}
- component: {fileID: -4901459127090716512}
m_Layer: 7
m_Name: Enemy
m_TagString: Untagged
@ -109,7 +111,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d77551efeb20a4bdabb517c8351695ff, type: 3}
m_Name:
m_EditorClassIdentifier:
maxHealth: 1
maxHealth: 4
--- !u!114 &2122656558574222561
MonoBehaviour:
m_ObjectHideFlags: 0
@ -122,3 +124,30 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5b2c8b098025f4e2f997759b5c00fef7, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &-3971665732303992234
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1738226812227614583}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1c18e41c4d38f4467bda24e543fec25f, type: 3}
m_Name:
m_EditorClassIdentifier:
value: 1000
--- !u!114 &-4901459127090716512
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1738226812227614583}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 990644fedd5c4b99befe1da660313b53, type: 3}
m_Name:
m_EditorClassIdentifier:
xMin: -10.1
xMax: 10.1

View File

@ -0,0 +1,98 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1738226812227614583
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1738226812227614580}
- component: {fileID: 1738226812227614581}
- component: {fileID: 1738226812227614582}
- component: {fileID: -4901459127090716512}
m_Layer: 7
m_Name: Obstacle
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1738226812227614580
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1738226812227614583}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.1, y: 0.05, z: 0.6}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &1738226812227614581
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1738226812227614583}
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &1738226812227614582
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1738226812227614583}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
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
m_AdditionalVertexStreams: {fileID: 0}
--- !u!114 &-4901459127090716512
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1738226812227614583}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 990644fedd5c4b99befe1da660313b53, type: 3}
m_Name:
m_EditorClassIdentifier:
xMin: -10.1
xMax: 10.1

View File

@ -1,7 +1,6 @@
fileFormatVersion: 2
guid: a626c4196d1da4a9197aabfe96a37078
folderAsset: yes
DefaultImporter:
guid: a2fc4fe02da6b4c9dad4201dd60e32cc
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:

View File

@ -234,7 +234,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 186457103}
m_LocalRotation: {x: -0, y: 1, z: -0, w: 0}
m_LocalPosition: {x: 0, y: -2, z: 30}
m_LocalPosition: {x: 0, y: -2, z: 200}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
@ -274,9 +274,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4f8399031f014bee928b07d26fe8ee4c, type: 3}
m_Name:
m_EditorClassIdentifier:
pauseOnBeat: 16
pauseLengthInBeats: 0
beatOffset: 2
spawnOnBeat: 1
xMin: -10
xMax: 10
--- !u!114 &531937975 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5076175860835241000, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3}
@ -288,6 +288,175 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 3147f962613cca54f8a0b78929a2854b, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &532372215
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 532372218}
- component: {fileID: 532372217}
- component: {fileID: 532372216}
m_Layer: 0
m_Name: ObstacleSpawner
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &532372216
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 532372215}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4f8399031f014bee928b07d26fe8ee4c, type: 3}
m_Name:
m_EditorClassIdentifier:
spawnOnBeat: 1
xMin: -10
xMax: 10
--- !u!114 &532372217
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 532372215}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1226902ebd2674aefa463e6dc0e75ad7, type: 3}
m_Name:
m_EditorClassIdentifier:
bulletPool: {fileID: 1061155885}
weapon: {fileID: 11400000, guid: 3b5089173dc14483fbd118af334cc1cb, type: 2}
bulletPos: {fileID: 532372218}
input: {fileID: 532372216}
OnFire:
m_PersistentCalls:
m_Calls: []
OnBulletCollide:
m_PersistentCalls:
m_Calls: []
--- !u!4 &532372218
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 532372215}
m_LocalRotation: {x: -0, y: 1, z: -0, w: 0}
m_LocalPosition: {x: 0, y: -2, z: 200}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
--- !u!1 &726912288
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 726912292}
- component: {fileID: 726912291}
- component: {fileID: 726912290}
- component: {fileID: 726912289}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &726912289
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 726912288}
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 &726912290
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 726912288}
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 &726912291
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 726912288}
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: 25
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!224 &726912292
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 726912288}
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: 1330494722}
m_Father: {fileID: 0}
m_RootOrder: 8
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!1 &728836291
GameObject:
m_ObjectHideFlags: 0
@ -457,6 +626,52 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1061155884
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1061155886}
- component: {fileID: 1061155885}
m_Layer: 0
m_Name: ObstaclePool
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1061155885
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1061155884}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9463c7c973b354f1c882567f52337aed, type: 3}
m_Name:
m_EditorClassIdentifier:
numObjects: 3000
prefab: {fileID: 1738226812227614580, guid: a2fc4fe02da6b4c9dad4201dd60e32cc, type: 3}
numToSpawnPerFrame: 10
--- !u!4 &1061155886
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1061155884}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: -2, z: 30}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1077224733
PrefabInstance:
m_ObjectHideFlags: 0
@ -500,6 +715,10 @@ PrefabInstance:
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 9429becea685bce4fa7b6595601ea615, type: 2}
- target: {fileID: 3397488660842926092, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3397488660842926093, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3}
propertyPath: m_LocalScale.x
value: 1850.4741
@ -534,7 +753,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 3397488660859550701, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3}
propertyPath: m_LocalPosition.y
value: 9.773619
value: 8.773619
objectReference: {fileID: 0}
- target: {fileID: 3397488660859550701, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3}
propertyPath: m_LocalPosition.z
@ -898,12 +1117,176 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1222495242}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -0.62, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1173812008}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1330494721
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1330494722}
- component: {fileID: 1330494724}
- component: {fileID: 1330494723}
- component: {fileID: 1330494726}
- component: {fileID: 1330494725}
m_Layer: 5
m_Name: Score
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1330494722
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1330494721}
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: 726912292}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -30}
m_SizeDelta: {x: 0, y: 50}
m_Pivot: {x: 0.5, y: 1}
--- !u!114 &1330494723
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1330494721}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text: 0
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 0f0f54895994248b0bf34c4b4d27beef, type: 2}
m_sharedMaterial: {fileID: -3347474280721358513, guid: 0f0f54895994248b0bf34c4b4d27beef, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 48
m_fontSizeBase: 48
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 8192
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 1
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!222 &1330494724
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1330494721}
m_CullTransparentMesh: 1
--- !u!114 &1330494725
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1330494721}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3da04f2795dd4afe8551debe01be4561, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1330494726
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1330494721}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 45e7636ea714949cd8358ebe56fef05f, type: 3}
m_Name:
m_EditorClassIdentifier:
timeSince: {fileID: 11400000, guid: 8f05f93192443bc42b8523048bde0dc4, type: 2}
scale: 0.25
ySquish: -0.15
characterSpacing: 10
--- !u!1 &1395215960
GameObject:
m_ObjectHideFlags: 0
@ -947,7 +1330,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 9463c7c973b354f1c882567f52337aed, type: 3}
m_Name:
m_EditorClassIdentifier:
numObjects: 3000
numObjects: 500
prefab: {fileID: 1738226812227614580, guid: e084e082567284f79a41423c4fe1adab, type: 3}
numToSpawnPerFrame: 10
--- !u!1 &1581716069
@ -1157,10 +1540,42 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 2145967175348613560, guid: 88246464365fd0745b75edfcff208598, type: 3}
propertyPath: bpm
value: 90
objectReference: {fileID: 0}
- target: {fileID: 2145967175348613560, guid: 88246464365fd0745b75edfcff208598, type: 3}
propertyPath: _onBeat.m_PersistentCalls.m_Calls.Array.size
value: 2
objectReference: {fileID: 0}
- target: {fileID: 2145967175348613560, guid: 88246464365fd0745b75edfcff208598, type: 3}
propertyPath: _onBeat.m_PersistentCalls.m_Calls.Array.data[1].m_Mode
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2145967175348613560, guid: 88246464365fd0745b75edfcff208598, type: 3}
propertyPath: _onBeat.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 186457106}
- target: {fileID: 2145967175348613560, guid: 88246464365fd0745b75edfcff208598, type: 3}
propertyPath: _onBeat.m_PersistentCalls.m_Calls.Array.data[1].m_Target
value:
objectReference: {fileID: 532372216}
- target: {fileID: 2145967175348613560, guid: 88246464365fd0745b75edfcff208598, type: 3}
propertyPath: _onBeat.m_PersistentCalls.m_Calls.Array.data[1].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 2145967175348613560, guid: 88246464365fd0745b75edfcff208598, type: 3}
propertyPath: _onBeat.m_PersistentCalls.m_Calls.Array.data[1].m_MethodName
value: OnBeat
objectReference: {fileID: 0}
- target: {fileID: 2145967175348613560, guid: 88246464365fd0745b75edfcff208598, type: 3}
propertyPath: _onBeat.m_PersistentCalls.m_Calls.Array.data[1].m_TargetAssemblyTypeName
value: BeatSpawner, Assembly-CSharp
objectReference: {fileID: 0}
- target: {fileID: 2145967175348613560, guid: 88246464365fd0745b75edfcff208598, type: 3}
propertyPath: _onBeat.m_PersistentCalls.m_Calls.Array.data[1].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
- target: {fileID: 2145967175348613561, guid: 88246464365fd0745b75edfcff208598, type: 3}
propertyPath: m_Name
value: Audio

View File

@ -0,0 +1,31 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Weapons.Scripts;
using Random = UnityEngine.Random;
public class AddScoreOnDie : MonoBehaviour
{
[SerializeField] private ulong value = 100;
private EntityHealth _health;
private void Awake()
{
_health = GetComponent<EntityHealth>();
}
private void OnEnable()
{
_health.Die += Die;
}
private void OnDisable()
{
_health.Die -= Die;
}
private void Die()
{
Score.Value += value + (ulong)Random.Range(-5, 5);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1c18e41c4d38f4467bda24e543fec25f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,17 +1,17 @@
using System;
using UnityEngine;
using UnityEngine.Scripting;
using Random = UnityEngine.Random;
public class BeatSpawner : ShootInputBase
{
[SerializeField] private int pauseOnBeat;
[SerializeField] private int pauseLengthInBeats;
[SerializeField] private int beatOffset;
[SerializeField] private int spawnOnBeat = 2;
[SerializeField] private float xMin = -10;
[SerializeField] private float xMax = 10;
private AudioBeatManager _audio;
private bool _shoot;
private bool _isPaused = false;
private void Awake()
{
@ -20,13 +20,9 @@ public class BeatSpawner : ShootInputBase
public void OnBeat(int beat)
{
if ((beat + beatOffset) % pauseOnBeat == 0)
_isPaused = true;
if ((beat + beatOffset + pauseLengthInBeats) % pauseOnBeat == 0)
_isPaused = false;
_shoot = !_isPaused;
_shoot = beat % spawnOnBeat == 0;
if (_shoot)
transform.position = new Vector3(Mathf.Lerp(xMin, xMax, Mathf.Sin(beat)), transform.position.y, transform.position.z);
}
public override bool IsShooting()

View File

@ -7,9 +7,13 @@ public class DisableOnDeath : MonoBehaviour
{
private EntityHealth _health;
private Renderer _renderer;
private Collider _collider;
private Color _color1;
private Color _color2;
private static readonly int Color1 = Shader.PropertyToID(COLOR_1);
private static readonly int Color2 = Shader.PropertyToID(COLOR_2);
private static readonly int Alpha = Shader.PropertyToID("_Alpha");
private const string COLOR_1 = "_Color1";
private const string COLOR_2 = "_Color2";
@ -18,17 +22,18 @@ public class DisableOnDeath : MonoBehaviour
{
_health = GetComponent<EntityHealth>();
_renderer = GetComponentInChildren<Renderer>();
_collider = GetComponentInChildren<Collider>();
_color1 = _renderer.material.GetColor(COLOR_1);
_color2 = _renderer.material.GetColor(COLOR_2);
_color1 = _renderer.material.GetColor(Color1);
_color2 = _renderer.material.GetColor(Color2);
}
private void OnEnable()
{
_health.Die += Die;
_renderer.material.SetColor(COLOR_1, _color1);
_renderer.material.SetColor(COLOR_2, _color2);
_collider.enabled = true;
_renderer.material.SetColor(Color1, _color1);
_renderer.material.SetColor(Color2, _color2);
}
private void OnDisable()
@ -40,7 +45,7 @@ public class DisableOnDeath : MonoBehaviour
{
var oldName = gameObject.name;
gameObject.name = "disabled";
_collider.enabled = false;
float x = 0;
DOTween.To(
() => x,
@ -49,19 +54,16 @@ public class DisableOnDeath : MonoBehaviour
var c1 = Color.Lerp(_color1, Color.white, t);
var c2 = Color.Lerp(_color2, Color.white, t);
_renderer.material.SetColor(COLOR_1, c1);
_renderer.material.SetColor(COLOR_2, c2);
_renderer.material.SetFloat("_Alpha", 1.0f-t);
_renderer.material.SetColor(Color1, c1);
_renderer.material.SetColor(Color2, c2);
_renderer.material.SetFloat(Alpha, 1.0f-t);
},
1.0f,
0.1f);
0.05f);
// _renderer.material.DOColor(Color.white, COLOR_1, 0.1f);
// _renderer.material.DOColor(Color.white, COLOR_2, 0.1f);
// _renderer.material.DOFade(0, 0.1f).SetDelay(0.2f);
transform.DOScale(Vector3.one * 1.5f, 0.3f).SetEase(Ease.OutQuint).OnComplete(() =>
transform.DOScale(Vector3.one * 1.5f, 0.15f).SetEase(Ease.OutQuint).OnComplete(() =>
{
gameObject.name = oldName;
gameObject.SetActive(false);

View File

@ -5,21 +5,18 @@ using UnityEngine;
[CreateAssetMenu]
public class EnemyAppearBehaviour : BaseBulletBehaviour
{
[SerializeField] private float zPos = 50f;
[SerializeField] private float moveInDuration = 0.5f;
[SerializeField] private float scaleUpDuration = 0.3f;
[SerializeField] private float scaleUpDelay = 0.2f;
[SerializeField] private float moveOutPos = -15f;
[SerializeField] private float moveOutDuration = 2f;
[SerializeField] private float scaleUpOverBeats = 1;
private static AudioBeatManager _audio;
public override void DoBehaviour(Transform bullet, float size, Vector3 pos)
{
if (_audio == null)
_audio = FindObjectOfType<AudioBeatManager>();
bullet.localScale = Vector3.zero;
bullet.localPosition = new Vector3(pos.x, pos.y, zPos);
DOTween.Sequence()
//.Append(bullet.DOMove(pos, moveInDuration).SetEase(Ease.OutQuint))
.Insert(scaleUpDelay, bullet.DORotate(new Vector3(0,0,45), moveInDuration/2f))
.Insert(scaleUpDelay + moveInDuration/2f, bullet.DORotate(Vector3.zero, moveInDuration/2f))
.Insert(scaleUpDelay, bullet.DOScale(Vector3.one * size, scaleUpDuration).SetEase(Ease.OutQuint));
bullet.localPosition = pos;
bullet.DOScale(Vector3.one * size, _audio.TimeBetweenBeats * scaleUpOverBeats).SetEase(Ease.OutQuint);
}
}

View File

@ -0,0 +1,29 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Ktyl.Util;
using TMPro;
using UnityEngine;
public class ScaleWithTime : MonoBehaviour
{
[SerializeField] private SerialFloat timeSince;
[SerializeField] private float scale = 1.5f;
[SerializeField] private float ySquish = -0.15f;
[SerializeField] private float characterSpacing = 10f;
private TextMeshProUGUI _text;
private void Awake()
{
_text = GetComponent<TextMeshProUGUI>();
}
// Update is called once per frame
void Update()
{
_text.characterSpacing = timeSince * timeSince * characterSpacing;
transform.localScale = new Vector3(1 + timeSince*timeSince * scale, 1 + timeSince*timeSince * ySquish, 1);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 45e7636ea714949cd8358ebe56fef05f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

17
Assets/Scripts/Score.cs Normal file
View File

@ -0,0 +1,17 @@
using System;
public static class Score
{
private static ulong _value;
public static ulong Value
{
get => _value;
set
{
_value = value;
ScoreUpdated?.Invoke(_value);
}
}
public static event Action<ulong> ScoreUpdated;
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 22e5c22e25d5491e9a6fdabcd5788ebf
timeCreated: 1610298027

View File

@ -0,0 +1,27 @@
using TMPro;
using UnityEngine;
public class UpdateScore : MonoBehaviour
{
private TextMeshProUGUI _text;
private void Awake()
{
_text = GetComponent<TextMeshProUGUI>();
}
private void OnEnable()
{
Score.ScoreUpdated += OnScoreUpdated;
}
private void OnDisable()
{
Score.ScoreUpdated -= OnScoreUpdated;
}
private void OnScoreUpdated(ulong obj)
{
_text.text = $"{obj:n0}";
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 3da04f2795dd4afe8551debe01be4561
timeCreated: 1610298154

175
Assets/Scripts/VertexJitter.cs Executable file
View File

@ -0,0 +1,175 @@
using UnityEngine;
using System.Collections;
namespace TMPro.Examples
{
public class VertexJitter : MonoBehaviour
{
public float AngleMultiplier = 1.0f;
public float SpeedMultiplier = 1.0f;
public float CurveScale = 1.0f;
private TMP_Text m_TextComponent;
private bool hasTextChanged;
/// <summary>
/// Structure to hold pre-computed animation data.
/// </summary>
private struct VertexAnim
{
public float angleRange;
public float angle;
public float speed;
}
void Awake()
{
m_TextComponent = GetComponent<TMP_Text>();
}
void OnEnable()
{
// Subscribe to event fired when text object has been regenerated.
TMPro_EventManager.TEXT_CHANGED_EVENT.Add(ON_TEXT_CHANGED);
}
void OnDisable()
{
TMPro_EventManager.TEXT_CHANGED_EVENT.Remove(ON_TEXT_CHANGED);
}
void Start()
{
StartCoroutine(AnimateVertexColors());
}
void ON_TEXT_CHANGED(Object obj)
{
if (obj == m_TextComponent)
hasTextChanged = true;
}
/// <summary>
/// Method to animate vertex colors of a TMP Text object.
/// </summary>
/// <returns></returns>
IEnumerator AnimateVertexColors()
{
// We force an update of the text object since it would only be updated at the end of the frame. Ie. before this code is executed on the first frame.
// Alternatively, we could yield and wait until the end of the frame when the text object will be generated.
m_TextComponent.ForceMeshUpdate();
TMP_TextInfo textInfo = m_TextComponent.textInfo;
Matrix4x4 matrix;
int loopCount = 0;
hasTextChanged = true;
// Create an Array which contains pre-computed Angle Ranges and Speeds for a bunch of characters.
VertexAnim[] vertexAnim = new VertexAnim[1024];
for (int i = 0; i < 1024; i++)
{
vertexAnim[i].angleRange = Random.Range(10f, 25f);
vertexAnim[i].speed = Random.Range(1f, 3f);
}
// Cache the vertex data of the text object as the Jitter FX is applied to the original position of the characters.
TMP_MeshInfo[] cachedMeshInfo = textInfo.CopyMeshInfoVertexData();
while (true)
{
// Get new copy of vertex data if the text has changed.
if (hasTextChanged)
{
// Update the copy of the vertex data for the text object.
cachedMeshInfo = textInfo.CopyMeshInfoVertexData();
hasTextChanged = false;
}
int characterCount = textInfo.characterCount;
// If No Characters then just yield and wait for some text to be added
if (characterCount == 0)
{
yield return new WaitForSeconds(0.25f);
continue;
}
for (int i = 0; i < characterCount; i++)
{
TMP_CharacterInfo charInfo = textInfo.characterInfo[i];
// Skip characters that are not visible and thus have no geometry to manipulate.
if (!charInfo.isVisible)
continue;
// Retrieve the pre-computed animation data for the given character.
VertexAnim vertAnim = vertexAnim[i];
// Get the index of the material used by the current character.
int materialIndex = textInfo.characterInfo[i].materialReferenceIndex;
// Get the index of the first vertex used by this text element.
int vertexIndex = textInfo.characterInfo[i].vertexIndex;
// Get the cached vertices of the mesh used by this text element (character or sprite).
Vector3[] sourceVertices = cachedMeshInfo[materialIndex].vertices;
// Determine the center point of each character at the baseline.
//Vector2 charMidBasline = new Vector2((sourceVertices[vertexIndex + 0].x + sourceVertices[vertexIndex + 2].x) / 2, charInfo.baseLine);
// Determine the center point of each character.
Vector2 charMidBasline = (sourceVertices[vertexIndex + 0] + sourceVertices[vertexIndex + 2]) / 2;
// Need to translate all 4 vertices of each quad to aligned with middle of character / baseline.
// This is needed so the matrix TRS is applied at the origin for each character.
Vector3 offset = charMidBasline;
Vector3[] destinationVertices = textInfo.meshInfo[materialIndex].vertices;
destinationVertices[vertexIndex + 0] = sourceVertices[vertexIndex + 0] - offset;
destinationVertices[vertexIndex + 1] = sourceVertices[vertexIndex + 1] - offset;
destinationVertices[vertexIndex + 2] = sourceVertices[vertexIndex + 2] - offset;
destinationVertices[vertexIndex + 3] = sourceVertices[vertexIndex + 3] - offset;
vertAnim.angle = Mathf.SmoothStep(-vertAnim.angleRange, vertAnim.angleRange, Mathf.PingPong(loopCount / 25f * vertAnim.speed, 1f));
Vector3 jitterOffset = new Vector3(Random.Range(-.25f, .25f), Random.Range(-.25f, .25f), 0);
matrix = Matrix4x4.TRS(jitterOffset * CurveScale, Quaternion.Euler(0, 0, Random.Range(-5f, 5f) * AngleMultiplier), Vector3.one);
destinationVertices[vertexIndex + 0] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 0]);
destinationVertices[vertexIndex + 1] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 1]);
destinationVertices[vertexIndex + 2] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 2]);
destinationVertices[vertexIndex + 3] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 3]);
destinationVertices[vertexIndex + 0] += offset;
destinationVertices[vertexIndex + 1] += offset;
destinationVertices[vertexIndex + 2] += offset;
destinationVertices[vertexIndex + 3] += offset;
vertexAnim[i] = vertAnim;
}
// Push changes into meshes
for (int i = 0; i < textInfo.meshInfo.Length; i++)
{
textInfo.meshInfo[i].mesh.vertices = textInfo.meshInfo[i].vertices;
m_TextComponent.UpdateGeometry(textInfo.meshInfo[i].mesh, i);
}
loopCount += 1;
yield return new WaitForSeconds(0.1f);
}
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 2ed57967c52645d390a89dcf8f61ba73
timeCreated: 1461286718
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

161
Assets/Scripts/VertexShakeA.cs Executable file
View File

@ -0,0 +1,161 @@
using UnityEngine;
using System.Collections;
namespace TMPro.Examples
{
public class VertexShakeA : MonoBehaviour
{
public float AngleMultiplier = 1.0f;
public float SpeedMultiplier = 1.0f;
public float ScaleMultiplier = 1.0f;
public float RotationMultiplier = 1.0f;
private TMP_Text m_TextComponent;
private bool hasTextChanged;
void Awake()
{
m_TextComponent = GetComponent<TMP_Text>();
}
void OnEnable()
{
// Subscribe to event fired when text object has been regenerated.
TMPro_EventManager.TEXT_CHANGED_EVENT.Add(ON_TEXT_CHANGED);
}
void OnDisable()
{
TMPro_EventManager.TEXT_CHANGED_EVENT.Remove(ON_TEXT_CHANGED);
}
void Start()
{
StartCoroutine(AnimateVertexColors());
}
void ON_TEXT_CHANGED(Object obj)
{
if (obj = m_TextComponent)
hasTextChanged = true;
}
/// <summary>
/// Method to animate vertex colors of a TMP Text object.
/// </summary>
/// <returns></returns>
IEnumerator AnimateVertexColors()
{
// We force an update of the text object since it would only be updated at the end of the frame. Ie. before this code is executed on the first frame.
// Alternatively, we could yield and wait until the end of the frame when the text object will be generated.
m_TextComponent.ForceMeshUpdate();
TMP_TextInfo textInfo = m_TextComponent.textInfo;
Matrix4x4 matrix;
Vector3[][] copyOfVertices = new Vector3[0][];
hasTextChanged = true;
while (true)
{
// Allocate new vertices
if (hasTextChanged)
{
if (copyOfVertices.Length < textInfo.meshInfo.Length)
copyOfVertices = new Vector3[textInfo.meshInfo.Length][];
for (int i = 0; i < textInfo.meshInfo.Length; i++)
{
int length = textInfo.meshInfo[i].vertices.Length;
copyOfVertices[i] = new Vector3[length];
}
hasTextChanged = false;
}
int characterCount = textInfo.characterCount;
// If No Characters then just yield and wait for some text to be added
if (characterCount == 0)
{
yield return new WaitForSeconds(0.25f);
continue;
}
int lineCount = textInfo.lineCount;
// Iterate through each line of the text.
for (int i = 0; i < lineCount; i++)
{
int first = textInfo.lineInfo[i].firstCharacterIndex;
int last = textInfo.lineInfo[i].lastCharacterIndex;
// Determine the center of each line
Vector3 centerOfLine = (textInfo.characterInfo[first].bottomLeft + textInfo.characterInfo[last].topRight) / 2;
Quaternion rotation = Quaternion.Euler(0, 0, Random.Range(-0.25f, 0.25f) * RotationMultiplier);
// Iterate through each character of the line.
for (int j = first; j <= last; j++)
{
// Skip characters that are not visible and thus have no geometry to manipulate.
if (!textInfo.characterInfo[j].isVisible)
continue;
// Get the index of the material used by the current character.
int materialIndex = textInfo.characterInfo[j].materialReferenceIndex;
// Get the index of the first vertex used by this text element.
int vertexIndex = textInfo.characterInfo[j].vertexIndex;
// Get the vertices of the mesh used by this text element (character or sprite).
Vector3[] sourceVertices = textInfo.meshInfo[materialIndex].vertices;
// Need to translate all 4 vertices of each quad to aligned with center of character.
// This is needed so the matrix TRS is applied at the origin for each character.
copyOfVertices[materialIndex][vertexIndex + 0] = sourceVertices[vertexIndex + 0] - centerOfLine;
copyOfVertices[materialIndex][vertexIndex + 1] = sourceVertices[vertexIndex + 1] - centerOfLine;
copyOfVertices[materialIndex][vertexIndex + 2] = sourceVertices[vertexIndex + 2] - centerOfLine;
copyOfVertices[materialIndex][vertexIndex + 3] = sourceVertices[vertexIndex + 3] - centerOfLine;
// Determine the random scale change for each character.
float randomScale = Random.Range(0.995f - 0.001f * ScaleMultiplier, 1.005f + 0.001f * ScaleMultiplier);
// Setup the matrix rotation.
matrix = Matrix4x4.TRS(Vector3.one, rotation, Vector3.one * randomScale);
// Apply the matrix TRS to the individual characters relative to the center of the current line.
copyOfVertices[materialIndex][vertexIndex + 0] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 0]);
copyOfVertices[materialIndex][vertexIndex + 1] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 1]);
copyOfVertices[materialIndex][vertexIndex + 2] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 2]);
copyOfVertices[materialIndex][vertexIndex + 3] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 3]);
// Revert the translation change.
copyOfVertices[materialIndex][vertexIndex + 0] += centerOfLine;
copyOfVertices[materialIndex][vertexIndex + 1] += centerOfLine;
copyOfVertices[materialIndex][vertexIndex + 2] += centerOfLine;
copyOfVertices[materialIndex][vertexIndex + 3] += centerOfLine;
}
}
// Push changes into meshes
for (int i = 0; i < textInfo.meshInfo.Length; i++)
{
textInfo.meshInfo[i].mesh.vertices = copyOfVertices[i];
m_TextComponent.UpdateGeometry(textInfo.meshInfo[i].mesh, i);
}
yield return new WaitForSeconds(0.1f);
}
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f7cfa58e417a46ea8889989684c2522e
timeCreated: 1462089320
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

185
Assets/Scripts/VertexShakeB.cs Executable file
View File

@ -0,0 +1,185 @@
using UnityEngine;
using System.Collections;
namespace TMPro.Examples
{
public class VertexShakeB : MonoBehaviour
{
public float AngleMultiplier = 1.0f;
public float SpeedMultiplier = 1.0f;
public float CurveScale = 1.0f;
private TMP_Text m_TextComponent;
private bool hasTextChanged;
void Awake()
{
m_TextComponent = GetComponent<TMP_Text>();
}
void OnEnable()
{
// Subscribe to event fired when text object has been regenerated.
TMPro_EventManager.TEXT_CHANGED_EVENT.Add(ON_TEXT_CHANGED);
}
void OnDisable()
{
TMPro_EventManager.TEXT_CHANGED_EVENT.Remove(ON_TEXT_CHANGED);
}
void Start()
{
StartCoroutine(AnimateVertexColors());
}
void ON_TEXT_CHANGED(Object obj)
{
if (obj = m_TextComponent)
hasTextChanged = true;
}
/// <summary>
/// Method to animate vertex colors of a TMP Text object.
/// </summary>
/// <returns></returns>
IEnumerator AnimateVertexColors()
{
// We force an update of the text object since it would only be updated at the end of the frame. Ie. before this code is executed on the first frame.
// Alternatively, we could yield and wait until the end of the frame when the text object will be generated.
m_TextComponent.ForceMeshUpdate();
TMP_TextInfo textInfo = m_TextComponent.textInfo;
Matrix4x4 matrix;
Vector3[][] copyOfVertices = new Vector3[0][];
hasTextChanged = true;
while (true)
{
// Allocate new vertices
if (hasTextChanged)
{
if (copyOfVertices.Length < textInfo.meshInfo.Length)
copyOfVertices = new Vector3[textInfo.meshInfo.Length][];
for (int i = 0; i < textInfo.meshInfo.Length; i++)
{
int length = textInfo.meshInfo[i].vertices.Length;
copyOfVertices[i] = new Vector3[length];
}
hasTextChanged = false;
}
int characterCount = textInfo.characterCount;
// If No Characters then just yield and wait for some text to be added
if (characterCount == 0)
{
yield return new WaitForSeconds(0.25f);
continue;
}
int lineCount = textInfo.lineCount;
// Iterate through each line of the text.
for (int i = 0; i < lineCount; i++)
{
int first = textInfo.lineInfo[i].firstCharacterIndex;
int last = textInfo.lineInfo[i].lastCharacterIndex;
// Determine the center of each line
Vector3 centerOfLine = (textInfo.characterInfo[first].bottomLeft + textInfo.characterInfo[last].topRight) / 2;
Quaternion rotation = Quaternion.Euler(0, 0, Random.Range(-0.25f, 0.25f));
// Iterate through each character of the line.
for (int j = first; j <= last; j++)
{
// Skip characters that are not visible and thus have no geometry to manipulate.
if (!textInfo.characterInfo[j].isVisible)
continue;
// Get the index of the material used by the current character.
int materialIndex = textInfo.characterInfo[j].materialReferenceIndex;
// Get the index of the first vertex used by this text element.
int vertexIndex = textInfo.characterInfo[j].vertexIndex;
// Get the vertices of the mesh used by this text element (character or sprite).
Vector3[] sourceVertices = textInfo.meshInfo[materialIndex].vertices;
// Determine the center point of each character at the baseline.
Vector3 charCenter = (sourceVertices[vertexIndex + 0] + sourceVertices[vertexIndex + 2]) / 2;
// Need to translate all 4 vertices of each quad to aligned with center of character.
// This is needed so the matrix TRS is applied at the origin for each character.
copyOfVertices[materialIndex][vertexIndex + 0] = sourceVertices[vertexIndex + 0] - charCenter;
copyOfVertices[materialIndex][vertexIndex + 1] = sourceVertices[vertexIndex + 1] - charCenter;
copyOfVertices[materialIndex][vertexIndex + 2] = sourceVertices[vertexIndex + 2] - charCenter;
copyOfVertices[materialIndex][vertexIndex + 3] = sourceVertices[vertexIndex + 3] - charCenter;
// Determine the random scale change for each character.
float randomScale = Random.Range(0.95f, 1.05f);
// Setup the matrix for the scale change.
matrix = Matrix4x4.TRS(Vector3.one, Quaternion.identity, Vector3.one * randomScale);
// Apply the scale change relative to the center of each character.
copyOfVertices[materialIndex][vertexIndex + 0] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 0]);
copyOfVertices[materialIndex][vertexIndex + 1] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 1]);
copyOfVertices[materialIndex][vertexIndex + 2] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 2]);
copyOfVertices[materialIndex][vertexIndex + 3] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 3]);
// Revert the translation change.
copyOfVertices[materialIndex][vertexIndex + 0] += charCenter;
copyOfVertices[materialIndex][vertexIndex + 1] += charCenter;
copyOfVertices[materialIndex][vertexIndex + 2] += charCenter;
copyOfVertices[materialIndex][vertexIndex + 3] += charCenter;
// Need to translate all 4 vertices of each quad to aligned with the center of the line.
// This is needed so the matrix TRS is applied from the center of the line.
copyOfVertices[materialIndex][vertexIndex + 0] -= centerOfLine;
copyOfVertices[materialIndex][vertexIndex + 1] -= centerOfLine;
copyOfVertices[materialIndex][vertexIndex + 2] -= centerOfLine;
copyOfVertices[materialIndex][vertexIndex + 3] -= centerOfLine;
// Setup the matrix rotation.
matrix = Matrix4x4.TRS(Vector3.one, rotation, Vector3.one);
// Apply the matrix TRS to the individual characters relative to the center of the current line.
copyOfVertices[materialIndex][vertexIndex + 0] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 0]);
copyOfVertices[materialIndex][vertexIndex + 1] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 1]);
copyOfVertices[materialIndex][vertexIndex + 2] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 2]);
copyOfVertices[materialIndex][vertexIndex + 3] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 3]);
// Revert the translation change.
copyOfVertices[materialIndex][vertexIndex + 0] += centerOfLine;
copyOfVertices[materialIndex][vertexIndex + 1] += centerOfLine;
copyOfVertices[materialIndex][vertexIndex + 2] += centerOfLine;
copyOfVertices[materialIndex][vertexIndex + 3] += centerOfLine;
}
}
// Push changes into meshes
for (int i = 0; i < textInfo.meshInfo.Length; i++)
{
textInfo.meshInfo[i].mesh.vertices = copyOfVertices[i];
m_TextComponent.UpdateGeometry(textInfo.meshInfo[i].mesh, i);
}
yield return new WaitForSeconds(0.1f);
}
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: e4e0d9ccee5f4950be8979268c9014e0
timeCreated: 1462093319
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

192
Assets/Scripts/VertexZoom.cs Executable file
View File

@ -0,0 +1,192 @@
using UnityEngine;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
namespace TMPro.Examples
{
public class VertexZoom : MonoBehaviour
{
public float AngleMultiplier = 1.0f;
public float SpeedMultiplier = 1.0f;
public float CurveScale = 1.0f;
private TMP_Text m_TextComponent;
private bool hasTextChanged;
void Awake()
{
m_TextComponent = GetComponent<TMP_Text>();
}
void OnEnable()
{
// Subscribe to event fired when text object has been regenerated.
TMPro_EventManager.TEXT_CHANGED_EVENT.Add(ON_TEXT_CHANGED);
}
void OnDisable()
{
// UnSubscribe to event fired when text object has been regenerated.
TMPro_EventManager.TEXT_CHANGED_EVENT.Remove(ON_TEXT_CHANGED);
}
void Start()
{
StartCoroutine(AnimateVertexColors());
}
void ON_TEXT_CHANGED(Object obj)
{
if (obj == m_TextComponent)
hasTextChanged = true;
}
/// <summary>
/// Method to animate vertex colors of a TMP Text object.
/// </summary>
/// <returns></returns>
IEnumerator AnimateVertexColors()
{
// We force an update of the text object since it would only be updated at the end of the frame. Ie. before this code is executed on the first frame.
// Alternatively, we could yield and wait until the end of the frame when the text object will be generated.
m_TextComponent.ForceMeshUpdate();
TMP_TextInfo textInfo = m_TextComponent.textInfo;
Matrix4x4 matrix;
TMP_MeshInfo[] cachedMeshInfoVertexData = textInfo.CopyMeshInfoVertexData();
// Allocations for sorting of the modified scales
List<float> modifiedCharScale = new List<float>();
List<int> scaleSortingOrder = new List<int>();
hasTextChanged = true;
while (true)
{
// Allocate new vertices
if (hasTextChanged)
{
// Get updated vertex data
cachedMeshInfoVertexData = textInfo.CopyMeshInfoVertexData();
hasTextChanged = false;
}
int characterCount = textInfo.characterCount;
// If No Characters then just yield and wait for some text to be added
if (characterCount == 0)
{
yield return new WaitForSeconds(0.25f);
continue;
}
// Clear list of character scales
modifiedCharScale.Clear();
scaleSortingOrder.Clear();
for (int i = 0; i < characterCount; i++)
{
TMP_CharacterInfo charInfo = textInfo.characterInfo[i];
// Skip characters that are not visible and thus have no geometry to manipulate.
if (!charInfo.isVisible)
continue;
// Get the index of the material used by the current character.
int materialIndex = textInfo.characterInfo[i].materialReferenceIndex;
// Get the index of the first vertex used by this text element.
int vertexIndex = textInfo.characterInfo[i].vertexIndex;
// Get the cached vertices of the mesh used by this text element (character or sprite).
Vector3[] sourceVertices = cachedMeshInfoVertexData[materialIndex].vertices;
// Determine the center point of each character at the baseline.
//Vector2 charMidBasline = new Vector2((sourceVertices[vertexIndex + 0].x + sourceVertices[vertexIndex + 2].x) / 2, charInfo.baseLine);
// Determine the center point of each character.
Vector2 charMidBasline = (sourceVertices[vertexIndex + 0] + sourceVertices[vertexIndex + 2]) / 2;
// Need to translate all 4 vertices of each quad to aligned with middle of character / baseline.
// This is needed so the matrix TRS is applied at the origin for each character.
Vector3 offset = charMidBasline;
Vector3[] destinationVertices = textInfo.meshInfo[materialIndex].vertices;
destinationVertices[vertexIndex + 0] = sourceVertices[vertexIndex + 0] - offset;
destinationVertices[vertexIndex + 1] = sourceVertices[vertexIndex + 1] - offset;
destinationVertices[vertexIndex + 2] = sourceVertices[vertexIndex + 2] - offset;
destinationVertices[vertexIndex + 3] = sourceVertices[vertexIndex + 3] - offset;
//Vector3 jitterOffset = new Vector3(Random.Range(-.25f, .25f), Random.Range(-.25f, .25f), 0);
// Determine the random scale change for each character.
float randomScale = Random.Range(1f, 1.5f);
// Add modified scale and index
modifiedCharScale.Add(randomScale);
scaleSortingOrder.Add(modifiedCharScale.Count - 1);
// Setup the matrix for the scale change.
//matrix = Matrix4x4.TRS(jitterOffset, Quaternion.Euler(0, 0, Random.Range(-5f, 5f)), Vector3.one * randomScale);
matrix = Matrix4x4.TRS(new Vector3(0, 0, 0), Quaternion.identity, Vector3.one * randomScale);
destinationVertices[vertexIndex + 0] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 0]);
destinationVertices[vertexIndex + 1] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 1]);
destinationVertices[vertexIndex + 2] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 2]);
destinationVertices[vertexIndex + 3] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 3]);
destinationVertices[vertexIndex + 0] += offset;
destinationVertices[vertexIndex + 1] += offset;
destinationVertices[vertexIndex + 2] += offset;
destinationVertices[vertexIndex + 3] += offset;
// Restore Source UVS which have been modified by the sorting
Vector2[] sourceUVs0 = cachedMeshInfoVertexData[materialIndex].uvs0;
Vector2[] destinationUVs0 = textInfo.meshInfo[materialIndex].uvs0;
destinationUVs0[vertexIndex + 0] = sourceUVs0[vertexIndex + 0];
destinationUVs0[vertexIndex + 1] = sourceUVs0[vertexIndex + 1];
destinationUVs0[vertexIndex + 2] = sourceUVs0[vertexIndex + 2];
destinationUVs0[vertexIndex + 3] = sourceUVs0[vertexIndex + 3];
// Restore Source Vertex Colors
Color32[] sourceColors32 = cachedMeshInfoVertexData[materialIndex].colors32;
Color32[] destinationColors32 = textInfo.meshInfo[materialIndex].colors32;
destinationColors32[vertexIndex + 0] = sourceColors32[vertexIndex + 0];
destinationColors32[vertexIndex + 1] = sourceColors32[vertexIndex + 1];
destinationColors32[vertexIndex + 2] = sourceColors32[vertexIndex + 2];
destinationColors32[vertexIndex + 3] = sourceColors32[vertexIndex + 3];
}
// Push changes into meshes
for (int i = 0; i < textInfo.meshInfo.Length; i++)
{
//// Sort Quads based modified scale
scaleSortingOrder.Sort((a, b) => modifiedCharScale[a].CompareTo(modifiedCharScale[b]));
textInfo.meshInfo[i].SortGeometry(scaleSortingOrder);
// Updated modified vertex attributes
textInfo.meshInfo[i].mesh.vertices = textInfo.meshInfo[i].vertices;
textInfo.meshInfo[i].mesh.uv = textInfo.meshInfo[i].uvs0;
textInfo.meshInfo[i].mesh.colors32 = textInfo.meshInfo[i].colors32;
m_TextComponent.UpdateGeometry(textInfo.meshInfo[i].mesh, i);
}
yield return new WaitForSeconds(0.1f);
}
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 52ec835d14bd486f900952b77698b7eb
timeCreated: 1466280202
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -256,8 +256,8 @@ public class Weapon : ScriptableObject
{
var b = _bulletTransforms[i];
if (b == null) continue;
Gizmos.DrawSphere(b.position, b.localScale.x/2f * bulletSize.EvaluateMinMaxCurve());
Gizmos.DrawSphere(_bullets[i].PrevPos, b.localScale.x/2f * bulletSize.EvaluateMinMaxCurve());
Gizmos.DrawSphere(b.position, b.localScale.x/2f );
Gizmos.DrawSphere(_bullets[i].PrevPos, b.localScale.x/2f );
Gizmos.DrawLine(b.position, _bullets[i].PrevPos);
}

View File

@ -0,0 +1,28 @@
using UnityEngine;
public class WrapAroundOnEnable : MonoBehaviour
{
[SerializeField] private float xMin, xMax;
private void OnEnable()
{
WaitUtils.Wait(Time.deltaTime, true, () =>
{
var w = Mathf.Abs(xMax - xMin);
var x = transform.localPosition.x;
if (x > xMax)
{
x -= w;
}
else if (x < xMin)
{
x += w;
}
transform.localPosition = new Vector3(
x,
transform.localPosition.y,
transform.localPosition.z);
});
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 990644fedd5c4b99befe1da660313b53
timeCreated: 1610299723

View File

@ -107,7 +107,8 @@ SubShader {
Lighting Off
Fog { Mode Off }
ZTest Always
Blend One OneMinusSrcAlpha
Blend OneMinusDstColor OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass {

View File

@ -65,7 +65,7 @@ MonoBehaviour:
m_PostInfinity: 2
m_RotationOrder: 4
m_ConstantMin: 20
m_ConstantMax: 30
m_ConstantMax: 60
bulletLifetime:
m_Mode: 0
m_CurveMultiplier: 0
@ -108,14 +108,14 @@ MonoBehaviour:
zone:
numToSpawn: 10
offset: {x: 0, y: 0, z: 0}
spawnType: 0
spawnType: 2
spawnDir: 0
spawnPlane: 1
width: 0
height: 0
surfaceOnly: 0
evenDistribution: 0
numSides: 5
numSides: 3
numPerSide: 10
flipVertical: 0
radius: 10

View File

@ -0,0 +1,125 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2bc932693ed0a470d9cf39b1c3168afb, type: 3}
m_Name: Obstacle
m_EditorClassIdentifier:
fireRate: 3
bulletSpeed:
m_Mode: 0
m_CurveMultiplier: 1
m_CurveMin:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_CurveMax:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_ConstantMin: 20
m_ConstantMax: 60
bulletLifetime:
m_Mode: 0
m_CurveMultiplier: 0
m_CurveMin:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_CurveMax:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_ConstantMin: 15
m_ConstantMax: 5
bulletSize:
m_Mode: 0
m_CurveMultiplier: 0
m_CurveMin:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_CurveMax:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_ConstantMin: 0
m_ConstantMax: 3
damage: 1
collidesWith:
serializedVersion: 2
m_Bits: 64
accuracy: 0
zone:
numToSpawn: 1
offset: {x: 0, y: 0, z: 0}
spawnType: 0
spawnDir: 0
spawnPlane: 1
width: 0
height: 0
surfaceOnly: 1
evenDistribution: 1
numSides: 3
numPerSide: 10
flipVertical: 0
radius: 0
arc: 360
composite: []
manualFire: 1
behaviour: {fileID: 11400000, guid: bb1cb2a77c68c42d4900953d18b23a49, type: 2}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3b5089173dc14483fbd118af334cc1cb
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 2bc932693ed0a470d9cf39b1c3168afb, type: 3}
m_Name: PlayerWeapon
m_EditorClassIdentifier:
fireRate: 0.05
fireRate: 0.025
bulletSpeed:
m_Mode: 0
m_CurveMultiplier: 1
@ -104,21 +104,22 @@ MonoBehaviour:
collidesWith:
serializedVersion: 2
m_Bits: 128
accuracy: 5
accuracy: 2
zone:
numToSpawn: 1
offset: {x: 0, y: 0}
spawnType: 2
numToSpawn: 4
offset: {x: 0, y: 0, z: 0}
spawnType: 1
spawnDir: 0
width: 0
spawnPlane: 1
width: 0.75
height: 0
surfaceOnly: 1
evenDistribution: 1
numSides: 3
numSides: 2
numPerSide: 5
flipVertical: 1
radius: 1.25
arc: 360
radius: 5.47
arc: 82
composite: []
manualFire: 0
behaviour: {fileID: 11400000, guid: 20de5bc0e86bc4037a85f6c46356a227, type: 2}