This commit is contained in:
BOT Alex 2024-04-20 23:26:49 +02:00
commit b28bdc2e27
46 changed files with 5034 additions and 269 deletions

View File

@ -570,6 +570,7 @@ GameObject:
- component: {fileID: 5609352768173468343} - component: {fileID: 5609352768173468343}
- component: {fileID: 7847799551035619544} - component: {fileID: 7847799551035619544}
- component: {fileID: 3837216061230793568} - component: {fileID: 3837216061230793568}
- component: {fileID: 8510394576666186474}
m_Layer: 0 m_Layer: 0
m_Name: Main Camera m_Name: Main Camera
m_TagString: MainCamera m_TagString: MainCamera
@ -585,8 +586,8 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6163557566655415017} m_GameObject: {fileID: 6163557566655415017}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: -0.011396202, y: 0.98857015, z: -0.1103237, w: -0.10211718} m_LocalRotation: {x: -0.02546724, y: 0.9636698, z: -0.2465418, w: -0.09954502}
m_LocalPosition: {x: 8.5044365, y: 3.5927956, z: 10.26652} m_LocalPosition: {x: 10.297432, y: 12.445195, z: 18.85268}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@ -742,8 +743,70 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
cam: {fileID: 7435709693246867821} cam: {fileID: 7435709693246867821}
scrollSpeed: 2 scrollSpeed: 2.5
stopAfterTime: 15
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 1.710919
outSlope: 1.710919
tangentMode: 34
weightedMode: 0
inWeight: 0
outWeight: 0.33333334
- serializedVersion: 3
time: 0.2991759
value: 0.51186574
inSlope: 0.50856996
outSlope: 0.50856996
tangentMode: 0
weightedMode: 0
inWeight: 1
outWeight: 0.30844653
- serializedVersion: 3
time: 0.6705839
value: 0.6387135
inSlope: 0.078333884
outSlope: 0.078333884
tangentMode: 0
weightedMode: 0
inWeight: 0.37746048
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 1
inSlope: 1.0967482
outSlope: 1.0967482
tangentMode: 34
weightedMode: 0
inWeight: 0.33333334
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
sens: {x: 300, y: 3} sens: {x: 300, y: 3}
--- !u!114 &8510394576666186474
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6163557566655415017}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c2d4e884ed2ba0944bfe55454353bc2d, type: 3}
m_Name:
m_EditorClassIdentifier:
mainCamera: {fileID: 3255403189825384754}
layerMask:
serializedVersion: 2
m_Bits: 1024
selectLayer:
serializedVersion: 2
m_Bits: 256
--- !u!1 &6734946956435011452 --- !u!1 &6734946956435011452
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -952,7 +1015,7 @@ MonoBehaviour:
m_SpeedMode: 0 m_SpeedMode: 0
m_MaxSpeed: 0 m_MaxSpeed: 0
m_AccelTime: 0.2 m_AccelTime: 0.2
m_DecelTime: 0.1 m_DecelTime: 0.25
m_InputAxisName: Mouse Y m_InputAxisName: Mouse Y
m_InputAxisValue: 0 m_InputAxisValue: 0
m_InvertInput: 1 m_InvertInput: 1
@ -976,7 +1039,7 @@ MonoBehaviour:
m_SpeedMode: 0 m_SpeedMode: 0
m_MaxSpeed: 0 m_MaxSpeed: 0
m_AccelTime: 0.1 m_AccelTime: 0.1
m_DecelTime: 0.1 m_DecelTime: 0.25
m_InputAxisName: Mouse X m_InputAxisName: Mouse X
m_InputAxisValue: 0 m_InputAxisValue: 0
m_InvertInput: 0 m_InvertInput: 0
@ -1027,9 +1090,8 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
target: {fileID: 5419760417237671588} target: {fileID: 5419760417237671588}
origin: {fileID: 7435709693246867821} origin: {fileID: 7435709693246867821}
prevObject: {fileID: 0} hideFadeSpeed: 7
defaultMaterial: {fileID: 2100000, guid: 1fb12e769af8dfc4b9c47b291e1da192, type: 2} showFadeSpeed: 2
hitMaterial: {fileID: 2100000, guid: 487f1aaeb1fd5674a8842eab66d03872, type: 2}
sphereRadius: 2 sphereRadius: 2
maxSphereRayDistanceOffset: {x: 0, y: 3, z: 0} maxSphereRayDistanceOffset: {x: 0, y: 3, z: 0}
--- !u!114 &7757173428948913319 --- !u!114 &7757173428948913319

View File

@ -12,7 +12,7 @@ GameObject:
- component: {fileID: 8262130276470859262} - component: {fileID: 8262130276470859262}
- component: {fileID: 39033916665346183} - component: {fileID: 39033916665346183}
- component: {fileID: 4956097427804774761} - component: {fileID: 4956097427804774761}
m_Layer: 6 m_Layer: 10
m_Name: Slot m_Name: Slot
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
@ -116,7 +116,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 7515572981473435671} - component: {fileID: 7515572981473435671}
- component: {fileID: 5087905053802543442} - component: {fileID: 5087905053802543442}
m_Layer: 6 m_Layer: 10
m_Name: SlotHolder m_Name: SlotHolder
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
@ -165,7 +165,7 @@ GameObject:
serializedVersion: 6 serializedVersion: 6
m_Component: m_Component:
- component: {fileID: 3521410157466494107} - component: {fileID: 3521410157466494107}
m_Layer: 6 m_Layer: 10
m_Name: TowerSpawnPoint m_Name: TowerSpawnPoint
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}

View File

@ -63,6 +63,11 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: BaseTower value: BaseTower
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: eb5e13df78999ef878da1db5c63224e2,
type: 3}
propertyPath: m_Layer
value: 8
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: m_RemovedGameObjects:
- {fileID: -3133498875991405556, guid: eb5e13df78999ef878da1db5c63224e2, type: 3} - {fileID: -3133498875991405556, guid: eb5e13df78999ef878da1db5c63224e2, type: 3}
@ -77,6 +82,10 @@ PrefabInstance:
type: 3} type: 3}
insertIndex: -1 insertIndex: -1
addedObject: {fileID: 5565472806559733162} addedObject: {fileID: 5565472806559733162}
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: eb5e13df78999ef878da1db5c63224e2,
type: 3}
insertIndex: -1
addedObject: {fileID: -4368249141776341009}
m_SourcePrefab: {fileID: 100100000, guid: eb5e13df78999ef878da1db5c63224e2, type: 3} m_SourcePrefab: {fileID: 100100000, guid: eb5e13df78999ef878da1db5c63224e2, type: 3}
--- !u!1 &872127579833310669 stripped --- !u!1 &872127579833310669 stripped
GameObject: GameObject:
@ -136,3 +145,21 @@ BoxCollider:
serializedVersion: 3 serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1} m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0} m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &-4368249141776341009
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 872127579833310669}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5fea29bb7c508c244a1f805a5fd3fc4d, type: 3}
m_Name:
m_EditorClassIdentifier:
outlineMode: 0
outlineColor: {r: 1, g: 1, b: 1, a: 1}
outlineWidth: 10
precomputeOutline: 0
bakeKeys: []
bakeValues: []

