diff options
author | Mikkel Bybjerg <mikkel.bybjerg@hotmail.com> | 2019-04-27 04:24:12 +0200 |
---|---|---|
committer | Mikkel Bybjerg <mikkel.bybjerg@hotmail.com> | 2019-04-27 04:24:12 +0200 |
commit | b8c4567189d2d4f49d0331858519ac6455e1eb3d (patch) | |
tree | 243498d5d7757d82d055e50d7be382267d09a45e | |
parent | 2c708ae0d09ca2de25ce60617875f89bfdbbd7e8 (diff) |
better dragon particle effects
-rw-r--r-- | nGJ2019/Assets/Prefabs/dragon_particle.prefab | 277 | ||||
-rw-r--r-- | nGJ2019/Assets/Scripts/DragonMovement.cs | 49 | ||||
-rw-r--r-- | nGJ2019/Assets/Textures/trail.mat | 77 | ||||
-rw-r--r-- | nGJ2019/Assets/Textures/trail.png | bin | 0 -> 86886 bytes |
4 files changed, 384 insertions, 19 deletions
diff --git a/nGJ2019/Assets/Prefabs/dragon_particle.prefab b/nGJ2019/Assets/Prefabs/dragon_particle.prefab new file mode 100644 index 0000000..ebe8458 --- /dev/null +++ b/nGJ2019/Assets/Prefabs/dragon_particle.prefab @@ -0,0 +1,277 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &445228207040156449 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7771521336157481751} + m_Layer: 0 + m_Name: GameObject + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7771521336157481751 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 445228207040156449} + 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: 8077401375918419270} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &3956812704593654807 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 4737150261715004055, guid: 594cdcc1eff6dcd439f373be7d777373, + type: 3} + m_PrefabInstance: {fileID: 2920835375877647928} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8077401375918419270} + - component: {fileID: 8630204386568766907} + - component: {fileID: 657432053680591539} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8077401375918419270 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, + type: 3} + m_PrefabInstance: {fileID: 2920835375877647928} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3956812704593654807} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.896, y: 0, z: 0} + m_LocalScale: {x: 0.29556, y: 0.29556, z: 0.29556} + m_Children: [] + m_Father: {fileID: 7771521336157481751} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!122 &8630204386568766907 +Halo: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3956812704593654807} + m_Enabled: 1 + m_Color: + serializedVersion: 2 + rgba: 4293915070 + m_Size: 0.12 +--- !u!96 &657432053680591539 +TrailRenderer: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3956812704593654807} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: da63ee1344e867740969250bd7a511ee, 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: 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_Time: 0.2 + m_Parameters: + serializedVersion: 3 + widthMultiplier: 1 + widthCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.1463004 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.4998979 + value: 0.15165684 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.9210868 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + colorGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + numCornerVertices: 0 + numCapVertices: 0 + alignment: 0 + textureMode: 0 + shadowBias: 0.5 + generateLightingData: 0 + m_MinVertexDistance: 0.1 + m_Autodestruct: 0 + m_Emitting: 1 +--- !u!1001 &2920835375877647928 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 7771521336157481751} + m_Modifications: + - target: {fileID: 4737150261715004055, guid: 594cdcc1eff6dcd439f373be7d777373, + type: 3} + propertyPath: m_Name + value: Sphere + objectReference: {fileID: 0} + - target: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, + type: 3} + propertyPath: m_LocalPosition.x + value: 0.896 + objectReference: {fileID: 0} + - target: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, + type: 3} + propertyPath: m_LocalPosition.y + value: 2.4592426 + objectReference: {fileID: 0} + - target: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, + type: 3} + propertyPath: m_LocalPosition.z + value: 1.9630866 + objectReference: {fileID: 0} + - target: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, + type: 3} + propertyPath: m_LocalScale.x + value: 0.29556 + objectReference: {fileID: 0} + - target: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, + type: 3} + propertyPath: m_LocalScale.y + value: 0.29556 + objectReference: {fileID: 0} + - target: {fileID: 7341443742164647049, guid: 594cdcc1eff6dcd439f373be7d777373, + type: 3} + propertyPath: m_LocalScale.z + value: 0.29556 + objectReference: {fileID: 0} + m_RemovedComponents: + - {fileID: 0} + m_SourcePrefab: {fileID: 100100000, guid: 594cdcc1eff6dcd439f373be7d777373, type: 3} diff --git a/nGJ2019/Assets/Scripts/DragonMovement.cs b/nGJ2019/Assets/Scripts/DragonMovement.cs index 67f5cde..64d7f21 100644 --- a/nGJ2019/Assets/Scripts/DragonMovement.cs +++ b/nGJ2019/Assets/Scripts/DragonMovement.cs @@ -89,7 +89,7 @@ public class DragonMovement : MonoBehaviour { while(state == State.normal && swarm.Noise > 0) { - swarm.Noise -= 0.08f; + swarm.Noise -= 0.12f; yield return new WaitForSeconds(0.01f); } if(state == State.normal) @@ -125,21 +125,32 @@ public class DragonMovement : MonoBehaviour StartCoroutine("transformSpread"); } - private void turnNormal() + private void turnAntiSwirl() { - State prev = state; - state = State.normal; - if(prev == State.swirl) + if(state == State.swirl) { + state = State.normal; turnVisible(true); swarm.activate(false); } - - if(prev == State.slim) + } + + private void turnAntiSlim() + { + if(state == State.slim) + { + state = State.normal; StartCoroutine("transformAntiSlim"); - - if(prev == State.spread) + } + } + + private void turnAntiSpread() + { + if(state == State.spread) + { + state = State.normal; StartCoroutine("transformAntiSpread"); + } } private void resetTurn() @@ -151,7 +162,7 @@ public class DragonMovement : MonoBehaviour void Start() { swarm = GetComponent<SwarmSystem>(); - swarm.activate(true); + swarm.activate(false); } void Update() @@ -165,20 +176,20 @@ public class DragonMovement : MonoBehaviour if(Input.GetKey("d")) moveRight(); - if(Input.GetKeyDown("r")) + if(Input.GetKeyDown("i")) turnSwirl(); - if(Input.GetKeyUp("r")) - turnNormal(); + if(Input.GetKeyUp("i")) + turnAntiSwirl(); - if(Input.GetKeyDown("f")) + if(Input.GetKeyDown("j")) turnSlim(); - if(Input.GetKeyUp("f")) - turnNormal(); + if(Input.GetKeyUp("j")) + turnAntiSlim(); - if(Input.GetKeyDown("e")) + if(Input.GetKeyDown("k")) turnSpread(); - if(Input.GetKeyUp("e")) - turnNormal(); + if(Input.GetKeyUp("k")) + turnAntiSpread(); } void OnDrawGizmosSelected() diff --git a/nGJ2019/Assets/Textures/trail.mat b/nGJ2019/Assets/Textures/trail.mat new file mode 100644 index 0000000..17ae7ad --- /dev/null +++ b/nGJ2019/Assets/Textures/trail.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: trail + m_Shader: {fileID: 10750, 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: 2800000, guid: 5152c065be41d554099af570b0d366bb, type: 3} + 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: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/nGJ2019/Assets/Textures/trail.png b/nGJ2019/Assets/Textures/trail.png Binary files differnew file mode 100644 index 0000000..7dfa9c7 --- /dev/null +++ b/nGJ2019/Assets/Textures/trail.png |