├── InsaneOne.TailEffect.asmdef ├── License.meta ├── README.md.meta ├── package.json.meta ├── Example.meta ├── Example ├── TailFxExample.unity.meta ├── TailExample3dSegment.prefab.meta ├── TailExampleObject.mat.meta ├── TailExampleGroundMaterial.mat.meta ├── TailExampleMovement.cs.meta ├── TailExampleMovement.cs ├── TailExampleObject.mat ├── TailExampleGroundMaterial.mat ├── TailExample3dSegment.prefab └── TailFxExample.unity ├── Sources.meta ├── InsaneOne.TailEffect.asmdef.meta ├── Sources ├── TailFx.cs.meta ├── TailColorTint.cs.meta ├── TailColorTint.cs └── TailFx.cs ├── package.json ├── License └── README.md /InsaneOne.TailEffect.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "InsaneOne.TailEffect" 3 | } 4 | -------------------------------------------------------------------------------- /License.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cca38b835091b4d44a3c024a469b0411 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86c2f1ca8d58e44418b8cd6064abd294 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 12dc36bf53d18cb47b4988707b7d73ef 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Example.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b55019329843a4d408a2211c181c76d5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Example/TailFxExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82dd8f7386d79f34e9e89d0299d96ada 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Sources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 06ba2ec348db03a478557815a8c41f20 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Example/TailExample3dSegment.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c6c64f8ae29307409b2c10857eba010 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /InsaneOne.TailEffect.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 666fa0d36a98a90429f3218d5c8b066e 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Example/TailExampleObject.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6761c339ae841a74a9c5154d29f97667 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Example/TailExampleGroundMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6c3cf204a50a2046875e0cb6ce59c2c 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Sources/TailFx.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 76ed89a0c454d274aab8df2ff39cf7f2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Sources/TailColorTint.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1ce8b3c8aed82248a3cbb62c3927fba 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Example/TailExampleMovement.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc14cdff993bcc44a9683290503b24a8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.insaneone.taileffect", 3 | "author": "InsaneOne", 4 | "displayName": "Tail Effect", 5 | "description": "Tail Effect is an effect to make 2d/3d tails from segments. By InsaneOne, for Unity (C#). MIT License.", 6 | "unity": "2019.1", 7 | "version": "0.0.1", 8 | "keywords": [ 9 | "tailfx", 10 | "taileffect", 11 | "tail", 12 | "effects", 13 | "insaneone" 14 | ], 15 | "dependencies": {}, 16 | "repository": { 17 | "type": "git", 18 | "url": "https://github.com/OlegDzhuraev/TailEffect.git" 19 | } 20 | } -------------------------------------------------------------------------------- /Example/TailExampleMovement.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace InsaneOne.TailEffect.Example 4 | { 5 | public class TailExampleMovement : MonoBehaviour 6 | { 7 | const float Speed = 5f; 8 | const float AngularSpeed = 120f; 9 | const float ResetPos = 20f; 10 | 11 | Vector3 startPos; 12 | 13 | void Start() => startPos = transform.position; 14 | 15 | void Update() 16 | { 17 | var direction = (transform.forward + transform.up / 2f).normalized; 18 | 19 | transform.position += direction * Time.smoothDeltaTime * Speed; 20 | transform.Rotate(0, AngularSpeed * Time.smoothDeltaTime, 0); 21 | 22 | if (transform.position.y > ResetPos) 23 | transform.position = startPos; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /License: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Oleg Dzhuraev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TailEffect 2 | **Tail effect** for **Unity**. Allows to create tails from prefab segments, 2D and 3D work modes. 3 | 4 | ![Tail Effect](https://media.giphy.com/media/EL5dXX61usfsWkYYYd/giphy.gif) 5 | 6 | This is early version, changes is coming in future. 7 | 8 | ## How to install 9 | You can install plugin via **Unity Package Manager** as git package from github repository: 10 | 11 | ``` 12 | https://github.com/OlegDzhuraev/TailEffect.git 13 | ``` 14 | 15 | You also can download it directly from github and place into Assets folder. 16 | 17 | ## How to use 18 | 19 | Setup steps: 20 | 1. Add **TailFx** component to the GameObject. Setup segment fields with prefabs of your segments (head/body/tail). 21 | 2. Optionally change other settings. 22 | 3. Press **Play**. 23 | 24 | Check TailFxExample scene for more info. 25 | 26 | ## Other features 27 | ### Tail color tint 28 | 29 | With **TailColorTint** component you can assign color gradient, which will be applied to the mesh renderers of tail by length. 30 | 31 | ![Tail color tint](https://media.giphy.com/media/MfzAEWoceAnoM7TBKt/giphy.gif) 32 | 33 | ## License 34 | MIT License. 35 | -------------------------------------------------------------------------------- /Sources/TailColorTint.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace InsaneOne.TailEffect 4 | { 5 | public class TailColorTint : MonoBehaviour 6 | { 7 | [SerializeField] Gradient colorByLength = new Gradient(); 8 | [SerializeField] string materialAttribute = "_Color"; 9 | [SerializeField] bool colorizeOnStart; 10 | 11 | TailFx tail; 12 | 13 | void Awake() 14 | { 15 | tail = GetComponent(); 16 | 17 | if (colorizeOnStart) 18 | tail.Loaded += OnTailLoaded; 19 | } 20 | 21 | void OnDestroy() 22 | { 23 | if (colorizeOnStart && tail) 24 | tail.Loaded -= OnTailLoaded; 25 | } 26 | 27 | void OnTailLoaded() => UpdateColor(); 28 | 29 | public void UpdateColor() 30 | { 31 | for (var i = 0; i < tail.Parts.Count; i++) 32 | { 33 | var renderer = tail.Parts[i].GetComponent(); 34 | 35 | if (!renderer) 36 | renderer = GetComponentInChildren(); 37 | 38 | if (renderer) 39 | { 40 | var color = colorByLength.Evaluate((float) i / tail.Parts.Count); 41 | renderer.material.SetColor(materialAttribute, color); 42 | } 43 | } 44 | } 45 | 46 | public void SetCustomColor(Gradient gradient) 47 | { 48 | colorByLength = gradient; 49 | UpdateColor(); 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /Example/TailExampleObject.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: TailExampleObject 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.123 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 1, g: 0.47919267, b: 0, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | m_BuildTextureStacks: [] 79 | -------------------------------------------------------------------------------- /Example/TailExampleGroundMaterial.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: TailExampleGroundMaterial 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.131 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0.2830189, g: 0.2830189, b: 0.2830189, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | m_BuildTextureStacks: [] 79 | -------------------------------------------------------------------------------- /Example/TailExample3dSegment.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &8558065104013840999 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 2563892204007222890} 12 | - component: {fileID: 5402302881448680587} 13 | - component: {fileID: 2050050527946034893} 14 | m_Layer: 0 15 | m_Name: TailExample3dSegment 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!4 &2563892204007222890 22 | Transform: 23 | m_ObjectHideFlags: 0 24 | m_CorrespondingSourceObject: {fileID: 0} 25 | m_PrefabInstance: {fileID: 0} 26 | m_PrefabAsset: {fileID: 0} 27 | m_GameObject: {fileID: 8558065104013840999} 28 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 29 | m_LocalPosition: {x: 0, y: 0, z: 0} 30 | m_LocalScale: {x: 1, y: 1, z: 1} 31 | m_Children: [] 32 | m_Father: {fileID: 0} 33 | m_RootOrder: 0 34 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 35 | --- !u!33 &5402302881448680587 36 | MeshFilter: 37 | m_ObjectHideFlags: 0 38 | m_CorrespondingSourceObject: {fileID: 0} 39 | m_PrefabInstance: {fileID: 0} 40 | m_PrefabAsset: {fileID: 0} 41 | m_GameObject: {fileID: 8558065104013840999} 42 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 43 | --- !u!23 &2050050527946034893 44 | MeshRenderer: 45 | m_ObjectHideFlags: 0 46 | m_CorrespondingSourceObject: {fileID: 0} 47 | m_PrefabInstance: {fileID: 0} 48 | m_PrefabAsset: {fileID: 0} 49 | m_GameObject: {fileID: 8558065104013840999} 50 | m_Enabled: 1 51 | m_CastShadows: 1 52 | m_ReceiveShadows: 1 53 | m_DynamicOccludee: 1 54 | m_MotionVectors: 1 55 | m_LightProbeUsage: 1 56 | m_ReflectionProbeUsage: 1 57 | m_RayTracingMode: 2 58 | m_RayTraceProcedural: 0 59 | m_RenderingLayerMask: 1 60 | m_RendererPriority: 0 61 | m_Materials: 62 | - {fileID: 2100000, guid: 6761c339ae841a74a9c5154d29f97667, type: 2} 63 | m_StaticBatchInfo: 64 | firstSubMesh: 0 65 | subMeshCount: 0 66 | m_StaticBatchRoot: {fileID: 0} 67 | m_ProbeAnchor: {fileID: 0} 68 | m_LightProbeVolumeOverride: {fileID: 0} 69 | m_ScaleInLightmap: 1 70 | m_ReceiveGI: 1 71 | m_PreserveUVs: 0 72 | m_IgnoreNormalsForChartDetection: 0 73 | m_ImportantGI: 0 74 | m_StitchLightmapSeams: 1 75 | m_SelectedEditorRenderState: 3 76 | m_MinimumChartSize: 4 77 | m_AutoUVMaxDistance: 0.5 78 | m_AutoUVMaxAngle: 89 79 | m_LightmapParameters: {fileID: 0} 80 | m_SortingLayerID: 0 81 | m_SortingLayer: 0 82 | m_SortingOrder: 0 83 | m_AdditionalVertexStreams: {fileID: 0} 84 | -------------------------------------------------------------------------------- /Sources/TailFx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace InsaneOne.TailEffect 6 | { 7 | public enum TailAxis { TwoD, ThreeD } 8 | public enum TailStyle { Hard, Stretchy, Combined } 9 | 10 | public class TailFx : MonoBehaviour 11 | { 12 | public event Action Loaded; 13 | 14 | [SerializeField] GameObject headPrefab; 15 | [SerializeField] GameObject segmentPrefab; 16 | [SerializeField] GameObject tailPrefab; 17 | [SerializeField, Range(1, 100)] int segments = 3; 18 | 19 | [SerializeField] TailStyle style = TailStyle.Stretchy; 20 | [SerializeField] TailAxis followAxis = TailAxis.ThreeD; 21 | [SerializeField, Range(0.1f, 250f)] float stretchySpeed = 10f; 22 | [SerializeField, Range(0f, 100f)] float spaceBetween = 1f; 23 | [SerializeField] bool rotateToPrevious = true; 24 | 25 | public List Parts => parts; 26 | 27 | readonly List parts = new List(); 28 | Transform head; 29 | 30 | void Start() 31 | { 32 | head = MakePart(headPrefab); 33 | 34 | for (var i = 0; i < segments; i++) 35 | MakePart(segmentPrefab); 36 | 37 | MakePart(tailPrefab); 38 | 39 | Loaded?.Invoke(); 40 | } 41 | 42 | void Update() 43 | { 44 | head.position = transform.position; 45 | head.rotation = transform.rotation; 46 | 47 | for (var i = 1; i < Parts.Count; i++) 48 | { 49 | var previous = Parts[i - 1]; 50 | var self = Parts[i]; 51 | 52 | var previousPos = previous.position; 53 | 54 | if (style == TailStyle.Hard || style == TailStyle.Combined) 55 | { 56 | var direction = (previousPos - self.position).normalized; 57 | self.position = previousPos - direction * spaceBetween; 58 | } 59 | 60 | if (style == TailStyle.Stretchy || style == TailStyle.Combined) 61 | { 62 | var offsetDirection = GetDirection(rotateToPrevious ? previous : Parts[0]); 63 | var targetPos = previousPos - offsetDirection * spaceBetween; 64 | self.position = Vector3.Lerp(self.position, targetPos, Time.smoothDeltaTime * stretchySpeed); 65 | } 66 | 67 | if (!rotateToPrevious) 68 | continue; 69 | 70 | if (followAxis == TailAxis.ThreeD) 71 | self.LookAt(previous.position); 72 | else 73 | LookAt2D(self, previous.position); 74 | } 75 | } 76 | 77 | Transform MakePart(GameObject prefab) 78 | { 79 | var part = Instantiate(prefab, transform.position, Quaternion.identity).transform; 80 | Parts.Add(part); 81 | 82 | return part; 83 | } 84 | 85 | Vector3 GetDirection(Transform tr) 86 | { 87 | return followAxis switch 88 | { 89 | TailAxis.ThreeD => tr.forward, 90 | TailAxis.TwoD => tr.up, 91 | _ => default 92 | }; 93 | } 94 | 95 | static void LookAt2D(Transform tr, Vector3 position) 96 | { 97 | var direction = (position - tr.position).normalized; 98 | tr.rotation = Quaternion.LookRotation(Vector3.forward, direction); 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /Example/TailFxExample.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.595372, g: 0.6296191, b: 0.6981132, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 3 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0.44657874, g: 0.49641258, b: 0.5748172, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 12 47 | m_GIWorkflowMode: 1 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 0 55 | m_EnableRealtimeLightmaps: 0 56 | m_LightmapEditorSettings: 57 | serializedVersion: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_ExtractAmbientOcclusion: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 1 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 512 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 256 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 1 83 | m_PVRDenoiserTypeDirect: 1 84 | m_PVRDenoiserTypeIndirect: 1 85 | m_PVRDenoiserTypeAO: 1 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 1 90 | m_PVRCulling: 1 91 | m_PVRFilteringGaussRadiusDirect: 1 92 | m_PVRFilteringGaussRadiusIndirect: 5 93 | m_PVRFilteringGaussRadiusAO: 2 94 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 95 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 96 | m_PVRFilteringAtrousPositionSigmaAO: 1 97 | m_ExportTrainingData: 0 98 | m_TrainingDataDestination: TrainingData 99 | m_LightProbeSampleCountMultiplier: 4 100 | m_LightingDataAsset: {fileID: 0} 101 | m_LightingSettings: {fileID: 0} 102 | --- !u!196 &4 103 | NavMeshSettings: 104 | serializedVersion: 2 105 | m_ObjectHideFlags: 0 106 | m_BuildSettings: 107 | serializedVersion: 2 108 | agentTypeID: 0 109 | agentRadius: 0.5 110 | agentHeight: 2 111 | agentSlope: 45 112 | agentClimb: 0.4 113 | ledgeDropHeight: 0 114 | maxJumpAcrossDistance: 0 115 | minRegionArea: 2 116 | manualCellSize: 0 117 | cellSize: 0.16666667 118 | manualTileSize: 0 119 | tileSize: 256 120 | accuratePlacement: 0 121 | maxJobWorkers: 0 122 | preserveTilesOutsideBounds: 0 123 | debug: 124 | m_Flags: 0 125 | m_NavMeshData: {fileID: 0} 126 | --- !u!1 &42697924 127 | GameObject: 128 | m_ObjectHideFlags: 0 129 | m_CorrespondingSourceObject: {fileID: 0} 130 | m_PrefabInstance: {fileID: 0} 131 | m_PrefabAsset: {fileID: 0} 132 | serializedVersion: 6 133 | m_Component: 134 | - component: {fileID: 42697926} 135 | - component: {fileID: 42697925} 136 | - component: {fileID: 42697927} 137 | m_Layer: 0 138 | m_Name: TailFxStretchy 139 | m_TagString: Untagged 140 | m_Icon: {fileID: -964228994112308473, guid: 0000000000000000d000000000000000, type: 0} 141 | m_NavMeshLayer: 0 142 | m_StaticEditorFlags: 0 143 | m_IsActive: 1 144 | --- !u!114 &42697925 145 | MonoBehaviour: 146 | m_ObjectHideFlags: 0 147 | m_CorrespondingSourceObject: {fileID: 0} 148 | m_PrefabInstance: {fileID: 0} 149 | m_PrefabAsset: {fileID: 0} 150 | m_GameObject: {fileID: 42697924} 151 | m_Enabled: 1 152 | m_EditorHideFlags: 0 153 | m_Script: {fileID: 11500000, guid: 76ed89a0c454d274aab8df2ff39cf7f2, type: 3} 154 | m_Name: 155 | m_EditorClassIdentifier: 156 | headPrefab: {fileID: 8558065104013840999, guid: 2c6c64f8ae29307409b2c10857eba010, type: 3} 157 | segmentPrefab: {fileID: 8558065104013840999, guid: 2c6c64f8ae29307409b2c10857eba010, type: 3} 158 | tailPrefab: {fileID: 8558065104013840999, guid: 2c6c64f8ae29307409b2c10857eba010, type: 3} 159 | segments: 3 160 | style: 1 161 | followAxis: 1 162 | stretchySpeed: 10 163 | spaceBetween: 1 164 | rotateToPrevious: 1 165 | --- !u!4 &42697926 166 | Transform: 167 | m_ObjectHideFlags: 0 168 | m_CorrespondingSourceObject: {fileID: 0} 169 | m_PrefabInstance: {fileID: 0} 170 | m_PrefabAsset: {fileID: 0} 171 | m_GameObject: {fileID: 42697924} 172 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 173 | m_LocalPosition: {x: 0, y: 0, z: -2} 174 | m_LocalScale: {x: 1, y: 1, z: 1} 175 | m_Children: [] 176 | m_Father: {fileID: 0} 177 | m_RootOrder: 1 178 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 179 | --- !u!114 &42697927 180 | MonoBehaviour: 181 | m_ObjectHideFlags: 0 182 | m_CorrespondingSourceObject: {fileID: 0} 183 | m_PrefabInstance: {fileID: 0} 184 | m_PrefabAsset: {fileID: 0} 185 | m_GameObject: {fileID: 42697924} 186 | m_Enabled: 1 187 | m_EditorHideFlags: 0 188 | m_Script: {fileID: 11500000, guid: cc14cdff993bcc44a9683290503b24a8, type: 3} 189 | m_Name: 190 | m_EditorClassIdentifier: 191 | --- !u!1 &594184592 192 | GameObject: 193 | m_ObjectHideFlags: 0 194 | m_CorrespondingSourceObject: {fileID: 0} 195 | m_PrefabInstance: {fileID: 0} 196 | m_PrefabAsset: {fileID: 0} 197 | serializedVersion: 6 198 | m_Component: 199 | - component: {fileID: 594184594} 200 | - component: {fileID: 594184593} 201 | - component: {fileID: 594184595} 202 | - component: {fileID: 594184596} 203 | m_Layer: 0 204 | m_Name: TailFxHard 205 | m_TagString: Untagged 206 | m_Icon: {fileID: -964228994112308473, guid: 0000000000000000d000000000000000, type: 0} 207 | m_NavMeshLayer: 0 208 | m_StaticEditorFlags: 0 209 | m_IsActive: 1 210 | --- !u!114 &594184593 211 | MonoBehaviour: 212 | m_ObjectHideFlags: 0 213 | m_CorrespondingSourceObject: {fileID: 0} 214 | m_PrefabInstance: {fileID: 0} 215 | m_PrefabAsset: {fileID: 0} 216 | m_GameObject: {fileID: 594184592} 217 | m_Enabled: 1 218 | m_EditorHideFlags: 0 219 | m_Script: {fileID: 11500000, guid: 76ed89a0c454d274aab8df2ff39cf7f2, type: 3} 220 | m_Name: 221 | m_EditorClassIdentifier: 222 | headPrefab: {fileID: 8558065104013840999, guid: 2c6c64f8ae29307409b2c10857eba010, type: 3} 223 | segmentPrefab: {fileID: 8558065104013840999, guid: 2c6c64f8ae29307409b2c10857eba010, type: 3} 224 | tailPrefab: {fileID: 8558065104013840999, guid: 2c6c64f8ae29307409b2c10857eba010, type: 3} 225 | segments: 3 226 | style: 0 227 | followAxis: 1 228 | stretchySpeed: 10 229 | spaceBetween: 1 230 | rotateToPrevious: 1 231 | --- !u!4 &594184594 232 | Transform: 233 | m_ObjectHideFlags: 0 234 | m_CorrespondingSourceObject: {fileID: 0} 235 | m_PrefabInstance: {fileID: 0} 236 | m_PrefabAsset: {fileID: 0} 237 | m_GameObject: {fileID: 594184592} 238 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 239 | m_LocalPosition: {x: 8, y: 0, z: -8} 240 | m_LocalScale: {x: 1, y: 1, z: 1} 241 | m_Children: [] 242 | m_Father: {fileID: 0} 243 | m_RootOrder: 2 244 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 245 | --- !u!114 &594184595 246 | MonoBehaviour: 247 | m_ObjectHideFlags: 0 248 | m_CorrespondingSourceObject: {fileID: 0} 249 | m_PrefabInstance: {fileID: 0} 250 | m_PrefabAsset: {fileID: 0} 251 | m_GameObject: {fileID: 594184592} 252 | m_Enabled: 1 253 | m_EditorHideFlags: 0 254 | m_Script: {fileID: 11500000, guid: cc14cdff993bcc44a9683290503b24a8, type: 3} 255 | m_Name: 256 | m_EditorClassIdentifier: 257 | --- !u!114 &594184596 258 | MonoBehaviour: 259 | m_ObjectHideFlags: 0 260 | m_CorrespondingSourceObject: {fileID: 0} 261 | m_PrefabInstance: {fileID: 0} 262 | m_PrefabAsset: {fileID: 0} 263 | m_GameObject: {fileID: 594184592} 264 | m_Enabled: 1 265 | m_EditorHideFlags: 0 266 | m_Script: {fileID: 11500000, guid: b1ce8b3c8aed82248a3cbb62c3927fba, type: 3} 267 | m_Name: 268 | m_EditorClassIdentifier: 269 | colorByLength: 270 | serializedVersion: 2 271 | key0: {r: 1, g: 0.93395424, b: 0, a: 1} 272 | key1: {r: 1, g: 0, b: 0, a: 1} 273 | key2: {r: 0, g: 0, b: 0, a: 0} 274 | key3: {r: 0, g: 0, b: 0, a: 0} 275 | key4: {r: 0, g: 0, b: 0, a: 0} 276 | key5: {r: 0, g: 0, b: 0, a: 0} 277 | key6: {r: 0, g: 0, b: 0, a: 0} 278 | key7: {r: 0, g: 0, b: 0, a: 0} 279 | ctime0: 0 280 | ctime1: 65535 281 | ctime2: 0 282 | ctime3: 0 283 | ctime4: 0 284 | ctime5: 0 285 | ctime6: 0 286 | ctime7: 0 287 | atime0: 0 288 | atime1: 65535 289 | atime2: 0 290 | atime3: 0 291 | atime4: 0 292 | atime5: 0 293 | atime6: 0 294 | atime7: 0 295 | m_Mode: 0 296 | m_NumColorKeys: 2 297 | m_NumAlphaKeys: 2 298 | materialAttribute: _Color 299 | colorizeOnStart: 1 300 | --- !u!1 &871008303 301 | GameObject: 302 | m_ObjectHideFlags: 0 303 | m_CorrespondingSourceObject: {fileID: 0} 304 | m_PrefabInstance: {fileID: 0} 305 | m_PrefabAsset: {fileID: 0} 306 | serializedVersion: 6 307 | m_Component: 308 | - component: {fileID: 871008306} 309 | - component: {fileID: 871008305} 310 | - component: {fileID: 871008304} 311 | m_Layer: 0 312 | m_Name: TailFxCombined 313 | m_TagString: Untagged 314 | m_Icon: {fileID: -964228994112308473, guid: 0000000000000000d000000000000000, type: 0} 315 | m_NavMeshLayer: 0 316 | m_StaticEditorFlags: 0 317 | m_IsActive: 1 318 | --- !u!114 &871008304 319 | MonoBehaviour: 320 | m_ObjectHideFlags: 0 321 | m_CorrespondingSourceObject: {fileID: 0} 322 | m_PrefabInstance: {fileID: 0} 323 | m_PrefabAsset: {fileID: 0} 324 | m_GameObject: {fileID: 871008303} 325 | m_Enabled: 1 326 | m_EditorHideFlags: 0 327 | m_Script: {fileID: 11500000, guid: cc14cdff993bcc44a9683290503b24a8, type: 3} 328 | m_Name: 329 | m_EditorClassIdentifier: 330 | --- !u!114 &871008305 331 | MonoBehaviour: 332 | m_ObjectHideFlags: 0 333 | m_CorrespondingSourceObject: {fileID: 0} 334 | m_PrefabInstance: {fileID: 0} 335 | m_PrefabAsset: {fileID: 0} 336 | m_GameObject: {fileID: 871008303} 337 | m_Enabled: 1 338 | m_EditorHideFlags: 0 339 | m_Script: {fileID: 11500000, guid: 76ed89a0c454d274aab8df2ff39cf7f2, type: 3} 340 | m_Name: 341 | m_EditorClassIdentifier: 342 | headPrefab: {fileID: 8558065104013840999, guid: 2c6c64f8ae29307409b2c10857eba010, type: 3} 343 | segmentPrefab: {fileID: 8558065104013840999, guid: 2c6c64f8ae29307409b2c10857eba010, type: 3} 344 | tailPrefab: {fileID: 8558065104013840999, guid: 2c6c64f8ae29307409b2c10857eba010, type: 3} 345 | segments: 3 346 | style: 2 347 | followAxis: 1 348 | stretchySpeed: 10 349 | spaceBetween: 1 350 | rotateToPrevious: 1 351 | --- !u!4 &871008306 352 | Transform: 353 | m_ObjectHideFlags: 0 354 | m_CorrespondingSourceObject: {fileID: 0} 355 | m_PrefabInstance: {fileID: 0} 356 | m_PrefabAsset: {fileID: 0} 357 | m_GameObject: {fileID: 871008303} 358 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 359 | m_LocalPosition: {x: -6, y: 0, z: 2} 360 | m_LocalScale: {x: 1, y: 1, z: 1} 361 | m_Children: [] 362 | m_Father: {fileID: 0} 363 | m_RootOrder: 3 364 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 365 | --- !u!1 &912170713 366 | GameObject: 367 | m_ObjectHideFlags: 0 368 | m_CorrespondingSourceObject: {fileID: 0} 369 | m_PrefabInstance: {fileID: 0} 370 | m_PrefabAsset: {fileID: 0} 371 | serializedVersion: 6 372 | m_Component: 373 | - component: {fileID: 912170714} 374 | m_Layer: 0 375 | m_Name: Env 376 | m_TagString: Untagged 377 | m_Icon: {fileID: 0} 378 | m_NavMeshLayer: 0 379 | m_StaticEditorFlags: 0 380 | m_IsActive: 1 381 | --- !u!4 &912170714 382 | Transform: 383 | m_ObjectHideFlags: 0 384 | m_CorrespondingSourceObject: {fileID: 0} 385 | m_PrefabInstance: {fileID: 0} 386 | m_PrefabAsset: {fileID: 0} 387 | m_GameObject: {fileID: 912170713} 388 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 389 | m_LocalPosition: {x: 0, y: 0, z: 0} 390 | m_LocalScale: {x: 1, y: 1, z: 1} 391 | m_Children: 392 | - {fileID: 1804790902} 393 | - {fileID: 1666549399} 394 | - {fileID: 1638097218} 395 | m_Father: {fileID: 0} 396 | m_RootOrder: 4 397 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 398 | --- !u!1 &1484774385 399 | GameObject: 400 | m_ObjectHideFlags: 0 401 | m_CorrespondingSourceObject: {fileID: 0} 402 | m_PrefabInstance: {fileID: 0} 403 | m_PrefabAsset: {fileID: 0} 404 | serializedVersion: 6 405 | m_Component: 406 | - component: {fileID: 1484774388} 407 | - component: {fileID: 1484774387} 408 | m_Layer: 0 409 | m_Name: Main Camera 410 | m_TagString: MainCamera 411 | m_Icon: {fileID: 0} 412 | m_NavMeshLayer: 0 413 | m_StaticEditorFlags: 0 414 | m_IsActive: 1 415 | --- !u!20 &1484774387 416 | Camera: 417 | m_ObjectHideFlags: 0 418 | m_CorrespondingSourceObject: {fileID: 0} 419 | m_PrefabInstance: {fileID: 0} 420 | m_PrefabAsset: {fileID: 0} 421 | m_GameObject: {fileID: 1484774385} 422 | m_Enabled: 1 423 | serializedVersion: 2 424 | m_ClearFlags: 1 425 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 426 | m_projectionMatrixMode: 1 427 | m_GateFitMode: 2 428 | m_FOVAxisMode: 0 429 | m_SensorSize: {x: 36, y: 24} 430 | m_LensShift: {x: 0, y: 0} 431 | m_FocalLength: 50 432 | m_NormalizedViewPortRect: 433 | serializedVersion: 2 434 | x: 0 435 | y: 0 436 | width: 1 437 | height: 1 438 | near clip plane: 0.3 439 | far clip plane: 1000 440 | field of view: 60 441 | orthographic: 0 442 | orthographic size: 5 443 | m_Depth: -1 444 | m_CullingMask: 445 | serializedVersion: 2 446 | m_Bits: 4294967295 447 | m_RenderingPath: -1 448 | m_TargetTexture: {fileID: 0} 449 | m_TargetDisplay: 0 450 | m_TargetEye: 3 451 | m_HDR: 1 452 | m_AllowMSAA: 1 453 | m_AllowDynamicResolution: 0 454 | m_ForceIntoRT: 0 455 | m_OcclusionCulling: 1 456 | m_StereoConvergence: 10 457 | m_StereoSeparation: 0.022 458 | --- !u!4 &1484774388 459 | Transform: 460 | m_ObjectHideFlags: 0 461 | m_CorrespondingSourceObject: {fileID: 0} 462 | m_PrefabInstance: {fileID: 0} 463 | m_PrefabAsset: {fileID: 0} 464 | m_GameObject: {fileID: 1484774385} 465 | m_LocalRotation: {x: 0.08066471, y: -0.91933537, z: 0.2723195, w: 0.27231953} 466 | m_LocalPosition: {x: 7, y: 14, z: 6} 467 | m_LocalScale: {x: 1, y: 1, z: 1} 468 | m_Children: [] 469 | m_Father: {fileID: 0} 470 | m_RootOrder: 0 471 | m_LocalEulerAnglesHint: {x: 33, y: -147, z: 0} 472 | --- !u!1 &1638097217 473 | GameObject: 474 | m_ObjectHideFlags: 0 475 | m_CorrespondingSourceObject: {fileID: 0} 476 | m_PrefabInstance: {fileID: 0} 477 | m_PrefabAsset: {fileID: 0} 478 | serializedVersion: 6 479 | m_Component: 480 | - component: {fileID: 1638097218} 481 | - component: {fileID: 1638097219} 482 | m_Layer: 0 483 | m_Name: SubLight 484 | m_TagString: Untagged 485 | m_Icon: {fileID: 0} 486 | m_NavMeshLayer: 0 487 | m_StaticEditorFlags: 0 488 | m_IsActive: 1 489 | --- !u!4 &1638097218 490 | Transform: 491 | m_ObjectHideFlags: 0 492 | m_CorrespondingSourceObject: {fileID: 0} 493 | m_PrefabInstance: {fileID: 0} 494 | m_PrefabAsset: {fileID: 0} 495 | m_GameObject: {fileID: 1638097217} 496 | m_LocalRotation: {x: -0.5414418, y: 0.715168, z: -0.12415314, w: 0.42421877} 497 | m_LocalPosition: {x: -2, y: 3, z: 0} 498 | m_LocalScale: {x: 1, y: 1, z: 1} 499 | m_Children: [] 500 | m_Father: {fileID: 912170714} 501 | m_RootOrder: 2 502 | m_LocalEulerAnglesHint: {x: -16.368, y: 129.419, z: -66.483} 503 | --- !u!108 &1638097219 504 | Light: 505 | m_ObjectHideFlags: 0 506 | m_CorrespondingSourceObject: {fileID: 0} 507 | m_PrefabInstance: {fileID: 0} 508 | m_PrefabAsset: {fileID: 0} 509 | m_GameObject: {fileID: 1638097217} 510 | m_Enabled: 1 511 | serializedVersion: 10 512 | m_Type: 1 513 | m_Shape: 0 514 | m_Color: {r: 1, g: 0.31234047, b: 0.2588235, a: 1} 515 | m_Intensity: 0.3 516 | m_Range: 10 517 | m_SpotAngle: 30 518 | m_InnerSpotAngle: 21.80208 519 | m_CookieSize: 10 520 | m_Shadows: 521 | m_Type: 0 522 | m_Resolution: -1 523 | m_CustomResolution: -1 524 | m_Strength: 1 525 | m_Bias: 0.05 526 | m_NormalBias: 0.4 527 | m_NearPlane: 0.2 528 | m_CullingMatrixOverride: 529 | e00: 1 530 | e01: 0 531 | e02: 0 532 | e03: 0 533 | e10: 0 534 | e11: 1 535 | e12: 0 536 | e13: 0 537 | e20: 0 538 | e21: 0 539 | e22: 1 540 | e23: 0 541 | e30: 0 542 | e31: 0 543 | e32: 0 544 | e33: 1 545 | m_UseCullingMatrixOverride: 0 546 | m_Cookie: {fileID: 0} 547 | m_DrawHalo: 0 548 | m_Flare: {fileID: 0} 549 | m_RenderMode: 0 550 | m_CullingMask: 551 | serializedVersion: 2 552 | m_Bits: 4294967295 553 | m_RenderingLayerMask: 1 554 | m_Lightmapping: 4 555 | m_LightShadowCasterMode: 0 556 | m_AreaSize: {x: 1, y: 1} 557 | m_BounceIntensity: 1 558 | m_ColorTemperature: 6570 559 | m_UseColorTemperature: 0 560 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 561 | m_UseBoundingSphereOverride: 0 562 | m_UseViewFrustumForShadowCasterCull: 1 563 | m_ShadowRadius: 0 564 | m_ShadowAngle: 0 565 | --- !u!1 &1666549396 566 | GameObject: 567 | m_ObjectHideFlags: 0 568 | m_CorrespondingSourceObject: {fileID: 0} 569 | m_PrefabInstance: {fileID: 0} 570 | m_PrefabAsset: {fileID: 0} 571 | serializedVersion: 6 572 | m_Component: 573 | - component: {fileID: 1666549399} 574 | - component: {fileID: 1666549398} 575 | - component: {fileID: 1666549397} 576 | m_Layer: 0 577 | m_Name: Ground 578 | m_TagString: Untagged 579 | m_Icon: {fileID: 0} 580 | m_NavMeshLayer: 0 581 | m_StaticEditorFlags: 0 582 | m_IsActive: 1 583 | --- !u!23 &1666549397 584 | MeshRenderer: 585 | m_ObjectHideFlags: 0 586 | m_CorrespondingSourceObject: {fileID: 0} 587 | m_PrefabInstance: {fileID: 0} 588 | m_PrefabAsset: {fileID: 0} 589 | m_GameObject: {fileID: 1666549396} 590 | m_Enabled: 1 591 | m_CastShadows: 1 592 | m_ReceiveShadows: 1 593 | m_DynamicOccludee: 1 594 | m_MotionVectors: 1 595 | m_LightProbeUsage: 1 596 | m_ReflectionProbeUsage: 1 597 | m_RayTracingMode: 2 598 | m_RayTraceProcedural: 0 599 | m_RenderingLayerMask: 1 600 | m_RendererPriority: 0 601 | m_Materials: 602 | - {fileID: 2100000, guid: b6c3cf204a50a2046875e0cb6ce59c2c, type: 2} 603 | m_StaticBatchInfo: 604 | firstSubMesh: 0 605 | subMeshCount: 0 606 | m_StaticBatchRoot: {fileID: 0} 607 | m_ProbeAnchor: {fileID: 0} 608 | m_LightProbeVolumeOverride: {fileID: 0} 609 | m_ScaleInLightmap: 1 610 | m_ReceiveGI: 1 611 | m_PreserveUVs: 0 612 | m_IgnoreNormalsForChartDetection: 0 613 | m_ImportantGI: 0 614 | m_StitchLightmapSeams: 1 615 | m_SelectedEditorRenderState: 3 616 | m_MinimumChartSize: 4 617 | m_AutoUVMaxDistance: 0.5 618 | m_AutoUVMaxAngle: 89 619 | m_LightmapParameters: {fileID: 0} 620 | m_SortingLayerID: 0 621 | m_SortingLayer: 0 622 | m_SortingOrder: 0 623 | m_AdditionalVertexStreams: {fileID: 0} 624 | --- !u!33 &1666549398 625 | MeshFilter: 626 | m_ObjectHideFlags: 0 627 | m_CorrespondingSourceObject: {fileID: 0} 628 | m_PrefabInstance: {fileID: 0} 629 | m_PrefabAsset: {fileID: 0} 630 | m_GameObject: {fileID: 1666549396} 631 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 632 | --- !u!4 &1666549399 633 | Transform: 634 | m_ObjectHideFlags: 0 635 | m_CorrespondingSourceObject: {fileID: 0} 636 | m_PrefabInstance: {fileID: 0} 637 | m_PrefabAsset: {fileID: 0} 638 | m_GameObject: {fileID: 1666549396} 639 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 640 | m_LocalPosition: {x: 0, y: 0, z: 0} 641 | m_LocalScale: {x: 512, y: 1, z: 512} 642 | m_Children: [] 643 | m_Father: {fileID: 912170714} 644 | m_RootOrder: 1 645 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 646 | --- !u!1 &1804790900 647 | GameObject: 648 | m_ObjectHideFlags: 0 649 | m_CorrespondingSourceObject: {fileID: 0} 650 | m_PrefabInstance: {fileID: 0} 651 | m_PrefabAsset: {fileID: 0} 652 | serializedVersion: 6 653 | m_Component: 654 | - component: {fileID: 1804790902} 655 | - component: {fileID: 1804790901} 656 | m_Layer: 0 657 | m_Name: Directional Light 658 | m_TagString: Untagged 659 | m_Icon: {fileID: 0} 660 | m_NavMeshLayer: 0 661 | m_StaticEditorFlags: 0 662 | m_IsActive: 1 663 | --- !u!108 &1804790901 664 | Light: 665 | m_ObjectHideFlags: 0 666 | m_CorrespondingSourceObject: {fileID: 0} 667 | m_PrefabInstance: {fileID: 0} 668 | m_PrefabAsset: {fileID: 0} 669 | m_GameObject: {fileID: 1804790900} 670 | m_Enabled: 1 671 | serializedVersion: 10 672 | m_Type: 1 673 | m_Shape: 0 674 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 675 | m_Intensity: 1 676 | m_Range: 10 677 | m_SpotAngle: 30 678 | m_InnerSpotAngle: 21.80208 679 | m_CookieSize: 10 680 | m_Shadows: 681 | m_Type: 2 682 | m_Resolution: -1 683 | m_CustomResolution: -1 684 | m_Strength: 1 685 | m_Bias: 0.05 686 | m_NormalBias: 0.4 687 | m_NearPlane: 0.2 688 | m_CullingMatrixOverride: 689 | e00: 1 690 | e01: 0 691 | e02: 0 692 | e03: 0 693 | e10: 0 694 | e11: 1 695 | e12: 0 696 | e13: 0 697 | e20: 0 698 | e21: 0 699 | e22: 1 700 | e23: 0 701 | e30: 0 702 | e31: 0 703 | e32: 0 704 | e33: 1 705 | m_UseCullingMatrixOverride: 0 706 | m_Cookie: {fileID: 0} 707 | m_DrawHalo: 0 708 | m_Flare: {fileID: 0} 709 | m_RenderMode: 0 710 | m_CullingMask: 711 | serializedVersion: 2 712 | m_Bits: 4294967295 713 | m_RenderingLayerMask: 1 714 | m_Lightmapping: 4 715 | m_LightShadowCasterMode: 0 716 | m_AreaSize: {x: 1, y: 1} 717 | m_BounceIntensity: 1 718 | m_ColorTemperature: 6570 719 | m_UseColorTemperature: 0 720 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 721 | m_UseBoundingSphereOverride: 0 722 | m_UseViewFrustumForShadowCasterCull: 1 723 | m_ShadowRadius: 0 724 | m_ShadowAngle: 0 725 | --- !u!4 &1804790902 726 | Transform: 727 | m_ObjectHideFlags: 0 728 | m_CorrespondingSourceObject: {fileID: 0} 729 | m_PrefabInstance: {fileID: 0} 730 | m_PrefabAsset: {fileID: 0} 731 | m_GameObject: {fileID: 1804790900} 732 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 733 | m_LocalPosition: {x: 0, y: 3, z: 0} 734 | m_LocalScale: {x: 1, y: 1, z: 1} 735 | m_Children: [] 736 | m_Father: {fileID: 912170714} 737 | m_RootOrder: 0 738 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 739 | --------------------------------------------------------------------------------