View File

@ -11,7 +11,7 @@ GameObject:
- component: {fileID: 6791947043022790992} - component: {fileID: 6791947043022790992}
- component: {fileID: 283773815913351468} - component: {fileID: 283773815913351468}
- component: {fileID: 7403195583508196174} - component: {fileID: 7403195583508196174}
m_Layer: 0 m_Layer: 8
m_Name: Sphere m_Name: Sphere
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
@ -94,7 +94,7 @@ GameObject:
- component: {fileID: 5119260969314287638} - component: {fileID: 5119260969314287638}
- component: {fileID: 6992152662476368078} - component: {fileID: 6992152662476368078}
- component: {fileID: 8324639096253395440} - component: {fileID: 8324639096253395440}
m_Layer: 0 m_Layer: 8
m_Name: Cylinder.002 m_Name: Cylinder.002
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}

View File

@ -11,7 +11,7 @@ GameObject:
- component: {fileID: 7260327517591084354} - component: {fileID: 7260327517591084354}
- component: {fileID: 5566712258885047037} - component: {fileID: 5566712258885047037}
- component: {fileID: 3451839468339987846} - component: {fileID: 3451839468339987846}
m_Layer: 0 m_Layer: 8
m_Name: Base m_Name: Base
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
@ -96,13 +96,13 @@ GameObject:
- component: {fileID: 3688593234855359137} - component: {fileID: 3688593234855359137}
- component: {fileID: 7215452495559205732} - component: {fileID: 7215452495559205732}
- component: {fileID: 8981486734084153558} - component: {fileID: 8981486734084153558}
m_Layer: 0 m_Layer: 8
m_Name: HorizontalArc m_Name: HorizontalArc
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!4 &3688593234855359137 --- !u!4 &3688593234855359137
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -252,7 +252,7 @@ GameObject:
- component: {fileID: 432796252682377629} - component: {fileID: 432796252682377629}
- component: {fileID: 3370533879401949812} - component: {fileID: 3370533879401949812}
- component: {fileID: 1398471167256814047} - component: {fileID: 1398471167256814047}
m_Layer: 0 m_Layer: 8
m_Name: SliderKnob m_Name: SliderKnob
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
@ -367,7 +367,7 @@ GameObject:
serializedVersion: 6 serializedVersion: 6
m_Component: m_Component:
- component: {fileID: 3410229124093629554} - component: {fileID: 3410229124093629554}
m_Layer: 0 m_Layer: 8
m_Name: Tip m_Name: Tip
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
@ -402,7 +402,7 @@ GameObject:
- component: {fileID: 271800776993535811} - component: {fileID: 271800776993535811}
- component: {fileID: 1616640625290415239} - component: {fileID: 1616640625290415239}
- component: {fileID: 8756968480882234867} - component: {fileID: 8756968480882234867}
m_Layer: 0 m_Layer: 8
m_Name: SliderKnob m_Name: SliderKnob
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
@ -508,37 +508,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 9998882d4b72010a9b0ca2d8bd35835e, type: 3} m_Script: {fileID: 11500000, guid: 9998882d4b72010a9b0ca2d8bd35835e, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!1 &3857615556319596175
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2164222606230954140}
m_Layer: 0
m_Name: Tip
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2164222606230954140
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3857615556319596175}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0, y: 0, z: 0.00771}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 9116936080776508834}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &7405500333329299342 --- !u!1 &7405500333329299342
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -551,7 +520,7 @@ GameObject:
- component: {fileID: 1325528991062417693} - component: {fileID: 1325528991062417693}
- component: {fileID: 7013367250967747671} - component: {fileID: 7013367250967747671}
- component: {fileID: 2740722787380423134} - component: {fileID: 2740722787380423134}
m_Layer: 0 m_Layer: 8
m_Name: Barrel m_Name: Barrel
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
@ -649,13 +618,13 @@ GameObject:
- component: {fileID: 4508182228569071021} - component: {fileID: 4508182228569071021}
- component: {fileID: 1366289561210151836} - component: {fileID: 1366289561210151836}
- component: {fileID: 5247639431516572416} - component: {fileID: 5247639431516572416}
m_Layer: 0 m_Layer: 8
m_Name: VerticalArc m_Name: VerticalArc
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!4 &4508182228569071021 --- !u!4 &4508182228569071021
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -802,13 +771,13 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 2141594701022449211} - component: {fileID: 2141594701022449211}
- component: {fileID: 3987931586699850031} - component: {fileID: 3987931586699850031}
m_Layer: 0 m_Layer: 8
m_Name: TrajectoryLine m_Name: TrajectoryLine
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!4 &2141594701022449211 --- !u!4 &2141594701022449211
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1057,10 +1026,6 @@ PrefabInstance:
type: 3} type: 3}
insertIndex: -1 insertIndex: -1
addedObject: {fileID: 3688593234855359137} addedObject: {fileID: 3688593234855359137}
- targetCorrespondingSourceObject: {fileID: 527409087646353271, guid: f54a14318952c90c5b47a300aedb0d15,
type: 3}
insertIndex: -1
addedObject: {fileID: 2164222606230954140}
m_AddedComponents: m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 872127579833310669, guid: f54a14318952c90c5b47a300aedb0d15, - targetCorrespondingSourceObject: {fileID: 872127579833310669, guid: f54a14318952c90c5b47a300aedb0d15,
type: 3} type: 3}
@ -1111,6 +1076,9 @@ MonoBehaviour:
type: 3} type: 3}
trajectoryLine: {fileID: 3987931586699850031} trajectoryLine: {fileID: 3987931586699850031}
trajectoryObjectPoolSize: 25 trajectoryObjectPoolSize: 25
wallMask:
serializedVersion: 2
m_Bits: 257
attackSecondsDelay: 1 attackSecondsDelay: 1
projectileSequence: projectileSequence:
- Arc: 0 - Arc: 0

