New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2979e4b68d20bf54990dbb217ed2dad0 |
| | | folderAsset: yes |
| | | timeCreated: 1537519728 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 823a56f499736a246b0b28b1cbe6c581 |
| | | TextureImporter: |
| | | serializedVersion: 2 |
| | | mipmaps: |
| | | mipMapMode: 0 |
| | | enableMipMap: 0 |
| | | linearTexture: 0 |
| | | correctGamma: 0 |
| | | fadeOut: 0 |
| | | borderMipMap: 0 |
| | | mipMapFadeDistanceStart: 1 |
| | | mipMapFadeDistanceEnd: 3 |
| | | bumpmap: |
| | | convertToNormalMap: 0 |
| | | externalNormalMap: 0 |
| | | heightScale: .25 |
| | | normalMapFilter: 0 |
| | | isReadable: 0 |
| | | grayScaleToAlpha: 0 |
| | | generateCubemap: 0 |
| | | seamlessCubemap: 0 |
| | | textureFormat: -1 |
| | | maxTextureSize: 1024 |
| | | textureSettings: |
| | | filterMode: 0 |
| | | aniso: 1 |
| | | mipBias: -1 |
| | | wrapMode: 1 |
| | | nPOTScale: 0 |
| | | lightmap: 0 |
| | | compressionQuality: 50 |
| | | spriteMode: 1 |
| | | spriteExtrude: 1 |
| | | spriteMeshType: 1 |
| | | alignment: 0 |
| | | spritePivot: {x: .5, y: .5} |
| | | spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
| | | spritePixelsToUnits: 100 |
| | | alphaIsTransparency: 1 |
| | | textureType: 8 |
| | | buildTargetSettings: |
| | | - buildTarget: iPhone |
| | | maxTextureSize: 1024 |
| | | textureFormat: -2 |
| | | compressionQuality: 50 |
| | | spriteSheet: |
| | | sprites: [] |
| | | spritePackingTag: |
| | | userData: |
New file |
| | |
| | | using PigeonCoopToolkit.Effects.Trails; |
| | | using UnityEditor; |
| | | using System.Collections.Generic; |
| | | |
| | | namespace PigeonCoopToolkit.TouchInputManager.Editor |
| | | { |
| | | [InitializeOnLoad] |
| | | public class ExecutionOrderSetter |
| | | { |
| | | static ExecutionOrderSetter() |
| | | { |
| | | var scriptlist = new List<string> |
| | | { |
| | | typeof (TrailRenderer_Base).Name, |
| | | typeof (Trail).Name, |
| | | typeof (SmoothTrail).Name, |
| | | typeof (SmokeTrail).Name, |
| | | typeof (SmokePlume).Name |
| | | }; |
| | | |
| | | foreach (MonoScript monoScript in MonoImporter.GetAllRuntimeMonoScripts()) |
| | | { |
| | | if (!scriptlist.Contains(monoScript.name)) continue; |
| | | |
| | | if(MonoImporter.GetExecutionOrder(monoScript) != 1000) |
| | | MonoImporter.SetExecutionOrder(monoScript, 1000); |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6729d5e44ac233945be3883bbcacec24 |
| | | labels: |
| | | - BetterTrails |
| | | - TrailRenderer |
| | | - Smoke |
| | | - Trail |
| | | - Effects |
| | | - skidmarks |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
New file |
| | |
| | | using System; |
| | | using UnityEditor; |
| | | using UnityEngine; |
| | | |
| | | namespace PigeonCoopToolkit.Generic.Editor |
| | | { |
| | | public class InfoDialogue : EditorWindow |
| | | { |
| | | public VersionInformation versionInformation; |
| | | public Texture2D banner; |
| | | public string UserGuidePath; |
| | | public string AssetStoreContentID; |
| | | public bool IsAbout; |
| | | |
| | | void OnGUI() |
| | | { |
| | | if(banner == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | |
| | | GUI.DrawTexture(new Rect(0, 0, banner.width, banner.height), banner); |
| | | GUILayout.Space(banner.height - 18); |
| | | if (versionInformation != null) GUILayout.Label(versionInformation.ToString(), EditorStyles.whiteMiniLabel); |
| | | GUIStyle lessPaddingNotif = new GUIStyle("NotificationText"); |
| | | lessPaddingNotif.padding = new RectOffset(10,10,10,10); |
| | | lessPaddingNotif.margin = new RectOffset(10, 10, 10, 10); |
| | | lessPaddingNotif.stretchWidth = true; |
| | | |
| | | if (!IsAbout) |
| | | GUILayout.Label("Thanks for your purchase! ♥", lessPaddingNotif); |
| | | else |
| | | GUILayout.FlexibleSpace(); |
| | | |
| | | GUILayout.BeginHorizontal(); |
| | | GUILayout.Space(16); |
| | | GUILayout.BeginVertical(); |
| | | GUILayout.Label("We hope you enjoy this tool. Feel free to contact us at our twitter or email - send us feature requests, get some help from us, or just say hi!", "WordWrapLabel"); |
| | | GUILayout.Label("Don't forget to rate or review "+ (versionInformation != null ? versionInformation.Name : "us") +" on the asset store once you've had a chance to evaluate it", "WordWrapLabel"); |
| | | GUILayout.EndVertical(); |
| | | GUILayout.Space(16); |
| | | GUILayout.EndHorizontal(); |
| | | |
| | | |
| | | GUILayout.FlexibleSpace(); |
| | | GUILayout.BeginHorizontal(); |
| | | GUILayout.FlexibleSpace(); |
| | | |
| | | GUILayout.BeginVertical(); |
| | | |
| | | if (!string.IsNullOrEmpty(AssetStoreContentID)) |
| | | if (GUILayout.Button("Review us on the Asset Store!", "LargeButton")) |
| | | { |
| | | Application.OpenURL("com.unity3d.kharma:content/" + AssetStoreContentID); |
| | | } |
| | | GUILayout.Space(5); |
| | | if (!string.IsNullOrEmpty(UserGuidePath)) |
| | | { |
| | | if (GUILayout.Button("Need help? Read the user guide!","LargeButton")) |
| | | { |
| | | Application.OpenURL(UserGuidePath); |
| | | }; |
| | | |
| | | } |
| | | GUILayout.Space(5); |
| | | if (GUILayout.Button("Want to say hello? @PigeonCoopAU", "LargeButton")) |
| | | { |
| | | Application.OpenURL("http://www.twitter.com/PigeonCoopAU"); |
| | | } |
| | | |
| | | GUILayout.EndVertical(); |
| | | GUILayout.FlexibleSpace(); |
| | | |
| | | GUILayout.EndHorizontal(); |
| | | |
| | | GUILayout.FlexibleSpace(); |
| | | GUILayout.Label("© 2014-" + DateTime.Now.Year + " Pigeon Coop ", EditorStyles.miniLabel); |
| | | |
| | | } |
| | | |
| | | public void Init(Texture2D _banner, VersionInformation _versionInformation, string userGuidePath, string assetStoreContentID = null, bool isAbout = false) |
| | | { |
| | | banner = _banner; |
| | | |
| | | //ensure the banner is not null. |
| | | if (banner == null) |
| | | banner = EditorGUIUtility.whiteTexture; |
| | | |
| | | UserGuidePath = userGuidePath; |
| | | IsAbout = isAbout; |
| | | AssetStoreContentID = assetStoreContentID; |
| | | |
| | | if (System.IO.File.Exists(FileUtil.GetProjectRelativePath(userGuidePath)) == false) |
| | | UserGuidePath = null; |
| | | |
| | | versionInformation = _versionInformation; |
| | | minSize = maxSize = new Vector2(banner == EditorGUIUtility.whiteTexture ? 350 : banner.width, 500); |
| | | } |
| | | } |
| | | |
| | | public class InfoDialogueSpawner |
| | | { |
| | | public InfoDialogueSpawner() |
| | | { |
| | | EditorApplication.update += Update; |
| | | } |
| | | |
| | | private string _projectName; |
| | | private string _bannerLocation; |
| | | private VersionInformation _versionInfo; |
| | | private string _documentationLocation; |
| | | private string _projectID; |
| | | |
| | | protected void SetParams( |
| | | string projectName, |
| | | string bannerLocation, |
| | | VersionInformation versionInfo, |
| | | string documentationLocation, |
| | | string projectID |
| | | ) |
| | | { |
| | | _projectName = projectName; |
| | | _bannerLocation = bannerLocation; |
| | | _versionInfo = versionInfo; |
| | | _documentationLocation = documentationLocation; |
| | | _projectID = projectID; |
| | | } |
| | | |
| | | public virtual void LaunchAbout() |
| | | { |
| | | InfoDialogue dialogue = EditorWindow.GetWindow<InfoDialogue>( |
| | | true, |
| | | _projectName); |
| | | dialogue.Init(Resources.Load(_bannerLocation) as Texture2D,_versionInfo, |
| | | Application.dataPath + _documentationLocation, |
| | | _projectID, |
| | | true |
| | | ); |
| | | } |
| | | |
| | | void Update() |
| | | { |
| | | if (EditorPrefs.GetBool("PCTK/" + _projectID+"/IntroDialogueLaunched") == false) |
| | | { |
| | | EditorPrefs.SetBool("PCTK/" + _projectID + "/IntroDialogueLaunched", true); |
| | | |
| | | InfoDialogue dialogue = EditorWindow.GetWindow<InfoDialogue>( |
| | | true, |
| | | _projectName); |
| | | dialogue.Init(Resources.Load(_bannerLocation) as Texture2D, _versionInfo, |
| | | Application.dataPath + _documentationLocation, |
| | | _projectID |
| | | ); |
| | | |
| | | } |
| | | else |
| | | { |
| | | EditorApplication.update -= Update; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d27328469399f4443bdb51b74f6a00f0 |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
New file |
| | |
| | | using PigeonCoopToolkit.Generic.Editor; |
| | | using UnityEditor; |
| | | |
| | | namespace PigeonCoopToolkit.Effects.Trails.Editor |
| | | { |
| | | [InitializeOnLoad] |
| | | public class BetterTrailsIntroDialogue : InfoDialogueSpawner |
| | | { |
| | | private static BetterTrailsIntroDialogue _instance; |
| | | static BetterTrailsIntroDialogue() |
| | | { |
| | | _instance = new BetterTrailsIntroDialogue(); |
| | | _instance.SetParams( |
| | | "Better Trails", |
| | | "PCTK/Effects/Trails/banner", |
| | | new Generic.VersionInformation("Better Trails", 1, 5, 0), |
| | | "/PigeonCoopToolkit/__Effects (Trails) Examples/Pigeon Coop Toolkit - Effects (Trails).pdf", |
| | | "16076"); |
| | | } |
| | | |
| | | [MenuItem("Window/Pigeon Coop Toolkit/Better Trails/About")] |
| | | public static void About() |
| | | { |
| | | _instance.LaunchAbout(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 003fa1f8580533c43b6cbb6e5a5f23af |
| | | labels: |
| | | - BetterTrails |
| | | - TrailRenderer |
| | | - Smoke |
| | | - Trail |
| | | - Effects |
| | | - skidmarks |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 5a669fa1d2222e94cadfcf30fb1bffbe |
| | | TextureImporter: |
| | | serializedVersion: 2 |
| | | mipmaps: |
| | | mipMapMode: 0 |
| | | enableMipMap: 0 |
| | | linearTexture: 0 |
| | | correctGamma: 0 |
| | | fadeOut: 0 |
| | | borderMipMap: 0 |
| | | mipMapFadeDistanceStart: 1 |
| | | mipMapFadeDistanceEnd: 3 |
| | | bumpmap: |
| | | convertToNormalMap: 0 |
| | | externalNormalMap: 0 |
| | | heightScale: .25 |
| | | normalMapFilter: 0 |
| | | isReadable: 0 |
| | | grayScaleToAlpha: 0 |
| | | generateCubemap: 0 |
| | | seamlessCubemap: 0 |
| | | textureFormat: -1 |
| | | maxTextureSize: 1024 |
| | | textureSettings: |
| | | filterMode: 0 |
| | | aniso: 1 |
| | | mipBias: -1 |
| | | wrapMode: 1 |
| | | nPOTScale: 0 |
| | | lightmap: 0 |
| | | compressionQuality: 50 |
| | | spriteMode: 1 |
| | | spriteExtrude: 1 |
| | | spriteMeshType: 1 |
| | | alignment: 0 |
| | | spritePivot: {x: .5, y: .5} |
| | | spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
| | | spritePixelsToUnits: 100 |
| | | alphaIsTransparency: 1 |
| | | textureType: 8 |
| | | buildTargetSettings: |
| | | - buildTarget: iPhone |
| | | maxTextureSize: 1024 |
| | | textureFormat: -2 |
| | | compressionQuality: 50 |
| | | spriteSheet: |
| | | sprites: [] |
| | | spritePackingTag: |
| | | userData: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: edf139000f8a3774c81662142c9bc647 |
| | | TextureImporter: |
| | | serializedVersion: 2 |
| | | mipmaps: |
| | | mipMapMode: 0 |
| | | enableMipMap: 0 |
| | | linearTexture: 0 |
| | | correctGamma: 0 |
| | | fadeOut: 0 |
| | | borderMipMap: 0 |
| | | mipMapFadeDistanceStart: 1 |
| | | mipMapFadeDistanceEnd: 3 |
| | | bumpmap: |
| | | convertToNormalMap: 0 |
| | | externalNormalMap: 0 |
| | | heightScale: .25 |
| | | normalMapFilter: 0 |
| | | isReadable: 0 |
| | | grayScaleToAlpha: 0 |
| | | generateCubemap: 0 |
| | | seamlessCubemap: 0 |
| | | textureFormat: -1 |
| | | maxTextureSize: 1024 |
| | | textureSettings: |
| | | filterMode: 0 |
| | | aniso: 1 |
| | | mipBias: -1 |
| | | wrapMode: 1 |
| | | nPOTScale: 0 |
| | | lightmap: 0 |
| | | compressionQuality: 50 |
| | | spriteMode: 1 |
| | | spriteExtrude: 1 |
| | | spriteMeshType: 1 |
| | | alignment: 0 |
| | | spritePivot: {x: .5, y: .5} |
| | | spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
| | | spritePixelsToUnits: 100 |
| | | alphaIsTransparency: 1 |
| | | textureType: 8 |
| | | buildTargetSettings: |
| | | - buildTarget: iPhone |
| | | maxTextureSize: 1024 |
| | | textureFormat: -2 |
| | | compressionQuality: 50 |
| | | spriteSheet: |
| | | sprites: [] |
| | | spritePackingTag: |
| | | userData: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a035255ec9b082d41990b29b74f34fd8 |
| | | TextureImporter: |
| | | serializedVersion: 2 |
| | | mipmaps: |
| | | mipMapMode: 0 |
| | | enableMipMap: 0 |
| | | linearTexture: 0 |
| | | correctGamma: 0 |
| | | fadeOut: 0 |
| | | borderMipMap: 0 |
| | | mipMapFadeDistanceStart: 1 |
| | | mipMapFadeDistanceEnd: 3 |
| | | bumpmap: |
| | | convertToNormalMap: 0 |
| | | externalNormalMap: 0 |
| | | heightScale: .25 |
| | | normalMapFilter: 0 |
| | | isReadable: 0 |
| | | grayScaleToAlpha: 0 |
| | | generateCubemap: 0 |
| | | seamlessCubemap: 0 |
| | | textureFormat: -1 |
| | | maxTextureSize: 1024 |
| | | textureSettings: |
| | | filterMode: 0 |
| | | aniso: 1 |
| | | mipBias: -1 |
| | | wrapMode: 1 |
| | | nPOTScale: 0 |
| | | lightmap: 0 |
| | | compressionQuality: 50 |
| | | spriteMode: 1 |
| | | spriteExtrude: 1 |
| | | spriteMeshType: 1 |
| | | alignment: 0 |
| | | spritePivot: {x: .5, y: .5} |
| | | spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
| | | spritePixelsToUnits: 100 |
| | | alphaIsTransparency: 1 |
| | | textureType: 8 |
| | | buildTargetSettings: |
| | | - buildTarget: iPhone |
| | | maxTextureSize: 1024 |
| | | textureFormat: -2 |
| | | compressionQuality: 50 |
| | | spriteSheet: |
| | | sprites: [] |
| | | spritePackingTag: |
| | | userData: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ae3613f965c624446bf237ebc28e6fac |
| | | TextureImporter: |
| | | serializedVersion: 2 |
| | | mipmaps: |
| | | mipMapMode: 0 |
| | | enableMipMap: 0 |
| | | linearTexture: 0 |
| | | correctGamma: 0 |
| | | fadeOut: 0 |
| | | borderMipMap: 0 |
| | | mipMapFadeDistanceStart: 1 |
| | | mipMapFadeDistanceEnd: 3 |
| | | bumpmap: |
| | | convertToNormalMap: 0 |
| | | externalNormalMap: 0 |
| | | heightScale: .25 |
| | | normalMapFilter: 0 |
| | | isReadable: 0 |
| | | grayScaleToAlpha: 0 |
| | | generateCubemap: 0 |
| | | seamlessCubemap: 0 |
| | | textureFormat: -1 |
| | | maxTextureSize: 1024 |
| | | textureSettings: |
| | | filterMode: 0 |
| | | aniso: 1 |
| | | mipBias: -1 |
| | | wrapMode: 1 |
| | | nPOTScale: 0 |
| | | lightmap: 0 |
| | | compressionQuality: 50 |
| | | spriteMode: 1 |
| | | spriteExtrude: 1 |
| | | spriteMeshType: 1 |
| | | alignment: 0 |
| | | spritePivot: {x: .5, y: .5} |
| | | spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
| | | spritePixelsToUnits: 100 |
| | | alphaIsTransparency: 1 |
| | | textureType: 8 |
| | | buildTargetSettings: |
| | | - buildTarget: iPhone |
| | | maxTextureSize: 1024 |
| | | textureFormat: -2 |
| | | compressionQuality: 50 |
| | | spriteSheet: |
| | | sprites: [] |
| | | spritePackingTag: |
| | | userData: |
New file |
| | |
| | | using UnityEditor; |
| | | using UnityEngine; |
| | | |
| | | namespace PigeonCoopToolkit.Utillities.Editor |
| | | { |
| | | [CustomPropertyDrawer(typeof(Range))] |
| | | public class RangePropertyDrawer : PropertyDrawer |
| | | { |
| | | public override void OnGUI(UnityEngine.Rect position, SerializedProperty property, UnityEngine.GUIContent label) |
| | | { |
| | | SerializedProperty Min = property.FindPropertyRelative("Min"); |
| | | SerializedProperty Max = property.FindPropertyRelative("Max"); |
| | | Vector2 newMinMax = Vector2.zero; |
| | | position.height = 16; |
| | | EditorGUI.LabelField(position, label); |
| | | position.y += 20; |
| | | position.width = position.width / 2; |
| | | newMinMax.x = EditorGUI.FloatField(position, "Min", Min.floatValue); |
| | | position.x += position.width; |
| | | newMinMax.y = EditorGUI.FloatField(position, "Max", Max.floatValue); |
| | | |
| | | if (newMinMax.x > newMinMax.y) |
| | | newMinMax.x = newMinMax.y; |
| | | |
| | | Min.floatValue = newMinMax.x; |
| | | Max.floatValue = newMinMax.y; |
| | | } |
| | | |
| | | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) |
| | | { |
| | | return base.GetPropertyHeight(property, label) + 20; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1eefccc24adb7c54a990dc0f9e669651 |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 9c8d55a9e91d98e4e925cd09f877adc5 |
| | | labels: |
| | | - BetterTrails |
| | | - TrailRenderer |
| | | - Smoke |
| | | - Trail |
| | | - Effects |
| | | - skidmarks |
| | | TextureImporter: |
| | | serializedVersion: 2 |
| | | mipmaps: |
| | | mipMapMode: 0 |
| | | enableMipMap: 0 |
| | | linearTexture: 0 |
| | | correctGamma: 0 |
| | | fadeOut: 0 |
| | | borderMipMap: 0 |
| | | mipMapFadeDistanceStart: 1 |
| | | mipMapFadeDistanceEnd: 3 |
| | | bumpmap: |
| | | convertToNormalMap: 0 |
| | | externalNormalMap: 0 |
| | | heightScale: .25 |
| | | normalMapFilter: 0 |
| | | isReadable: 0 |
| | | grayScaleToAlpha: 0 |
| | | generateCubemap: 0 |
| | | seamlessCubemap: 0 |
| | | textureFormat: -1 |
| | | maxTextureSize: 1024 |
| | | textureSettings: |
| | | filterMode: -1 |
| | | aniso: 1 |
| | | mipBias: -1 |
| | | wrapMode: 1 |
| | | nPOTScale: 0 |
| | | lightmap: 0 |
| | | compressionQuality: 50 |
| | | spriteMode: 1 |
| | | spriteExtrude: 1 |
| | | spriteMeshType: 1 |
| | | alignment: 0 |
| | | spritePivot: {x: .5, y: .5} |
| | | spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
| | | spritePixelsToUnits: 100 |
| | | alphaIsTransparency: 1 |
| | | textureType: 8 |
| | | buildTargetSettings: |
| | | - buildTarget: iPhone |
| | | maxTextureSize: 1024 |
| | | textureFormat: -2 |
| | | compressionQuality: 50 |
| | | spriteSheet: |
| | | sprites: [] |
| | | spritePackingTag: |
| | | userData: |
New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEditor; |
| | | using UnityEngine; |
| | | |
| | | |
| | | namespace PigeonCoopToolkit.Effects.Trails.Editor |
| | | { |
| | | [CustomEditor(typeof(SmokePlume))] |
| | | [CanEditMultipleObjects] |
| | | public class SmokePlumeEditor : TrailEditor_Base |
| | | { |
| | | protected override void DrawTrailSpecificGUI() |
| | | { |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("ConstantForce")); |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("RandomForceScale")); |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("TimeBetweenPoints")); |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("MaxNumberOfPoints")); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ddcb2ed96cba10e4da2cae8ff8533fda |
| | | labels: |
| | | - BetterTrails |
| | | - TrailRenderer |
| | | - Smoke |
| | | - Trail |
| | | - Effects |
| | | - skidmarks |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEditor; |
| | | using UnityEngine; |
| | | |
| | | |
| | | namespace PigeonCoopToolkit.Effects.Trails.Editor |
| | | { |
| | | [CustomEditor(typeof(SmokeTrail))] |
| | | [CanEditMultipleObjects] |
| | | public class SmokeTrailEditor : TrailEditor_Base |
| | | { |
| | | protected override void DrawTrailSpecificGUI() |
| | | { |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("RandomForceScale")); |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("MinVertexDistance")); |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("MaxNumberOfPoints")); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: bf32d2b00d1c88c4b91cf689b5f770c5 |
| | | labels: |
| | | - BetterTrails |
| | | - TrailRenderer |
| | | - Smoke |
| | | - Trail |
| | | - Effects |
| | | - skidmarks |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f99224b2104474d47b91284e88f8af87 |
| | | labels: |
| | | - BetterTrails |
| | | - TrailRenderer |
| | | - Smoke |
| | | - Trail |
| | | - Effects |
| | | - skidmarks |
| | | TextureImporter: |
| | | serializedVersion: 2 |
| | | mipmaps: |
| | | mipMapMode: 0 |
| | | enableMipMap: 0 |
| | | linearTexture: 0 |
| | | correctGamma: 0 |
| | | fadeOut: 0 |
| | | borderMipMap: 0 |
| | | mipMapFadeDistanceStart: 1 |
| | | mipMapFadeDistanceEnd: 3 |
| | | bumpmap: |
| | | convertToNormalMap: 0 |
| | | externalNormalMap: 0 |
| | | heightScale: .25 |
| | | normalMapFilter: 0 |
| | | isReadable: 0 |
| | | grayScaleToAlpha: 0 |
| | | generateCubemap: 0 |
| | | seamlessCubemap: 0 |
| | | textureFormat: -1 |
| | | maxTextureSize: 1024 |
| | | textureSettings: |
| | | filterMode: 0 |
| | | aniso: 1 |
| | | mipBias: -1 |
| | | wrapMode: 1 |
| | | nPOTScale: 0 |
| | | lightmap: 0 |
| | | compressionQuality: 50 |
| | | spriteMode: 1 |
| | | spriteExtrude: 1 |
| | | spriteMeshType: 1 |
| | | alignment: 0 |
| | | spritePivot: {x: .5, y: .5} |
| | | spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
| | | spritePixelsToUnits: 100 |
| | | alphaIsTransparency: 1 |
| | | textureType: 8 |
| | | buildTargetSettings: |
| | | - buildTarget: iPhone |
| | | maxTextureSize: 1024 |
| | | textureFormat: -2 |
| | | compressionQuality: 50 |
| | | spriteSheet: |
| | | sprites: [] |
| | | spritePackingTag: |
| | | userData: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 8d56c6f37ee95884baa3b4f7e4837399 |
| | | labels: |
| | | - BetterTrails |
| | | - TrailRenderer |
| | | - Smoke |
| | | - Trail |
| | | - Effects |
| | | - skidmarks |
| | | TextureImporter: |
| | | serializedVersion: 2 |
| | | mipmaps: |
| | | mipMapMode: 0 |
| | | enableMipMap: 0 |
| | | linearTexture: 0 |
| | | correctGamma: 0 |
| | | fadeOut: 0 |
| | | borderMipMap: 0 |
| | | mipMapFadeDistanceStart: 1 |
| | | mipMapFadeDistanceEnd: 3 |
| | | bumpmap: |
| | | convertToNormalMap: 0 |
| | | externalNormalMap: 0 |
| | | heightScale: .25 |
| | | normalMapFilter: 0 |
| | | isReadable: 0 |
| | | grayScaleToAlpha: 0 |
| | | generateCubemap: 0 |
| | | seamlessCubemap: 0 |
| | | textureFormat: -1 |
| | | maxTextureSize: 1024 |
| | | textureSettings: |
| | | filterMode: 0 |
| | | aniso: 1 |
| | | mipBias: -1 |
| | | wrapMode: 1 |
| | | nPOTScale: 0 |
| | | lightmap: 0 |
| | | compressionQuality: 50 |
| | | spriteMode: 1 |
| | | spriteExtrude: 1 |
| | | spriteMeshType: 1 |
| | | alignment: 0 |
| | | spritePivot: {x: .5, y: .5} |
| | | spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
| | | spritePixelsToUnits: 100 |
| | | alphaIsTransparency: 1 |
| | | textureType: 8 |
| | | buildTargetSettings: |
| | | - buildTarget: iPhone |
| | | maxTextureSize: 1024 |
| | | textureFormat: -2 |
| | | compressionQuality: 50 |
| | | spriteSheet: |
| | | sprites: [] |
| | | spritePackingTag: |
| | | userData: |
New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEditor; |
| | | using UnityEngine; |
| | | |
| | | |
| | | namespace PigeonCoopToolkit.Effects.Trails.Editor |
| | | { |
| | | [CustomEditor(typeof(SmoothTrail))] |
| | | [CanEditMultipleObjects] |
| | | public class SmoothTrailEditor : TrailEditor_Base |
| | | { |
| | | protected override void DrawTrailSpecificGUI() |
| | | { |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("MinControlPointDistance")); |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("MaxControlPoints")); |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("PointsBetweenControlPoints")); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 8d3c5575a1540ae4c8226a385921b799 |
| | | labels: |
| | | - BetterTrails |
| | | - TrailRenderer |
| | | - Smoke |
| | | - Trail |
| | | - Effects |
| | | - skidmarks |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEditor; |
| | | using UnityEngine; |
| | | |
| | | |
| | | namespace PigeonCoopToolkit.Effects.Trails.Editor |
| | | { |
| | | [CustomEditor(typeof(Trail))] |
| | | [CanEditMultipleObjects] |
| | | public class TrailEditor : TrailEditor_Base |
| | | { |
| | | protected override void DrawTrailSpecificGUI() |
| | | { |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("MinVertexDistance")); |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("MaxNumberOfPoints")); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: dba587684cc69dc4097b307d0bacf81d |
| | | labels: |
| | | - BetterTrails |
| | | - TrailRenderer |
| | | - Smoke |
| | | - Trail |
| | | - Effects |
| | | - skidmarks |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEditor; |
| | | using UnityEngine; |
| | | |
| | | |
| | | namespace PigeonCoopToolkit.Effects.Trails.Editor |
| | | { |
| | | |
| | | public class TrailEditor_Base : UnityEditor.Editor |
| | | { |
| | | |
| | | |
| | | public static TrailPreviewUtillity win; |
| | | |
| | | protected List<string> ExcludedDefaultPropties = new List<string>(); |
| | | |
| | | public override void OnInspectorGUI() |
| | | { |
| | | |
| | | TrailRenderer_Base t = (TrailRenderer_Base)serializedObject.targetObject; |
| | | if (t == null) |
| | | return; |
| | | |
| | | float defaultLabelWidth = EditorGUIUtility.labelWidth; |
| | | float defaultFieldWidth = EditorGUIUtility.fieldWidth; |
| | | GUILayout.Space(5); |
| | | |
| | | GUILayout.BeginVertical(); |
| | | |
| | | if (!ExcludedDefaultPropties.Contains("TrailData.Lifetime")) |
| | | { |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("TrailData.Lifetime")); |
| | | } |
| | | |
| | | EditorGUIUtility.labelWidth = defaultLabelWidth; |
| | | EditorGUIUtility.fieldWidth = defaultFieldWidth; |
| | | |
| | | |
| | | GUILayout.BeginHorizontal(); |
| | | EditorGUIUtility.fieldWidth = defaultLabelWidth - 80; |
| | | if (!ExcludedDefaultPropties.Contains("TrailData.TrailMaterial")) |
| | | { |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("TrailData.TrailMaterial")); |
| | | } |
| | | GUILayout.Space(10); |
| | | EditorGUIUtility.labelWidth = 30; |
| | | EditorGUIUtility.fieldWidth = 40; |
| | | if (!ExcludedDefaultPropties.Contains("TrailData.MaterialTileLength")) |
| | | { |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("TrailData.MaterialTileLength"), new GUIContent("Tile"), GUILayout.Width(70)); |
| | | } |
| | | GUILayout.EndHorizontal(); |
| | | |
| | | EditorGUIUtility.labelWidth = defaultLabelWidth; |
| | | EditorGUIUtility.fieldWidth = defaultFieldWidth; |
| | | |
| | | |
| | | GUILayout.BeginHorizontal(); |
| | | if (!ExcludedDefaultPropties.Contains("TrailData.SizeOverLife")) |
| | | { |
| | | if (t.TrailData.UsingSimpleSize) |
| | | { |
| | | EditorGUILayout.LabelField("Size Over Life", GUILayout.Width(defaultLabelWidth)); |
| | | serializedObject.FindProperty("TrailData.SimpleSizeOverLifeStart").floatValue = |
| | | EditorGUILayout.FloatField(serializedObject.FindProperty("TrailData.SimpleSizeOverLifeStart").floatValue); |
| | | serializedObject.FindProperty("TrailData.SimpleSizeOverLifeEnd").floatValue = |
| | | EditorGUILayout.FloatField(serializedObject.FindProperty("TrailData.SimpleSizeOverLifeEnd").floatValue); |
| | | |
| | | } |
| | | else |
| | | { |
| | | EditorGUIUtility.fieldWidth = defaultLabelWidth - 80; |
| | | |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("TrailData.SizeOverLife")); |
| | | } |
| | | |
| | | } |
| | | |
| | | GUILayout.Space(10); |
| | | EditorGUIUtility.labelWidth = 50; |
| | | EditorGUIUtility.fieldWidth = 20; |
| | | if (!ExcludedDefaultPropties.Contains("TrailData.StretchSizeToFit")) |
| | | { |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("TrailData.StretchSizeToFit"), new GUIContent("Stretch"), GUILayout.Width(70)); |
| | | } |
| | | GUILayout.EndHorizontal(); |
| | | |
| | | EditorGUIUtility.labelWidth = defaultLabelWidth; |
| | | EditorGUIUtility.fieldWidth = defaultFieldWidth; |
| | | |
| | | GUILayout.BeginHorizontal(); |
| | | EditorGUIUtility.fieldWidth = defaultLabelWidth - 80; |
| | | |
| | | if (!ExcludedDefaultPropties.Contains("TrailData.ColorOverLife")) |
| | | { |
| | | if (t.TrailData.UsingSimpleColor) |
| | | { |
| | | EditorGUIUtility.fieldWidth = (defaultFieldWidth - 80)/2f; |
| | | |
| | | EditorGUILayout.LabelField("Color Over Life", GUILayout.Width(defaultLabelWidth)); |
| | | serializedObject.FindProperty("TrailData.SimpleColorOverLifeStart").colorValue = |
| | | EditorGUILayout.ColorField(serializedObject.FindProperty("TrailData.SimpleColorOverLifeStart").colorValue); |
| | | serializedObject.FindProperty("TrailData.SimpleColorOverLifeEnd").colorValue = |
| | | EditorGUILayout.ColorField(serializedObject.FindProperty("TrailData.SimpleColorOverLifeEnd").colorValue); |
| | | |
| | | } |
| | | else |
| | | { |
| | | EditorGUIUtility.fieldWidth = defaultLabelWidth - 80; |
| | | |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("TrailData.ColorOverLife")); |
| | | } |
| | | |
| | | } |
| | | GUILayout.Space(10); |
| | | EditorGUIUtility.labelWidth = 50; |
| | | EditorGUIUtility.fieldWidth = 20; |
| | | if (!ExcludedDefaultPropties.Contains("TrailData.StretchColorToFit")) |
| | | { |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("TrailData.StretchColorToFit"), new GUIContent("Stretch"), GUILayout.Width(70)); |
| | | } |
| | | GUILayout.EndHorizontal(); |
| | | EditorGUIUtility.labelWidth = defaultLabelWidth; |
| | | EditorGUIUtility.fieldWidth = defaultFieldWidth; |
| | | |
| | | if (!ExcludedDefaultPropties.Contains("TrailData.UseForwardOverride")) |
| | | { |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("TrailData.UseForwardOverride")); |
| | | } |
| | | if (t.TrailData.UseForwardOverride) |
| | | { |
| | | EditorGUI.indentLevel++; |
| | | |
| | | if (!ExcludedDefaultPropties.Contains("TrailData.ForwardOverride")) |
| | | { |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("TrailData.ForwardOverride")); |
| | | } |
| | | |
| | | if (!ExcludedDefaultPropties.Contains("TrailData.ForwardOverrideRelative")) |
| | | { |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("TrailData.ForwardOverrideRelative"), new GUIContent("Override Relative")); |
| | | } |
| | | |
| | | EditorGUI.indentLevel--; |
| | | } |
| | | |
| | | |
| | | DrawTrailSpecificGUI(); |
| | | |
| | | if (!ExcludedDefaultPropties.Contains("Emit")) |
| | | { |
| | | EditorGUILayout.PropertyField(serializedObject.FindProperty("Emit")); |
| | | } |
| | | |
| | | GUILayout.EndVertical(); |
| | | |
| | | |
| | | |
| | | |
| | | serializedObject.ApplyModifiedProperties(); |
| | | serializedObject.UpdateIfDirtyOrScript(); |
| | | |
| | | |
| | | GUILayout.Space(5); |
| | | if (GUILayout.Button("Open preview")) |
| | | { |
| | | // Get existing open window or if none, make a new one: |
| | | win = (TrailPreviewUtillity)EditorWindow.GetWindow(typeof(TrailPreviewUtillity), true, "Normalized Trail Preview"); |
| | | win.minSize = new Vector2(900, 140); |
| | | win.maxSize = new Vector2(900, 140); |
| | | win.Trail = t; |
| | | } |
| | | |
| | | } |
| | | |
| | | protected virtual void DrawTrailSpecificGUI() |
| | | {} |
| | | } |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0ab5f16befc58ca4bbfb8159ae3ead06 |
| | | labels: |
| | | - BetterTrails |
| | | - TrailRenderer |
| | | - Smoke |
| | | - Trail |
| | | - Effects |
| | | - skidmarks |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 888165c9c85ad6b429824b89f1f4f698 |
| | | labels: |
| | | - BetterTrails |
| | | - TrailRenderer |
| | | - Smoke |
| | | - Trail |
| | | - Effects |
| | | - skidmarks |
| | | TextureImporter: |
| | | serializedVersion: 2 |
| | | mipmaps: |
| | | mipMapMode: 0 |
| | | enableMipMap: 0 |
| | | linearTexture: 0 |
| | | correctGamma: 0 |
| | | fadeOut: 0 |
| | | borderMipMap: 0 |
| | | mipMapFadeDistanceStart: 1 |
| | | mipMapFadeDistanceEnd: 3 |
| | | bumpmap: |
| | | convertToNormalMap: 0 |
| | | externalNormalMap: 0 |
| | | heightScale: .25 |
| | | normalMapFilter: 0 |
| | | isReadable: 0 |
| | | grayScaleToAlpha: 0 |
| | | generateCubemap: 0 |
| | | seamlessCubemap: 0 |
| | | textureFormat: -1 |
| | | maxTextureSize: 1024 |
| | | textureSettings: |
| | | filterMode: 0 |
| | | aniso: 1 |
| | | mipBias: -1 |
| | | wrapMode: 1 |
| | | nPOTScale: 0 |
| | | lightmap: 0 |
| | | compressionQuality: 50 |
| | | spriteMode: 1 |
| | | spriteExtrude: 1 |
| | | spriteMeshType: 1 |
| | | alignment: 0 |
| | | spritePivot: {x: .5, y: .5} |
| | | spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
| | | spritePixelsToUnits: 100 |
| | | alphaIsTransparency: 1 |
| | | textureType: 8 |
| | | buildTargetSettings: |
| | | - buildTarget: iPhone |
| | | maxTextureSize: 1024 |
| | | textureFormat: -2 |
| | | compressionQuality: 50 |
| | | spriteSheet: |
| | | sprites: [] |
| | | spritePackingTag: |
| | | userData: |
New file |
| | |
| | | using UnityEngine; |
| | | using UnityEditor; |
| | | |
| | | namespace PigeonCoopToolkit.Effects.Trails.Editor |
| | | { |
| | | public class TrailPreviewUtillity : EditorWindow |
| | | { |
| | | public TrailRenderer_Base Trail; |
| | | |
| | | void Update() |
| | | { |
| | | if (Trail == null || Trail.TrailData == null || Selection.activeGameObject != Trail.gameObject) |
| | | { |
| | | Close(); |
| | | return; |
| | | } |
| | | |
| | | Repaint(); |
| | | } |
| | | |
| | | void OnGUI() |
| | | { |
| | | if (Trail == null || Trail.TrailData == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | |
| | | |
| | | GUIStyle blackBG = new GUIStyle(); |
| | | blackBG.normal.background = EditorGUIUtility.whiteTexture; |
| | | blackBG.normal.textColor = Color.white; |
| | | Color revertTo = GUI.color; |
| | | |
| | | |
| | | |
| | | float highPoint = 0; |
| | | |
| | | for (int i = 0; i < 100; i++) |
| | | { |
| | | float s = (Trail.TrailData.UsingSimpleSize ? Mathf.Lerp(Trail.TrailData.SimpleSizeOverLifeStart, Trail.TrailData.SimpleSizeOverLifeEnd, (float)i / (float)100) : Trail.TrailData.SizeOverLife.Evaluate((float)i / (float)100)); |
| | | |
| | | |
| | | |
| | | if (highPoint < s) |
| | | highPoint = s; |
| | | } |
| | | |
| | | GUI.color = new Color(0.3f,0.3f,0.3f,1); |
| | | GUILayout.BeginArea(new Rect(0, 0, position.width, position.height), blackBG); |
| | | |
| | | |
| | | float xPos = 0; |
| | | float increment = 101; |
| | | float modulo = 303; |
| | | |
| | | while (xPos * increment < position.width) |
| | | { |
| | | xPos++; |
| | | DrawLine(Vector2.right * (xPos * increment), Vector2.right * (xPos * increment) + Vector2.up * position.height, xPos * increment % modulo == 0 ? new Color(1, 1, 1, 0.1f) : new Color(1, 1, 1, 0.025f), 1); |
| | | } |
| | | |
| | | DrawLine(Vector2.up * position.height / 2, Vector2.right * position.width + Vector2.up * position.height / 2, new Color(1, 1, 1, 0.1f), 1); |
| | | |
| | | |
| | | GL.PushMatrix(); |
| | | GL.LoadPixelMatrix(-0.5f, 0.5f, 0.5f, -0.5f); |
| | | if (Trail.TrailData.TrailMaterial != null) |
| | | Trail.TrailData.TrailMaterial.SetPass(0); |
| | | |
| | | GL.Begin(GL.TRIANGLE_STRIP); |
| | | |
| | | InsertTriangle(0, 1); |
| | | |
| | | for (int i = 0; i < 100; i++) |
| | | { |
| | | InsertTriangle((float)i / (float)100, highPoint * 2); |
| | | } |
| | | |
| | | GL.End(); |
| | | GL.PopMatrix(); |
| | | |
| | | GUILayout.EndArea(); |
| | | |
| | | if (Trail.TrailData.TrailMaterial == null) |
| | | { |
| | | GUILayout.BeginVertical(); |
| | | GUILayout.BeginHorizontal(); |
| | | GUILayout.FlexibleSpace(); |
| | | GUI.color = new Color(0, 0, 0, 0.15f); |
| | | |
| | | GUILayout.BeginVertical(); |
| | | |
| | | GUILayout.FlexibleSpace(); |
| | | |
| | | GUILayout.BeginVertical(blackBG); |
| | | GUI.color = Color.white; |
| | | GUILayout.Label("Material is NULL", EditorStyles.whiteMiniLabel); |
| | | GUILayout.EndVertical(); |
| | | GUILayout.FlexibleSpace(); |
| | | GUILayout.EndVertical(); |
| | | |
| | | GUILayout.FlexibleSpace(); |
| | | |
| | | GUILayout.EndHorizontal(); |
| | | GUILayout.EndVertical(); |
| | | |
| | | } |
| | | else |
| | | { |
| | | GUILayout.BeginVertical(); |
| | | GUILayout.FlexibleSpace(); |
| | | GUILayout.BeginHorizontal(); |
| | | GUI.color = new Color(0, 0, 0, 0.15f); |
| | | GUILayout.BeginVertical(blackBG); |
| | | GUI.color = Color.white; |
| | | GUILayout.Label("Start", EditorStyles.whiteMiniLabel); |
| | | GUILayout.EndVertical(); |
| | | GUILayout.FlexibleSpace(); |
| | | |
| | | GUI.color = new Color(0, 0, 0, 0.15f); |
| | | GUILayout.BeginVertical(blackBG); |
| | | GUI.color = Color.white; |
| | | GUILayout.Label("End", EditorStyles.whiteMiniLabel); |
| | | GUILayout.EndVertical(); |
| | | |
| | | GUILayout.EndHorizontal(); |
| | | GUILayout.EndVertical(); |
| | | } |
| | | |
| | | GUI.color = revertTo; |
| | | |
| | | |
| | | } |
| | | |
| | | void InsertTriangle(float t, float scaler) |
| | | { |
| | | if(scaler <= 0) |
| | | return; |
| | | |
| | | Color c = (Trail.TrailData.UsingSimpleColor ? |
| | | Color.Lerp(Trail.TrailData.SimpleColorOverLifeStart, Trail.TrailData.SimpleColorOverLifeEnd, t) : |
| | | Trail.TrailData.ColorOverLife.Evaluate(t)); |
| | | |
| | | float s = (Trail.TrailData.UsingSimpleSize ? Mathf.Lerp(Trail.TrailData.SimpleSizeOverLifeStart, Trail.TrailData.SimpleSizeOverLifeEnd, t) : Trail.TrailData.SizeOverLife.Evaluate(t)) / (scaler); |
| | | |
| | | GL.Color(c); |
| | | GL.Vertex3(t, 0.5f + s, 0); |
| | | GL.MultiTexCoord(0, Trail.TrailData.MaterialTileLength > 0 ? new Vector3((t * position.width) / (300 * Trail.TrailData.MaterialTileLength), 0, 0) : new Vector3(t, 0, 0)); |
| | | GL.Vertex3(t, 0.5f - s, 0); |
| | | GL.MultiTexCoord(0, Trail.TrailData.MaterialTileLength > 0 ? new Vector3((t * position.width) / (300 * Trail.TrailData.MaterialTileLength), 1, 0) : new Vector3(t, 1, 0)); |
| | | } |
| | | |
| | | public static void DrawLine(Vector2 start, Vector2 end, Color color, float width) |
| | | { |
| | | if (Event.current == null) |
| | | return; |
| | | if (Event.current.type != EventType.repaint) |
| | | return; |
| | | |
| | | CreateMaterial(); |
| | | |
| | | lineMaterial.SetPass(0); |
| | | |
| | | Vector3 startPt; |
| | | Vector3 endPt; |
| | | |
| | | if (width == 1) |
| | | { |
| | | GL.Begin(GL.LINES); |
| | | GL.Color(color); |
| | | startPt = new Vector3(start.x, start.y, 0); |
| | | endPt = new Vector3(end.x, end.y, 0); |
| | | GL.Vertex(startPt); |
| | | GL.Vertex(endPt); |
| | | } |
| | | else |
| | | { |
| | | GL.Begin(GL.QUADS); |
| | | GL.Color(color); |
| | | startPt = new Vector3(end.y, start.x, 0); |
| | | endPt = new Vector3(start.y, end.x, 0); |
| | | Vector3 perpendicular = (startPt - endPt).normalized * width; |
| | | Vector3 v1 = new Vector3(start.x, start.y, 0); |
| | | Vector3 v2 = new Vector3(end.x, end.y, 0); |
| | | GL.Vertex(v1 - perpendicular); |
| | | GL.Vertex(v1 + perpendicular); |
| | | GL.Vertex(v2 + perpendicular); |
| | | GL.Vertex(v2 - perpendicular); |
| | | } |
| | | GL.End(); |
| | | } |
| | | |
| | | public static void CreateMaterial() |
| | | { |
| | | if (lineMaterial != null) |
| | | return; |
| | | |
| | | lineMaterial = new Material(Shader.Find("Particles/Alpha Blended")); |
| | | lineMaterial.hideFlags = HideFlags.HideAndDontSave; |
| | | lineMaterial.shader.hideFlags = HideFlags.HideAndDontSave; |
| | | } |
| | | |
| | | public static Material lineMaterial = null; |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | /* |
| | | using UnityEngine; |
| | | using UnityEditor; |
| | | |
| | | namespace PigeonCoopToolkit.Effects.Trails.Editor |
| | | { |
| | | public class TrailPreviewUtillity : EditorWindow |
| | | { |
| | | |
| | | public PCTrailRendererData Data; |
| | | |
| | | void OnGUI() |
| | | { |
| | | if(Data == null) |
| | | { |
| | | Close(); |
| | | return; |
| | | } |
| | | |
| | | DrawLine(Vector2.zero, Vector2.right + Vector2.up,Color.red,1,Data.TrailMaterial); |
| | | |
| | | } |
| | | |
| | | public static void DrawLine(Vector2 start, Vector2 end, Color color, float width, Material m) |
| | | { |
| | | if (Event.current == null) |
| | | return; |
| | | if (Event.current.type != EventType.repaint) |
| | | return; |
| | | |
| | | |
| | | |
| | | m.SetPass(0); |
| | | |
| | | Vector3 startPt; |
| | | Vector3 endPt; |
| | | |
| | | if (width == 1) |
| | | { |
| | | GL.Begin(GL.LINES); |
| | | GL.Color(color); |
| | | startPt = new Vector3(start.x, start.y, 0); |
| | | endPt = new Vector3(end.x, end.y, 0); |
| | | GL.Vertex(startPt); |
| | | GL.Vertex(endPt); |
| | | } |
| | | else |
| | | { |
| | | GL.Begin(GL.QUADS); |
| | | GL.Color(color); |
| | | startPt = new Vector3(end.y, start.x, 0); |
| | | endPt = new Vector3(start.y, end.x, 0); |
| | | Vector3 perpendicular = (startPt - endPt).normalized * width; |
| | | Vector3 v1 = new Vector3(start.x, start.y, 0); |
| | | Vector3 v2 = new Vector3(end.x, end.y, 0); |
| | | GL.Vertex(v1 - perpendicular); |
| | | GL.Vertex(v1 + perpendicular); |
| | | GL.Vertex(v2 + perpendicular); |
| | | GL.Vertex(v2 - perpendicular); |
| | | } |
| | | GL.End(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | */ |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 34af64ac36cf82046853c1e9e5421c3b |
| | | labels: |
| | | - BetterTrails |
| | | - TrailRenderer |
| | | - Smoke |
| | | - Trail |
| | | - Effects |
| | | - skidmarks |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |