new ball visuals

main
Benjamin Kraft 1 year ago
parent 9f770d399a
commit 8e60e463d3
  1. 20
      Assets/Materials/NewBall.mat
  2. 2
      Assets/Materials/NewBall.mat.meta
  3. 97
      Assets/Prefabs/Collectables/NewBall.prefab
  4. 24
      Assets/Scripts/Game/NewBall.cs
  5. 1370
      Assets/Shaders/CircleBorder.shadergraph
  6. 10
      Assets/Shaders/CircleBorder.shadergraph.meta
  7. 2
      ProjectSettings/ProjectSettings.asset

@ -8,7 +8,7 @@ Material:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: NewBall m_Name: NewBall
m_Shader: {fileID: 4800000, guid: da25e23f4bce4102a45b0743b67525c4, type: 3} m_Shader: {fileID: -6465566751694194690, guid: 11508ba6b7a598ad3bbb1d90c2f66d3e, type: 3}
m_ValidKeywords: [] m_ValidKeywords: []
m_InvalidKeywords: [] m_InvalidKeywords: []
m_LightmapFlags: 4 m_LightmapFlags: 4
@ -25,7 +25,7 @@ Material:
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _MainTex: - _MainTex:
m_Texture: {fileID: 0} m_Texture: {fileID: 2800000, guid: 47e353a78c92b9838963e533e37462e5, type: 3}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _MaskTex: - _MaskTex:
@ -36,12 +36,24 @@ Material:
m_Texture: {fileID: 0} m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: [] m_Ints: []
m_Floats: m_Floats:
- PixelSnap: 0
- _EnableExternalAlpha: 0 - _EnableExternalAlpha: 0
- _Thickness: 0.051
m_Colors: m_Colors:
- _Color: {r: 1.319508, g: 1.319508, b: 1.319508, a: 1} - _Color: {r: 1, g: 1, b: 1, a: 1}
- _Flip: {r: 1, g: 1, b: 1, a: 1} - _Flip: {r: 1, g: 1, b: 1, a: 1}
- _RendererColor: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: [] m_BuildTextureStacks: []

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: efe64386af2c943be9fe140cdb79ee9b guid: 0e93cf83970eef70b810a2f23a2b8038
NativeFormatImporter: NativeFormatImporter:
externalObjects: {} externalObjects: {}
mainObjectFileID: 2100000 mainObjectFileID: 2100000

@ -1,89 +1,5 @@
%YAML 1.1 %YAML 1.1
%TAG !u! tag:unity3d.com,2011: %TAG !u! tag:unity3d.com,2011:
--- !u!1 &2068902108434861102
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3019560421038336810}
- component: {fileID: 4286311027153464049}
m_Layer: 7
m_Name: MainColor
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3019560421038336810
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2068902108434861102}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.9, y: 0.9, z: 0.9}
m_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 5863603256186968683}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &4286311027153464049
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2068902108434861102}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: efe64386af2c943be9fe140cdb79ee9b, type: 2}
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: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 1
m_Sprite: {fileID: 21300000, guid: 47e353a78c92b9838963e533e37462e5, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1, y: 1}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &5863603256186968685 --- !u!1 &5863603256186968685
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -93,7 +9,7 @@ GameObject:
serializedVersion: 6 serializedVersion: 6
m_Component: m_Component:
- component: {fileID: 5863603256186968683} - component: {fileID: 5863603256186968683}
- component: {fileID: 5863603256186968682} - component: {fileID: 7174826132722473217}
- component: {fileID: 5863603256186968680} - component: {fileID: 5863603256186968680}
- component: {fileID: 5863603256186968662} - component: {fileID: 5863603256186968662}
- component: {fileID: 5863603256186968681} - component: {fileID: 5863603256186968681}
@ -115,12 +31,11 @@ Transform:
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} m_LocalScale: {x: 0.75, y: 0.75, z: 0.75}
m_ConstrainProportionsScale: 1 m_ConstrainProportionsScale: 1
m_Children: m_Children: []
- {fileID: 3019560421038336810}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &5863603256186968682 --- !u!212 &7174826132722473217
SpriteRenderer: SpriteRenderer:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
@ -140,7 +55,7 @@ SpriteRenderer:
m_RenderingLayerMask: 1 m_RenderingLayerMask: 1
m_RendererPriority: 0 m_RendererPriority: 0
m_Materials: m_Materials:
- {fileID: 2100000, guid: efe64386af2c943be9fe140cdb79ee9b, type: 2} - {fileID: 2100000, guid: 0e93cf83970eef70b810a2f23a2b8038, type: 2}
m_StaticBatchInfo: m_StaticBatchInfo:
firstSubMesh: 0 firstSubMesh: 0
subMeshCount: 0 subMeshCount: 0
@ -166,7 +81,7 @@ SpriteRenderer:
m_FlipX: 0 m_FlipX: 0
m_FlipY: 0 m_FlipY: 0
m_DrawMode: 0 m_DrawMode: 0
m_Size: {x: 1, y: 1} m_Size: {x: 0.984375, y: 0.984375}
m_AdaptiveModeThreshold: 0.5 m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0 m_SpriteTileMode: 0
m_WasSpriteAssigned: 1 m_WasSpriteAssigned: 1
@ -202,6 +117,8 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
permanentDuration: 5 permanentDuration: 5
temporaryDuration: 10 temporaryDuration: 10
permanentColor: {r: 11.984314, g: 11.984314, b: 0, a: 1}
temporaryColor: {r: 0, g: 11.984314, b: 11.984314, a: 1}
--- !u!114 &5863603256186968681 --- !u!114 &5863603256186968681
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

@ -7,23 +7,15 @@ namespace Game {
public float permanentDuration; public float permanentDuration;
public float temporaryDuration; public float temporaryDuration;
private bool isPermanent; [ColorUsage(true, true)]
public bool IsPermanent { public Color permanentColor;
private get => isPermanent; [ColorUsage(true, true)]
set { public Color temporaryColor;
isPermanent = value;
const float intensity = 1f; public bool IsPermanent { get; set; }
float factor = Mathf.Pow(2, intensity);
float r = value ? 1 : 0;
float g = 1;
float b = value ? 0 : 1;
Color borderColor = new Vector4(r, g, b, 1) * factor;
GetComponent<SpriteRenderer>().material.color = borderColor;
}
}
protected override void Setup() { protected override void Setup() {
GetComponent<SpriteRenderer>().material.color = IsPermanent ? permanentColor : temporaryColor;
} }
protected override float Duration() { protected override float Duration() {
@ -31,7 +23,7 @@ namespace Game {
} }
protected override void OnCollect(Player player) { protected override void OnCollect(Player player) {
GameManager.Singleton.SpawnBall(player, isPermanent); GameManager.Singleton.SpawnBall(player, IsPermanent);
} }
} }
} }

File diff suppressed because it is too large Load Diff

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 11508ba6b7a598ad3bbb1d90c2f66d3e
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}

@ -165,7 +165,7 @@ PlayerSettings:
iPhone: 0 iPhone: 0
tvOS: 0 tvOS: 0
overrideDefaultApplicationIdentifier: 0 overrideDefaultApplicationIdentifier: 0
AndroidBundleVersionCode: 8 AndroidBundleVersionCode: 9
AndroidMinSdkVersion: 24 AndroidMinSdkVersion: 24
AndroidTargetSdkVersion: 33 AndroidTargetSdkVersion: 33
AndroidPreferredInstallLocation: 1 AndroidPreferredInstallLocation: 1

Loading…
Cancel
Save