8
Assets/QuickOutline.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2b16d9c7742c51c43bb052f81ebda33e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,37 @@
Quick Outline
=============
Developed by Chris Nolet (c) 2018
Instructions
------------
To add an outline to an object, drag-and-drop the Outline.cs
script onto the object. The outline materials will be loaded
at runtime.
You can also add outlines programmatically with:
var outline = gameObject.AddComponent<Outline>();
outline.OutlineMode = Outline.Mode.OutlineAll;
outline.OutlineColor = Color.yellow;
outline.OutlineWidth = 5f;
The outline script does a small amount of work in Awake().
For best results, use outline.enabled to toggle the outline.
Avoid removing and re-adding the component if possible.
For large meshes, you may also like to enable 'Precompute
Outline' in the editor. This will reduce the amount of work
performed in Awake().
Troubleshooting
---------------
If the outline appears off-center, please try the following:
1. Set 'Read/Write Enabled' on each model's import settings.
2. Disable 'Optimize Mesh Data' in the player settings.

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 5933bfd39d7a5b843a0ed821f85bca19
timeCreated: 1522619008
licenseType: Store
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 70fd40674751a8042a8b9b2e8d9f915f
folderAsset: yes
timeCreated: 1522559128
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 80ac8e52d3c31a94babd161e86bc6b97
folderAsset: yes
timeCreated: 1522559139
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,25 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: OutlineFill
m_Shader: {fileID: 4800000, guid: 4e76d4023d7e0411297c670f878973e2, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Floats:
- _OutlineWidth: 2
- _ZTest: 8
m_Colors:
- _OutlineColor: {r: 1, g: 1, b: 1, a: 1}

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 311313efa011949e98b6761d652ad13c
timeCreated: 1520576285
licenseType: Store
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,23 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: OutlineMask
m_Shader: {fileID: 4800000, guid: 341b058cd7dee4f5cba5cc59a513619e, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Floats:
- _ZTest: 8
m_Colors: []

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 106f3ff43a17d4967a2b64c7a92e49ec
timeCreated: 1520576276
licenseType: Store
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 6a63caa2b0e993043a42c11f35ff2d1a
folderAsset: yes
timeCreated: 1522559134
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,81 @@
//
// OutlineFill.shader
// QuickOutline
//
// Created by Chris Nolet on 2/21/18.
// Copyright © 2018 Chris Nolet. All rights reserved.
//
Shader "Custom/Outline Fill" {
Properties {
[Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("ZTest", Float) = 0
_OutlineColor("Outline Color", Color) = (1, 1, 1, 1)
_OutlineWidth("Outline Width", Range(0, 10)) = 2
}
SubShader {
Tags {
"Queue" = "Transparent+110"
"RenderType" = "Transparent"
"DisableBatching" = "True"
}
Pass {
Name "Fill"
Cull Off
ZTest [_ZTest]
ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
ColorMask RGB
Stencil {
Ref 1
Comp NotEqual
}
CGPROGRAM
#include "UnityCG.cginc"
#pragma vertex vert
#pragma fragment frag
struct appdata {
float4 vertex : POSITION;
float3 normal : NORMAL;
float3 smoothNormal : TEXCOORD3;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f {
float4 position : SV_POSITION;
fixed4 color : COLOR;
UNITY_VERTEX_OUTPUT_STEREO
};
uniform fixed4 _OutlineColor;
uniform float _OutlineWidth;
v2f vert(appdata input) {
v2f output;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
float3 normal = any(input.smoothNormal) ? input.smoothNormal : input.normal;
float3 viewPosition = UnityObjectToViewPos(input.vertex);
float3 viewNormal = normalize(mul((float3x3)UNITY_MATRIX_IT_MV, normal));
output.position = UnityViewToClipPos(viewPosition + viewNormal * -viewPosition.z * _OutlineWidth / 1000.0);
output.color = _OutlineColor;
return output;
}
fixed4 frag(v2f input) : SV_Target {
return input.color;
}
ENDCG
}
}
}

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 4e76d4023d7e0411297c670f878973e2
timeCreated: 1520575782
licenseType: Store
ShaderImporter:
externalObjects: {}
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,33 @@
//
// OutlineMask.shader
// QuickOutline
//
// Created by Chris Nolet on 2/21/18.
// Copyright © 2018 Chris Nolet. All rights reserved.
//
Shader "Custom/Outline Mask" {
Properties {
[Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("ZTest", Float) = 0
}
SubShader {
Tags {
"Queue" = "Transparent+100"
"RenderType" = "Transparent"
}
Pass {
Name "Mask"
Cull Off
ZTest [_ZTest]
ZWrite Off
ColorMask 0
Stencil {
Ref 1
Pass Replace
}
}
}
}

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 341b058cd7dee4f5cba5cc59a513619e
timeCreated: 1520575773
licenseType: Store
ShaderImporter:
externalObjects: {}
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 932f8193e5396db4babac4756c406dee
folderAsset: yes
timeCreated: 1522559213
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 2b0040b0ed7fbd64693e9195d13d25f9
folderAsset: yes
timeCreated: 1522615600
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,76 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Plane
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 1
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.2509804, g: 0.2509804, b: 0.5019608, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: f58cf65ea995c4b45be95713bdea8134
timeCreated: 1522540975
licenseType: Store
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 3916faa55c6a94248959031ee0ad499f
folderAsset: yes
timeCreated: 1522615614
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,778 @@
%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: 8
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: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 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: 820273532}
m_IndirectSpecularColor: {r: 0.18028383, g: 0.22571409, b: 0.30692282, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 8
m_Resolution: 2
m_BakeResolution: 40
m_TextureWidth: 1024
m_TextureHeight: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 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: 3
m_BakeBackend: 0
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVRFiltering: 0
m_PVRFilteringMode: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousColorSigma: 1
m_PVRFilteringAtrousNormalSigma: 1
m_PVRFilteringAtrousPositionSigma: 1
m_LightingDataAsset: {fileID: 0}
m_ShadowMaskMode: 2
--- !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
m_NavMeshData: {fileID: 0}
--- !u!1 &122269556
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 122269561}
- component: {fileID: 122269560}
- component: {fileID: 122269558}
- component: {fileID: 122269557}
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 &122269557
AudioListener:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 122269556}
m_Enabled: 1
--- !u!124 &122269558
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 122269556}
m_Enabled: 1
--- !u!20 &122269560
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 122269556}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
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: 0
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: 3
m_HDR: 1
m_AllowMSAA: 1
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
m_StereoMirrorMode: 0
--- !u!4 &122269561
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 122269556}
m_LocalRotation: {x: 0.3420201, y: 0, z: 0, w: 0.9396927}
m_LocalPosition: {x: 0, y: 3, z: -4}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 40, y: 0, z: 0}
--- !u!1 &124162633
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 124162634}
- component: {fileID: 124162638}
- component: {fileID: 124162636}
- component: {fileID: 124162635}
m_Layer: 0
m_Name: Outline Hidden
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &124162634
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 124162633}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -2, y: 0, z: 0}
m_LocalScale: {x: 1, y: 0.5, z: 1}
m_Children: []
m_Father: {fileID: 935070115}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &124162635
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 124162633}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5fea29bb7c508c244a1f805a5fd3fc4d, type: 3}
m_Name:
m_EditorClassIdentifier:
outlineMode: 2
outlineColor: {r: 1, g: 0.2509804, b: 0.2509804, a: 1}
outlineWidth: 6
--- !u!23 &124162636
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 124162633}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 10303, 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_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &124162638
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 124162633}
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &796971894
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 796971895}
- component: {fileID: 796971899}
- component: {fileID: 796971897}
- component: {fileID: 796971896}
m_Layer: 0
m_Name: Outline And Silhouette
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &796971895
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 796971894}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 2, y: 0, z: 0}
m_LocalScale: {x: 1, y: 0.5, z: 1}
m_Children: []
m_Father: {fileID: 935070115}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &796971896
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 796971894}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5fea29bb7c508c244a1f805a5fd3fc4d, type: 3}
m_Name:
m_EditorClassIdentifier:
outlineMode: 3
outlineColor: {r: 0.2509804, g: 1, b: 1, a: 1}
outlineWidth: 6
--- !u!23 &796971897
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 796971894}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 10303, 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_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &796971899
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 796971894}
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &820273531
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 820273533}
- component: {fileID: 820273532}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &820273532
Light:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 820273531}
m_Enabled: 1
serializedVersion: 8
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 4
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &820273533
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 820273531}
m_LocalRotation: {x: 0.40821788, y: 0.23456976, z: -0.10938167, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: 30, z: 0}
--- !u!1 &935070114
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 935070115}
m_Layer: 0
m_Name: Outlined Objects
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &935070115
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 935070114}
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:
- {fileID: 1781008194}
- {fileID: 124162634}
- {fileID: 1346396411}
- {fileID: 796971895}
- {fileID: 1083549395}
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1083549394
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1083549395}
- component: {fileID: 1083549399}
- component: {fileID: 1083549397}
- component: {fileID: 1083549396}
m_Layer: 0
m_Name: Outline Visible
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1083549395
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1083549394}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 4, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 935070115}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1083549396
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1083549394}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5fea29bb7c508c244a1f805a5fd3fc4d, type: 3}
m_Name:
m_EditorClassIdentifier:
outlineMode: 1
outlineColor: {r: 0.2509804, g: 1, b: 0.2509804, a: 1}
outlineWidth: 6
--- !u!23 &1083549397
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1083549394}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 10303, 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_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &1083549399
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1083549394}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1346396410
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1346396411}
- component: {fileID: 1346396415}
- component: {fileID: 1346396413}
- component: {fileID: 1346396412}
m_Layer: 0
m_Name: Outline All
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1346396411
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1346396410}
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: 935070115}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1346396412
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1346396410}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5fea29bb7c508c244a1f805a5fd3fc4d, type: 3}
m_Name:
m_EditorClassIdentifier:
outlineMode: 0
outlineColor: {r: 1, g: 1, b: 0.2509804, a: 1}
outlineWidth: 6
--- !u!23 &1346396413
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1346396410}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 10303, 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_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &1346396415
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1346396410}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1580478821
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1580478825}
- component: {fileID: 1580478824}
- component: {fileID: 1580478822}
m_Layer: 0
m_Name: Plane
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &1580478822
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1580478821}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: f58cf65ea995c4b45be95713bdea8134, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &1580478824
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1580478821}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1580478825
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1580478821}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 10, y: 1, z: 10}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1781008193
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1781008194}
- component: {fileID: 1781008198}
- component: {fileID: 1781008196}
- component: {fileID: 1781008195}
m_Layer: 0
m_Name: Silhouette Only
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1781008194
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1781008193}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -4, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 935070115}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1781008195
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1781008193}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5fea29bb7c508c244a1f805a5fd3fc4d, type: 3}
m_Name:
m_EditorClassIdentifier:
outlineMode: 4
outlineColor: {r: 1, g: 1, b: 1, a: 1}
outlineWidth: 6
--- !u!23 &1781008196
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1781008193}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 10303, 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_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &1781008198
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1781008193}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: f23712c79adc910408e872b127e825cf
timeCreated: 1522615825
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 3ddbd65d69a9f0b48bab4fe96a1fe099
folderAsset: yes
timeCreated: 1522559122
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,309 @@
//
// Outline.cs
// QuickOutline
//
// Created by Chris Nolet on 3/30/18.
// Copyright © 2018 Chris Nolet. All rights reserved.
//
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
[DisallowMultipleComponent]
public class Outline : MonoBehaviour {
private static HashSet<Mesh> registeredMeshes = new HashSet<Mesh>();
public enum Mode {
OutlineAll,
OutlineVisible,
OutlineHidden,
OutlineAndSilhouette,
SilhouetteOnly
}
public Mode OutlineMode {
get { return outlineMode; }
set {
outlineMode = value;
needsUpdate = true;
}
}
public Color OutlineColor {
get { return outlineColor; }
set {
outlineColor = value;
needsUpdate = true;
}
}
public float OutlineWidth {
get { return outlineWidth; }
set {
outlineWidth = value;
needsUpdate = true;
}
}
[Serializable]
private class ListVector3 {
public List<Vector3> data;
}
[SerializeField]
private Mode outlineMode;
[SerializeField]
private Color outlineColor = Color.white;
[SerializeField, Range(0f, 10f)]
private float outlineWidth = 2f;
[Header("Optional")]
[SerializeField, Tooltip("Precompute enabled: Per-vertex calculations are performed in the editor and serialized with the object. "
+ "Precompute disabled: Per-vertex calculations are performed at runtime in Awake(). This may cause a pause for large meshes.")]
private bool precomputeOutline;
[SerializeField, HideInInspector]
private List<Mesh> bakeKeys = new List<Mesh>();
[SerializeField, HideInInspector]
private List<ListVector3> bakeValues = new List<ListVector3>();
private Renderer[] renderers;
private Material outlineMaskMaterial;
private Material outlineFillMaterial;
private bool needsUpdate;
void Awake() {
// Cache renderers
renderers = GetComponentsInChildren<Renderer>();
// Instantiate outline materials
outlineMaskMaterial = Instantiate(Resources.Load<Material>(@"Materials/OutlineMask"));
outlineFillMaterial = Instantiate(Resources.Load<Material>(@"Materials/OutlineFill"));
outlineMaskMaterial.name = "OutlineMask (Instance)";
outlineFillMaterial.name = "OutlineFill (Instance)";
// Retrieve or generate smooth normals
LoadSmoothNormals();
// Apply material properties immediately
needsUpdate = true;
}
void OnEnable() {
foreach (var renderer in renderers) {
// Append outline shaders
var materials = renderer.sharedMaterials.ToList();
materials.Add(outlineMaskMaterial);
materials.Add(outlineFillMaterial);
renderer.materials = materials.ToArray();
}
}
void OnValidate() {
// Update material properties
needsUpdate = true;
// Clear cache when baking is disabled or corrupted
if (!precomputeOutline && bakeKeys.Count != 0 || bakeKeys.Count != bakeValues.Count) {
bakeKeys.Clear();
bakeValues.Clear();
}
// Generate smooth normals when baking is enabled
if (precomputeOutline && bakeKeys.Count == 0) {
Bake();
}
}
void Update() {
if (needsUpdate) {
needsUpdate = false;
UpdateMaterialProperties();
}
}
void OnDisable() {
foreach (var renderer in renderers) {
// Remove outline shaders
var materials = renderer.sharedMaterials.ToList();
materials.Remove(outlineMaskMaterial);
materials.Remove(outlineFillMaterial);
renderer.materials = materials.ToArray();
}
}
void OnDestroy() {
// Destroy material instances
Destroy(outlineMaskMaterial);
Destroy(outlineFillMaterial);
}
void Bake() {
// Generate smooth normals for each mesh
var bakedMeshes = new HashSet<Mesh>();
foreach (var meshFilter in GetComponentsInChildren<MeshFilter>()) {
// Skip duplicates
if (!bakedMeshes.Add(meshFilter.sharedMesh)) {
continue;
}
// Serialize smooth normals
var smoothNormals = SmoothNormals(meshFilter.sharedMesh);
bakeKeys.Add(meshFilter.sharedMesh);
bakeValues.Add(new ListVector3() { data = smoothNormals });
}
}
void LoadSmoothNormals() {
// Retrieve or generate smooth normals
foreach (var meshFilter in GetComponentsInChildren<MeshFilter>()) {
// Skip if smooth normals have already been adopted
if (!registeredMeshes.Add(meshFilter.sharedMesh)) {
continue;
}
// Retrieve or generate smooth normals
var index = bakeKeys.IndexOf(meshFilter.sharedMesh);
var smoothNormals = (index >= 0) ? bakeValues[index].data : SmoothNormals(meshFilter.sharedMesh);
// Store smooth normals in UV3
meshFilter.sharedMesh.SetUVs(3, smoothNormals);
// Combine submeshes
var renderer = meshFilter.GetComponent<Renderer>();
if (renderer != null) {
CombineSubmeshes(meshFilter.sharedMesh, renderer.sharedMaterials);
}
}
// Clear UV3 on skinned mesh renderers
foreach (var skinnedMeshRenderer in GetComponentsInChildren<SkinnedMeshRenderer>()) {
// Skip if UV3 has already been reset
if (!registeredMeshes.Add(skinnedMeshRenderer.sharedMesh)) {
continue;
}
// Clear UV3
skinnedMeshRenderer.sharedMesh.uv4 = new Vector2[skinnedMeshRenderer.sharedMesh.vertexCount];
// Combine submeshes
CombineSubmeshes(skinnedMeshRenderer.sharedMesh, skinnedMeshRenderer.sharedMaterials);
}
}
List<Vector3> SmoothNormals(Mesh mesh) {
// Group vertices by location
var groups = mesh.vertices.Select((vertex, index) => new KeyValuePair<Vector3, int>(vertex, index)).GroupBy(pair => pair.Key);
// Copy normals to a new list
var smoothNormals = new List<Vector3>(mesh.normals);
// Average normals for grouped vertices
foreach (var group in groups) {
// Skip single vertices
if (group.Count() == 1) {
continue;
}
// Calculate the average normal
var smoothNormal = Vector3.zero;
foreach (var pair in group) {
smoothNormal += smoothNormals[pair.Value];
}
smoothNormal.Normalize();
// Assign smooth normal to each vertex
foreach (var pair in group) {
smoothNormals[pair.Value] = smoothNormal;
}
}
return smoothNormals;
}
void CombineSubmeshes(Mesh mesh, Material[] materials) {
// Skip meshes with a single submesh
if (mesh.subMeshCount == 1) {
return;
}
// Skip if submesh count exceeds material count
if (mesh.subMeshCount > materials.Length) {
return;
}
// Append combined submesh
mesh.subMeshCount++;
mesh.SetTriangles(mesh.triangles, mesh.subMeshCount - 1);
}
void UpdateMaterialProperties() {
// Apply properties according to mode
outlineFillMaterial.SetColor("_OutlineColor", outlineColor);
switch (outlineMode) {
case Mode.OutlineAll:
outlineMaskMaterial.SetFloat("_ZTest", (float)UnityEngine.Rendering.CompareFunction.Always);
outlineFillMaterial.SetFloat("_ZTest", (float)UnityEngine.Rendering.CompareFunction.Always);
outlineFillMaterial.SetFloat("_OutlineWidth", outlineWidth);
break;
case Mode.OutlineVisible:
outlineMaskMaterial.SetFloat("_ZTest", (float)UnityEngine.Rendering.CompareFunction.Always);
outlineFillMaterial.SetFloat("_ZTest", (float)UnityEngine.Rendering.CompareFunction.LessEqual);
outlineFillMaterial.SetFloat("_OutlineWidth", outlineWidth);
break;
case Mode.OutlineHidden:
outlineMaskMaterial.SetFloat("_ZTest", (float)UnityEngine.Rendering.CompareFunction.Always);
outlineFillMaterial.SetFloat("_ZTest", (float)UnityEngine.Rendering.CompareFunction.Greater);
outlineFillMaterial.SetFloat("_OutlineWidth", outlineWidth);
break;
case Mode.OutlineAndSilhouette:
outlineMaskMaterial.SetFloat("_ZTest", (float)UnityEngine.Rendering.CompareFunction.LessEqual);
outlineFillMaterial.SetFloat("_ZTest", (float)UnityEngine.Rendering.CompareFunction.Always);
outlineFillMaterial.SetFloat("_OutlineWidth", outlineWidth);
break;
case Mode.SilhouetteOnly:
outlineMaskMaterial.SetFloat("_ZTest", (float)UnityEngine.Rendering.CompareFunction.LessEqual);
outlineFillMaterial.SetFloat("_ZTest", (float)UnityEngine.Rendering.CompareFunction.Greater);
outlineFillMaterial.SetFloat("_OutlineWidth", 0f);
break;
}
}
}

View File

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 5fea29bb7c508c244a1f805a5fd3fc4d
timeCreated: 1522369084
licenseType: Store
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -359,6 +359,30 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c2cdf8a35ccaacc4695675d2ada4aecf, type: 3} m_Script: {fileID: 11500000, guid: c2cdf8a35ccaacc4695675d2ada4aecf, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!1 &889658971 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4611178744751000815, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099,
type: 3}
m_PrefabInstance: {fileID: 1822225124}
m_PrefabAsset: {fileID: 0}
--- !u!114 &889658972
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 889658971}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5fea29bb7c508c244a1f805a5fd3fc4d, type: 3}
m_Name:
m_EditorClassIdentifier:
outlineMode: 0
outlineColor: {r: 1, g: 1, b: 1, a: 1}
outlineWidth: 2
precomputeOutline: 0
bakeKeys: []
bakeValues: []
--- !u!1 &1257773688 --- !u!1 &1257773688
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -477,12 +501,6 @@ MonoBehaviour:
m_LightCookieSize: {x: 1, y: 1} m_LightCookieSize: {x: 1, y: 1}
m_LightCookieOffset: {x: 0, y: 0} m_LightCookieOffset: {x: 0, y: 0}
m_SoftShadowQuality: 0 m_SoftShadowQuality: 0
--- !u!1 &1267316003 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7435709693246867821, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
m_PrefabInstance: {fileID: 1774990605473331699}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1425080745 --- !u!1 &1425080745
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -874,6 +892,88 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c2cdf8a35ccaacc4695675d2ada4aecf, type: 3} m_Script: {fileID: 11500000, guid: c2cdf8a35ccaacc4695675d2ada4aecf, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!1001 &1822225124
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 3798190417997420117, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099,
type: 3}
propertyPath: m_LocalPosition.x
value: -13.233323
objectReference: {fileID: 0}
- target: {fileID: 3798190417997420117, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099,
type: 3}
propertyPath: m_LocalPosition.y
value: 8.973126
objectReference: {fileID: 0}
- target: {fileID: 3798190417997420117, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099,
type: 3}
propertyPath: m_LocalPosition.z
value: 7.3137584
objectReference: {fileID: 0}
- target: {fileID: 3798190417997420117, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3798190417997420117, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3798190417997420117, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3798190417997420117, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3798190417997420117, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3798190417997420117, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3798190417997420117, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4611178744751000815, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099,
type: 3}
propertyPath: m_Name
value: BlackHole
objectReference: {fileID: 0}
- target: {fileID: 8324639096253395440, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099,
type: 3}
propertyPath: m_Materials.Array.size
value: 4
objectReference: {fileID: 0}
- target: {fileID: 8324639096253395440, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099,
type: 3}
propertyPath: m_Materials.Array.data[3]
value:
objectReference: {fileID: 2100000, guid: 1de4c3a8e8c911e44ad6ae7a2921ac27, type: 2}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 4611178744751000815, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099,
type: 3}
insertIndex: -1
addedObject: {fileID: 889658972}
m_SourcePrefab: {fileID: 100100000, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, type: 3}
--- !u!1 &1915595172 --- !u!1 &1915595172
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1005,191 +1105,6 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: Cinemachine value: Cinemachine
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3313768392743891090, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: fadeSpeed
value: 5.05
objectReference: {fileID: 0}
- target: {fileID: 3313768392743891090, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: hideFadeSpeed
value: 7
objectReference: {fileID: 0}
- target: {fileID: 3313768392743891090, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: showFadeSpeed
value: 2
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: cam
value:
objectReference: {fileID: 1267316003}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: sens.x
value: 300
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: sens.y
value: 3
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: scrollSpeed
value: 2
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: stopAfterTime
value: 15
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: stopStiffness
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: decelerationMultiplier
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.size
value: 4
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[1].time
value: 0.2991759
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[2].time
value: 0.6705839
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[3].time
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[1].value
value: 0.51186574
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[2].value
value: 0.6387135
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[3].value
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[0].inSlope
value: 1.710919
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[1].inSlope
value: 0.50856996
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[2].inSlope
value: 0.078333884
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[3].inSlope
value: 1.0967482
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[0].outSlope
value: 1.710919
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[1].inWeight
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[1].outSlope
value: 0.50856996
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[2].inWeight
value: 0.37746048
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[2].outSlope
value: 0.078333884
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[3].inWeight
value: 0.33333334
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[3].outSlope
value: 1.0967482
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[0].outWeight
value: 0.33333334
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[1].outWeight
value: 0.30844653
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[2].outWeight
value: 0.33333334
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[0].tangentMode
value: 34
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[1].tangentMode
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[2].tangentMode
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: curve.m_Curve.Array.data[3].tangentMode
value: 34
objectReference: {fileID: 0}
- target: {fileID: 5664717836218291588, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: m_XAxis.m_DecelTime
value: 0.25
objectReference: {fileID: 0}
- target: {fileID: 5664717836218291588, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: m_YAxis.m_DecelTime
value: 0.25
objectReference: {fileID: 0}
- target: {fileID: 8882344377078016156, guid: fd9f9b61c0ebb324ebc9f929e26706bc, - target: {fileID: 8882344377078016156, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3} type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
@ -1252,3 +1167,4 @@ SceneRoots:
- {fileID: 1257773690} - {fileID: 1257773690}
- {fileID: 1696531492} - {fileID: 1696531492}
- {fileID: 1774990605473331699} - {fileID: 1774990605473331699}
- {fileID: 1822225124}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 82109106f3e34b446b7e5e0a75799411
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -929,6 +929,51 @@ Transform:
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1395991985
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1395991987}
- component: {fileID: 1395991986}
m_Layer: 0
m_Name: gm
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1395991986
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1395991985}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 00e1f7ea5be7c564faf42d035aec7f53, type: 3}
m_Name:
m_EditorClassIdentifier:
IsBuildMode: 0
--- !u!4 &1395991987
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1395991985}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1.1557862, y: 2.294486, z: 1.574348}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1621186629 --- !u!1 &1621186629
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1185,6 +1230,11 @@ PrefabInstance:
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: 11.533513 value: 11.533513
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3837216061230793568, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
propertyPath: stopAfterTime
value: 5
objectReference: {fileID: 0}
- target: {fileID: 5753661378891917460, guid: fd9f9b61c0ebb324ebc9f929e26706bc, - target: {fileID: 5753661378891917460, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3} type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
@ -1243,7 +1293,7 @@ PrefabInstance:
- target: {fileID: 7348612162646443967, guid: fd9f9b61c0ebb324ebc9f929e26706bc, - target: {fileID: 7348612162646443967, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3} type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
value: -0.1380528 value: -0.13805284
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7348612162646443967, guid: fd9f9b61c0ebb324ebc9f929e26706bc, - target: {fileID: 7348612162646443967, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3} type: 3}
@ -1258,7 +1308,7 @@ PrefabInstance:
- target: {fileID: 7348612162646443967, guid: fd9f9b61c0ebb324ebc9f929e26706bc, - target: {fileID: 7348612162646443967, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3} type: 3}
propertyPath: m_LocalRotation.z propertyPath: m_LocalRotation.z
value: -0.13815574 value: -0.13815573
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 8882344377078016156, guid: fd9f9b61c0ebb324ebc9f929e26706bc, - target: {fileID: 8882344377078016156, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3} type: 3}
@ -1313,7 +1363,11 @@ PrefabInstance:
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 6163557566655415017, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
insertIndex: -1
addedObject: {fileID: 1970787077}
m_SourcePrefab: {fileID: 100100000, guid: fd9f9b61c0ebb324ebc9f929e26706bc, type: 3} m_SourcePrefab: {fileID: 100100000, guid: fd9f9b61c0ebb324ebc9f929e26706bc, type: 3}
--- !u!1 &1797347348 --- !u!1 &1797347348
GameObject: GameObject:
@ -1488,6 +1542,37 @@ PrefabInstance:
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 48ecac7381f19af3bab6fef54e6dbadc, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 48ecac7381f19af3bab6fef54e6dbadc, type: 3}
--- !u!1 &1970787075 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6163557566655415017, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
m_PrefabInstance: {fileID: 1732242001}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1970787077
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1970787075}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c2d4e884ed2ba0944bfe55454353bc2d, type: 3}
m_Name:
m_EditorClassIdentifier:
mainCamera: {fileID: 1970787082}
layerMask:
serializedVersion: 2
m_Bits: 1024
selectLayer:
serializedVersion: 2
m_Bits: 256
--- !u!20 &1970787082 stripped
Camera:
m_CorrespondingSourceObject: {fileID: 3255403189825384754, guid: fd9f9b61c0ebb324ebc9f929e26706bc,
type: 3}
m_PrefabInstance: {fileID: 1732242001}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &667212637924654954 --- !u!1001 &667212637924654954
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1575,3 +1660,4 @@ SceneRoots:
- {fileID: 1671091699} - {fileID: 1671091699}
- {fileID: 770231297} - {fileID: 770231297}
- {fileID: 504816165} - {fileID: 504816165}
- {fileID: 1395991987}

View File

@ -7,9 +7,8 @@ public class CameraController : MonoBehaviour
[SerializeField] private GameObject cam; [SerializeField] private GameObject cam;
public float scrollSpeed; public float scrollSpeed;
public float stopAfterTime = 0.25f; [Range(5f, 30f)] public float stopAfterTime;
public AnimationCurve curve = new AnimationCurve(new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f)); public AnimationCurve curve = new AnimationCurve(new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f));
[Range(1f, 0f)] public float decelerationMultiplier;
public Vector2 sens; public Vector2 sens;
private Vector2 defaultMaxSpeed; private Vector2 defaultMaxSpeed;

View File

@ -27,9 +27,11 @@ public class HideWall : MonoBehaviour
List<GameObject> hitObjectsThisFrame = new List<GameObject>(); List<GameObject> hitObjectsThisFrame = new List<GameObject>();
for (int i = 0; i < hits.Length; i++) for (int i = 0; i < hits.Length; i++)
{ {
if (hits[i].collider != null && hits[i].collider.CompareTag("Wall")) //print(hits[i].collider.gameObject.name);
if (hits[i].collider != null)
{ {
var hitGameObject = hits[i].collider.gameObject; var hitGameObject = hits[i].collider.gameObject;
hitObjectsThisFrame.Add(hitGameObject); hitObjectsThisFrame.Add(hitGameObject);

View File

@ -41,11 +41,13 @@ public class WallOpacity : MonoBehaviour
{ {
isShowing = true; isShowing = true;
showFadeSpeed = speed; showFadeSpeed = speed;
print("showing wall");
} }
public void HideWall(float speed) public void HideWall(float speed)
{ {
isShowing = false; isShowing = false;
hideFadeSpeed = speed; hideFadeSpeed = speed;
print("hdiding wall");
} }
} }

View File

@ -1,5 +1,3 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine; using UnityEngine;
public class GameManager : MonoBehaviour public class GameManager : MonoBehaviour
@ -7,8 +5,16 @@ public class GameManager : MonoBehaviour
public static GameManager Instance; public static GameManager Instance;
public bool IsBuildMode = false; public bool IsBuildMode = false;
private Tower selectedTower;
public Tower SelectedTower { get { return selectedTower; } set {
if (selectedTower != null)
selectedTower.TowerSelected(false);
private void Start() selectedTower = value;
selectedTower.TowerSelected(true);
}}
private void Awake()
{ {
if (Instance != this) if (Instance != this)
Destroy(Instance); Destroy(Instance);

View File

@ -1,12 +1,12 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine; using UnityEngine;
public class CameraSlotClickDetect : MonoBehaviour public class CameraSlotClickDetect : MonoBehaviour
{ {
public Camera mainCamera; public Camera mainCamera;
public LayerMask layerMask; public LayerMask layerMask;
public LayerMask selectLayer;
private SlotManager PrevHoveredSlot; private SlotManager PrevHoveredSlot;
@ -29,6 +29,13 @@ public class CameraSlotClickDetect : MonoBehaviour
{ {
var slotInfo = hit.collider.gameObject.GetComponentInParent<SlotManager>(); var slotInfo = hit.collider.gameObject.GetComponentInParent<SlotManager>();
slotInfo.OnClick(); slotInfo.OnClick();
GameManager.Instance.SelectedTower = null;
}
RaycastHit selectHit;
if (Physics.Raycast(ray, out selectHit, Mathf.Infinity, selectLayer) && !GameManager.Instance.IsBuildMode)
{
var tower = selectHit.collider.gameObject.GetComponentInChildren<Tower>();
GameManager.Instance.SelectedTower = tower;
} }
} }

View File

@ -1,3 +1,4 @@
using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
@ -16,6 +17,7 @@ public class AimTower : Tower
[SerializeField] private GameObject ghostPrefab; [SerializeField] private GameObject ghostPrefab;
[SerializeField] private LineRenderer trajectoryLine; [SerializeField] private LineRenderer trajectoryLine;
[SerializeField] private int trajectoryObjectPoolSize = 25; [SerializeField] private int trajectoryObjectPoolSize = 25;
[SerializeField] private LayerMask wallMask;
private int poolIdx = 0; private int poolIdx = 0;
public Vector3 AimDirection => barrel.transform.forward; public Vector3 AimDirection => barrel.transform.forward;
@ -24,9 +26,10 @@ public class AimTower : Tower
public float HorizontalRotation => horizontalArc.Value; public float HorizontalRotation => horizontalArc.Value;
public float VerticalRotation => verticalArc.Value; public float VerticalRotation => verticalArc.Value;
protected override void Awake() protected override void Awake()
{ {
base.Awake();
horizontalArc.Value.AddListener(UpdateBarrelRotation); horizontalArc.Value.AddListener(UpdateBarrelRotation);
verticalArc.Value.AddListener(UpdateBarrelRotation); verticalArc.Value.AddListener(UpdateBarrelRotation);
@ -39,6 +42,16 @@ public class AimTower : Tower
UpdateTrajectory(); UpdateTrajectory();
} }
public override void TowerSelected(bool selected)
{
base.TowerSelected(selected);
horizontalArc.gameObject.SetActive(selected);
verticalArc.gameObject.SetActive(selected);
trajectoryLine.gameObject.SetActive(selected);
UpdateTrajectory();
}
protected override void OnDestroy() protected override void OnDestroy()
{ {
horizontalArc.Value.RemoveListener(UpdateBarrelRotation); horizontalArc.Value.RemoveListener(UpdateBarrelRotation);
@ -67,6 +80,7 @@ public class AimTower : Tower
{ {
ghost.SetActive(false); ghost.SetActive(false);
} }
if (!this.selected) return;
Vector3 origin = barrel.Tip.position; Vector3 origin = barrel.Tip.position;
Vector3 dir = barrel.transform.forward; Vector3 dir = barrel.transform.forward;
@ -76,7 +90,7 @@ public class AimTower : Tower
{ {
Debug.DrawRay(origin, dir.normalized * k_trajectory_maxdist, Color.red, 5f); Debug.DrawRay(origin, dir.normalized * k_trajectory_maxdist, Color.red, 5f);
RaycastHit hit; RaycastHit hit;
if (!Physics.Raycast(origin, dir, out hit, k_trajectory_maxdist)) if (!Physics.Raycast(origin, dir, out hit, k_trajectory_maxdist, wallMask))
break; break;
pointsInTrajectory.Add(hit.point); pointsInTrajectory.Add(hit.point);
@ -84,7 +98,6 @@ public class AimTower : Tower
origin = hit.point; origin = hit.point;
} }
trajectoryLine.positionCount = pointsInTrajectory.Count; trajectoryLine.positionCount = pointsInTrajectory.Count;
trajectoryLine.SetPositions(pointsInTrajectory.ToArray()); trajectoryLine.SetPositions(pointsInTrajectory.ToArray());

View File

@ -14,6 +14,16 @@ public class GravityTower : Tower
[SerializeField] [SerializeField]
private AnimationCurve distToAcceleration; private AnimationCurve distToAcceleration;
public override void TowerSelected(bool selected)
{
}
protected override void Awake()
{
base.Awake();
}
protected override void FixedUpdate() protected override void FixedUpdate()
{ {
Collider[] projectilesInRadius = Physics.OverlapSphere(orb.position, radius, affectedBodies); Collider[] projectilesInRadius = Physics.OverlapSphere(orb.position, radius, affectedBodies);
@ -25,4 +35,14 @@ public class GravityTower : Tower
projectileBody.AddForce(projToOrb.normalized * distToAcceleration.Evaluate(dist)); projectileBody.AddForce(projToOrb.normalized * distToAcceleration.Evaluate(dist));
} }
} }
protected override void OnDestroy()
{
base.OnDestroy();
}
protected override void Update()
{
base.Update();
}
} }

View File

@ -45,7 +45,7 @@ public class Projectile : MonoBehaviour
private void OnCollisionEnter(Collision collision) private void OnCollisionEnter(Collision collision)
{ {
HealthComponent hitHealthComp = collision.gameObject.GetComponent<HealthComponent>(); HealthComponent hitHealthComp = collision.gameObject.GetComponent<HealthComponent>();
if (hitHealthComp == comingFrom) return; // if (hitHealthComp == comingFrom) return;
if (hitHealthComp) if (hitHealthComp)
{ {
hitHealthComp.TakeDamage(damage); hitHealthComp.TakeDamage(damage);

View File

@ -1,21 +1,29 @@
using System;
using UnityEngine; using UnityEngine;
using UnityEngine.Assertions; using UnityEngine.Assertions;
public abstract class Tower : MonoBehaviour public abstract class Tower : MonoBehaviour
{ {
public bool towerSelected { get; set; } = true; protected bool selected = false;
protected HealthComponent healthComp; protected HealthComponent healthComp;
protected Outline outline;
// Getters // Getters
public virtual void TowerSelected(bool selected)
{
this.selected = selected;
outline.enabled = selected;
}
protected virtual void Awake() protected virtual void Awake()
{ {
healthComp = GetComponent<HealthComponent>(); healthComp = GetComponent<HealthComponent>();
outline = GetComponent<Outline>();
Assert.IsNotNull(healthComp); Assert.IsNotNull(healthComp);
Assert.IsNotNull(outline);
} }
protected virtual void OnDestroy() protected virtual void OnDestroy()
{ {
} }

8
Assets/Shaders.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d8c102cc5759e0a4d81ddbcd1cd98477
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -14,9 +14,9 @@ TagManager:
- UI - UI
- Projectile - Projectile
- -
- Tower
- -
- - Cell
-
- -
- -
- -