diff --git a/Assets/Editor.meta b/Assets/Editor.meta deleted file mode 100644 index 9c21977..0000000 --- a/Assets/Editor.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 710e084e33216854daedf076c029ff31 -folderAsset: yes -timeCreated: 1501225949 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scenes.meta b/Assets/Scenes.meta deleted file mode 100644 index b845635..0000000 --- a/Assets/Scenes.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: e902c8c0b4e7a0d4d8453c55863a7532 -folderAsset: yes -timeCreated: 1501219179 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scenes/Test.unity b/Assets/Scenes/Test.unity deleted file mode 100644 index 97d6285..0000000 --- a/Assets/Scenes/Test.unity +++ /dev/null @@ -1,360 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!29 &1 -OcclusionCullingSettings: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_OcclusionBakeSettings: - smallestOccluder: 5 - smallestHole: 0.25 - backfaceThreshold: 100 - m_SceneGUID: 00000000000000000000000000000000 - m_OcclusionCullingData: {fileID: 0} ---- !u!104 &2 -RenderSettings: - m_ObjectHideFlags: 0 - serializedVersion: 8 - m_Fog: 0 - m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} - m_FogMode: 3 - m_FogDensity: 0.01 - m_LinearFogStart: 0 - m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} - m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} - m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} - m_AmbientIntensity: 1 - m_AmbientMode: 0 - m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} - m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} - m_HaloStrength: 0.5 - m_FlareStrength: 1 - m_FlareFadeSpeed: 3 - m_HaloTexture: {fileID: 0} - m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} - m_DefaultReflectionMode: 0 - m_DefaultReflectionResolution: 128 - m_ReflectionBounces: 1 - m_ReflectionIntensity: 1 - m_CustomReflection: {fileID: 0} - m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657844, g: 0.49641222, b: 0.57481694, a: 1} ---- !u!157 &3 -LightmapSettings: - m_ObjectHideFlags: 0 - serializedVersion: 11 - m_GIWorkflowMode: 0 - m_GISettings: - serializedVersion: 2 - m_BounceScale: 1 - m_IndirectOutputScale: 1 - m_AlbedoBoost: 1 - m_TemporalCoherenceThreshold: 1 - m_EnvironmentLightingMode: 0 - m_EnableBakedLightmaps: 1 - m_EnableRealtimeLightmaps: 1 - m_LightmapEditorSettings: - serializedVersion: 9 - m_Resolution: 2 - m_BakeResolution: 40 - m_TextureWidth: 1024 - m_TextureHeight: 1024 - m_AO: 0 - m_AOMaxDistance: 1 - m_CompAOExponent: 1 - m_CompAOExponentDirect: 0 - m_Padding: 2 - m_LightmapParameters: {fileID: 0} - m_LightmapsBakeMode: 1 - m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherFiltering: 1 - m_FinalGatherRayCount: 256 - m_ReflectionCompression: 2 - m_MixedBakeMode: 2 - m_BakeBackend: 0 - m_PVRSampling: 1 - m_PVRDirectSampleCount: 32 - m_PVRSampleCount: 500 - m_PVRBounces: 2 - m_PVRFiltering: 0 - m_PVRFilteringMode: 1 - m_PVRCulling: 1 - m_PVRFilteringGaussRadiusDirect: 1 - m_PVRFilteringGaussRadiusIndirect: 5 - m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousColorSigma: 1 - m_PVRFilteringAtrousNormalSigma: 1 - m_PVRFilteringAtrousPositionSigma: 1 - m_LightingDataAsset: {fileID: 0} - m_UseShadowmask: 1 ---- !u!196 &4 -NavMeshSettings: - serializedVersion: 2 - m_ObjectHideFlags: 0 - m_BuildSettings: - serializedVersion: 2 - agentTypeID: 0 - agentRadius: 0.5 - agentHeight: 2 - agentSlope: 45 - agentClimb: 0.4 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - minRegionArea: 2 - manualCellSize: 0 - cellSize: 0.16666667 - manualTileSize: 0 - tileSize: 256 - accuratePlacement: 0 - m_NavMeshData: {fileID: 0} ---- !u!1 &690944966 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 690944968} - - component: {fileID: 690944967} - m_Layer: 0 - m_Name: Directional Light - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!108 &690944967 -Light: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 690944966} - m_Enabled: 1 - serializedVersion: 8 - m_Type: 1 - m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} - m_Intensity: 1 - m_Range: 10 - m_SpotAngle: 30 - m_CookieSize: 10 - m_Shadows: - m_Type: 2 - m_Resolution: -1 - m_CustomResolution: -1 - m_Strength: 1 - m_Bias: 0.05 - m_NormalBias: 0.4 - m_NearPlane: 0.2 - m_Cookie: {fileID: 0} - m_DrawHalo: 0 - m_Flare: {fileID: 0} - m_RenderMode: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_Lightmapping: 4 - m_AreaSize: {x: 1, y: 1} - m_BounceIntensity: 1 - m_FalloffTable: - m_Table[0]: 0 - m_Table[1]: 0 - m_Table[2]: 0 - m_Table[3]: 0 - m_Table[4]: 0 - m_Table[5]: 0 - m_Table[6]: 0 - m_Table[7]: 0 - m_Table[8]: 0 - m_Table[9]: 0 - m_Table[10]: 0 - m_Table[11]: 0 - m_Table[12]: 0 - m_ColorTemperature: 6570 - m_UseColorTemperature: 0 - m_ShadowRadius: 0 - m_ShadowAngle: 0 ---- !u!4 &690944968 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 690944966} - m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} - m_LocalPosition: {x: 0, y: 3, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!1 &1759122305 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 1759122310} - - component: {fileID: 1759122309} - - component: {fileID: 1759122308} - - component: {fileID: 1759122307} - - component: {fileID: 1759122306} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!81 &1759122306 -AudioListener: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1759122305} - m_Enabled: 1 ---- !u!124 &1759122307 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1759122305} - m_Enabled: 1 ---- !u!92 &1759122308 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1759122305} - m_Enabled: 1 ---- !u!20 &1759122309 -Camera: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1759122305} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 1 - orthographic size: 5 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 - m_StereoMirrorMode: 0 ---- !u!4 &1759122310 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1759122305} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1786072496 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 1786072500} - - component: {fileID: 1786072499} - - component: {fileID: 1786072498} - - component: {fileID: 1786072497} - m_Layer: 0 - m_Name: Cube - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!23 &1786072497 -MeshRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1786072496} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: f2042e1062153334ea0a77924a7327a4, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 1 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!65 &1786072498 -BoxCollider: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1786072496} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!33 &1786072499 -MeshFilter: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1786072496} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!4 &1786072500 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1786072496} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -2.3581216, y: -2.0539248, z: -16.652042} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Scenes/Test.unity.meta b/Assets/Scenes/Test.unity.meta deleted file mode 100644 index adbeacb..0000000 --- a/Assets/Scenes/Test.unity.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 448f40325f90d0840b15d33f2c2d8da5 -timeCreated: 1501219189 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts.meta b/Assets/Scripts.meta deleted file mode 100644 index 8cb9588..0000000 --- a/Assets/Scripts.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: e402e02f02482eb4a8a4a1c3ad2f3565 -folderAsset: yes -timeCreated: 1500793393 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/2D.meta b/Assets/Scripts/2D.meta deleted file mode 100644 index ad07dfb..0000000 --- a/Assets/Scripts/2D.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: a566d1d4c62efcb43b5fb1005352c895 -folderAsset: yes -timeCreated: 1500793395 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/2D/Camera.meta b/Assets/Scripts/2D/Camera.meta deleted file mode 100644 index ee881f2..0000000 --- a/Assets/Scripts/2D/Camera.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: f5f321f774e078d4c8d3de6e73e8d3ea -folderAsset: yes -timeCreated: 1500793397 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/2D/Camera/PixelPerfectCamera.cs b/Assets/Scripts/2D/Camera/PixelPerfectCamera.cs deleted file mode 100644 index 8736ef1..0000000 --- a/Assets/Scripts/2D/Camera/PixelPerfectCamera.cs +++ /dev/null @@ -1,39 +0,0 @@ -// pixel perfect camera helpers, from old unity 2D tutorial videos -// source: https://www.youtube.com/watch?v=rMCLWt1DuqI - -using UnityEngine; - -namespace UnityLibrary -{ - [ExecuteInEditMode] - public class PixelPerfectCamera : MonoBehaviour - { - public float pixelsToUnits = 100; - Camera cam; - - void Start() - { - cam = GetComponent(); - if (cam == null) - { - Debug.LogError("Camera not found..", gameObject); - this.enabled = false; - return; - } - SetScale(); - } - - // in editor need to update in a loop, in case of game window resizes -#if UNITY_EDITOR - void Update() - { - SetScale(); - } -#endif - - void SetScale() - { - cam.orthographicSize = Screen.height / pixelsToUnits / 2; - } - } -} diff --git a/Assets/Scripts/2D/Camera/PixelPerfectCamera.cs.meta b/Assets/Scripts/2D/Camera/PixelPerfectCamera.cs.meta deleted file mode 100644 index 11230f2..0000000 --- a/Assets/Scripts/2D/Camera/PixelPerfectCamera.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 230ad41a455ffc84982860a8ce356020 -timeCreated: 1500793401 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/2D/Camera/ScaleCamera.cs b/Assets/Scripts/2D/Camera/ScaleCamera.cs deleted file mode 100644 index 5330cea..0000000 --- a/Assets/Scripts/2D/Camera/ScaleCamera.cs +++ /dev/null @@ -1,43 +0,0 @@ -// pixel perfect camera helpers, from old unity 2D tutorial videos -// source: https://www.youtube.com/watch?v=rMCLWt1DuqI - -using UnityEngine; - -namespace UnityLibrary -{ - [ExecuteInEditMode] - public class ScaleCamera : MonoBehaviour - { - public int targetWidth = 640; - public float pixelsToUnits = 100; - - Camera cam; - - void Start() - { - cam = GetComponent(); - if (cam == null) - { - Debug.LogError("Camera not found..", gameObject); - this.enabled = false; - return; - } - - SetScale(); - } - - // in editor need to update in a loop, in case of game window resizes -#if UNITY_EDITOR - void Update() - { - SetScale(); - } -#endif - - void SetScale() - { - int height = Mathf.RoundToInt(targetWidth / (float)Screen.width * Screen.height); - cam.orthographicSize = height / pixelsToUnits / 2; - } - } -} diff --git a/Assets/Scripts/2D/Camera/ScaleCamera.cs.meta b/Assets/Scripts/2D/Camera/ScaleCamera.cs.meta deleted file mode 100644 index 99882a2..0000000 --- a/Assets/Scripts/2D/Camera/ScaleCamera.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: eb79c0c2e7e8b814497e3fed8bad9dbd -timeCreated: 1500793404 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/2D/Colliders.meta b/Assets/Scripts/2D/Colliders.meta deleted file mode 100644 index fedd8ba..0000000 --- a/Assets/Scripts/2D/Colliders.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: aabfa300fc2aee04ab2c0f4e1d33d8f8 -folderAsset: yes -timeCreated: 1500793397 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/2D/Colliders/ScreenEdgeColliders.cs b/Assets/Scripts/2D/Colliders/ScreenEdgeColliders.cs deleted file mode 100644 index bf94311..0000000 --- a/Assets/Scripts/2D/Colliders/ScreenEdgeColliders.cs +++ /dev/null @@ -1,35 +0,0 @@ -// adds EdgeCollider2D colliders to screen edges -// only works with orthographic camera - -using UnityEngine; -using System.Collections; - -namespace UnityLibrary -{ - public class ScreenEdgeColliders : MonoBehaviour - { - void Awake () - { - AddCollider(); - } - - void AddCollider () - { - if (Camera.main==null) {Debug.LogError("Camera.main not found, failed to create edge colliders"); return;} - - var cam = Camera.main; - if (!cam.orthographic) {Debug.LogError("Camera.main is not Orthographic, failed to create edge colliders"); return;} - - var bottomLeft = (Vector2)cam.ScreenToWorldPoint(new Vector3(0, 0, cam.nearClipPlane)); - var topLeft = (Vector2)cam.ScreenToWorldPoint(new Vector3(0, cam.pixelHeight, cam.nearClipPlane)); - var topRight = (Vector2)cam.ScreenToWorldPoint(new Vector3(cam.pixelWidth, cam.pixelHeight, cam.nearClipPlane)); - var bottomRight = (Vector2)cam.ScreenToWorldPoint(new Vector3(cam.pixelWidth, 0, cam.nearClipPlane)); - - // add or use existing EdgeCollider2D - var edge = GetComponent()==null?gameObject.AddComponent():GetComponent(); - - var edgePoints = new [] {bottomLeft,topLeft,topRight,bottomRight, bottomLeft}; - edge.points = edgePoints; - } - } -} diff --git a/Assets/Scripts/2D/Colliders/ScreenEdgeColliders.cs.meta b/Assets/Scripts/2D/Colliders/ScreenEdgeColliders.cs.meta deleted file mode 100644 index 4c59b67..0000000 --- a/Assets/Scripts/2D/Colliders/ScreenEdgeColliders.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 13a829f568060b1429e093c51a02d8d1 -timeCreated: 1500793400 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/2D/Drawing.meta b/Assets/Scripts/2D/Drawing.meta deleted file mode 100644 index 17ebebb..0000000 --- a/Assets/Scripts/2D/Drawing.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 9acbf89372e16b448a5fbda547b9e83d -folderAsset: yes -timeCreated: 1501390147 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/2D/Drawing/DrawLine2D.cs b/Assets/Scripts/2D/Drawing/DrawLine2D.cs deleted file mode 100644 index b5fb834..0000000 --- a/Assets/Scripts/2D/Drawing/DrawLine2D.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -namespace UnityLibrary -{ - public class DrawLine2D : MonoBehaviour - { - - [SerializeField] - protected LineRenderer m_LineRenderer; - [SerializeField] - protected bool m_AddCollider = false; - [SerializeField] - protected EdgeCollider2D m_EdgeCollider2D; - protected List m_Points; - - public virtual LineRenderer lineRenderer { - get { - return m_LineRenderer; - } - } - - public virtual bool addCollider { - get { - return m_AddCollider; - } - } - - public virtual EdgeCollider2D edgeCollider2D { - get { - return m_EdgeCollider2D; - } - } - - public virtual List points { - get { - return m_Points; - } - } - - protected virtual void Awake() - { - if (m_LineRenderer == null) - { - Debug.LogWarning("DrawLine: Line Renderer not assigned, Adding and Using default Line Renderer."); - CreateDefaultLineRenderer(); - } - if (m_EdgeCollider2D == null && m_AddCollider) - { - Debug.LogWarning("DrawLine: Edge Collider 2D not assigned, Adding and Using default Edge Collider 2D."); - CreateDefaultEdgeCollider2D(); - } - m_Points = new List(); - } - - protected virtual void Update() - { - if (Input.GetMouseButtonDown(0)) - { - Reset(); - } - if (Input.GetMouseButton(0)) - { - Vector2 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition); - if (!m_Points.Contains(mousePosition)) - { - m_Points.Add(mousePosition); - m_LineRenderer.positionCount = m_Points.Count; - m_LineRenderer.SetPosition(m_LineRenderer.positionCount - 1, mousePosition); - if (m_EdgeCollider2D != null && m_AddCollider && m_Points.Count > 1) - { - m_EdgeCollider2D.points = m_Points.ToArray(); - } - } - } - } - - protected virtual void Reset() - { - if (m_LineRenderer != null) - { - m_LineRenderer.positionCount = 0; - } - if (m_Points != null) - { - m_Points.Clear(); - } - if (m_EdgeCollider2D != null && m_AddCollider) - { - m_EdgeCollider2D.Reset(); - } - } - - protected virtual void CreateDefaultLineRenderer() - { - m_LineRenderer = gameObject.AddComponent(); - m_LineRenderer.positionCount = 0; - m_LineRenderer.material = new Material(Shader.Find("Particles/Additive")); - m_LineRenderer.startColor = Color.white; - m_LineRenderer.endColor = Color.white; - m_LineRenderer.startWidth = 0.2f; - m_LineRenderer.endWidth = 0.2f; - m_LineRenderer.useWorldSpace = true; - } - - protected virtual void CreateDefaultEdgeCollider2D() - { - m_EdgeCollider2D = gameObject.AddComponent(); - } - - } -} \ No newline at end of file diff --git a/Assets/Scripts/2D/Drawing/DrawLine2D.cs.meta b/Assets/Scripts/2D/Drawing/DrawLine2D.cs.meta deleted file mode 100644 index 83b676e..0000000 --- a/Assets/Scripts/2D/Drawing/DrawLine2D.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: ac0fbbea8fa72e74e9a6e8fcb8d1c6ae -timeCreated: 1501390147 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/2D/Follow2D.cs b/Assets/Scripts/2D/Follow2D.cs deleted file mode 100644 index 7cc16dd..0000000 --- a/Assets/Scripts/2D/Follow2D.cs +++ /dev/null @@ -1,141 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - - -/// -/// Follows a GameObject in a Smooth way and with various settings -/// Author: Manuel Otheo (@Lootheo) with guidance from Hasan Bayat (EmpireWorld) -/// -/// https://www.reddit.com/r/Unity3D/comments/6iskah/movetowards_vs_lerp_vs_slerp_vs_smoothdamp/ -/// How to use: Attach it to a GameObject and then assign the target to follow and the variables like offset and speed -/// If it's not moving check the speed -/// -/// TODO: Make more efficient usage of the vector3 to vector2; -/// -/// -namespace UnityLibrary -{ - public class Follow2D : MonoBehaviour - { - - public enum FollowType - { - MoveTowards, - Lerp, - Slerp, - SmoothDamp, - Acceleration - } - - #region Fields - - public Transform target; - public FollowType followType = FollowType.MoveTowards; - public Vector2 speed; - public Vector2 time; - public Vector2 acceleration; - public Vector2 offset; - public bool bounds; - public Vector2 lowerBounds; - public Vector2 higherBounds; - #endregion - - #region Variables - - protected Vector2 velocity; - protected Vector2 step; - private Vector2 localSpeed; - - #endregion - - #region MonoBehaviour Messages - - protected virtual void Update() - { - - // Exit if the target object not specified - if (target == null) - { - return; - } - - switch (followType) - { - case FollowType.MoveTowards: - MoveTowards(); - break; - case FollowType.Lerp: - Lerp(); - break; - case FollowType.Slerp: - Slerp(); - break; - case FollowType.SmoothDamp: - SmoothDamp(); - break; - case FollowType.Acceleration: - Acceleration(); - break; - } - - if (bounds) - { - CheckForBounds(); - } - } - - #endregion - - #region Methods - - protected virtual void MoveTowards() - { - step = speed * Time.deltaTime; - transform.position = new Vector2(Vector2.MoveTowards(transform.position, (Vector2)target.position + offset, step.x).x, Vector2.MoveTowards(transform.position, (Vector2)target.position + offset, step.x).y); - } - - protected virtual void Lerp() - { - float posX = Mathf.Lerp(transform.position.x, target.position.x + offset.x, time.x * Time.fixedDeltaTime); - float posY = Mathf.Lerp(transform.position.y, target.position.y + offset.y, time.y * Time.fixedDeltaTime); - transform.position = new Vector3(posX, posY, transform.position.z); - } - - protected virtual void Slerp() - { - float posX = Vector3.Slerp(transform.position, (Vector3)((Vector2)target.position + offset), time.x * Time.fixedDeltaTime).x; - float posY = Vector3.Slerp(transform.position, (Vector3)((Vector2)target.position + offset), time.y * Time.fixedDeltaTime).y; - transform.position = new Vector3(posX, posY, transform.position.z); - } - - protected virtual void SmoothDamp() - { - Vector2 position; - - position.x = Mathf.SmoothDamp(transform.position.x, target.position.x + offset.x, ref velocity.x, time.x); - position.y = Mathf.SmoothDamp(transform.position.y, target.position.y + offset.y, ref velocity.y, time.y); - - transform.position = new Vector3(position.x, position.y, transform.position.z); - } - protected virtual void Acceleration() - { - if (Vector2.Distance(transform.position, (Vector2)target.position + offset) == 0) - localSpeed = Vector2.zero; - else - { - localSpeed = localSpeed + acceleration * Time.deltaTime; - step = localSpeed * Time.deltaTime; - transform.position = new Vector2(Vector2.MoveTowards(transform.position, (Vector2)target.position + offset, step.x).x, Vector2.MoveTowards(transform.position, (Vector2)target.position + offset, step.x).y); - } - } - - protected virtual void CheckForBounds() - { - transform.position = new Vector3(Mathf.Clamp(transform.position.x, lowerBounds.x, higherBounds.x), Mathf.Clamp(transform.position.y, lowerBounds.y, higherBounds.y), transform.position.z); - } - - #endregion - - } -} diff --git a/Assets/Scripts/2D/Follow2D.cs.meta b/Assets/Scripts/2D/Follow2D.cs.meta deleted file mode 100644 index 2d338b3..0000000 --- a/Assets/Scripts/2D/Follow2D.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 5c3e4ae285230a7448969a1b437a0b03 -timeCreated: 1500793402 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/2D/Follow2DRigidbody.cs b/Assets/Scripts/2D/Follow2DRigidbody.cs deleted file mode 100644 index 754da05..0000000 --- a/Assets/Scripts/2D/Follow2DRigidbody.cs +++ /dev/null @@ -1,141 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - - -/// -/// Follows a GameObject in a Smooth way and with various settings requiring the rigidbody -/// Author: Manuel Otheo (@Lootheo) with guidance from Hasan Bayat (EmpireWorld) -/// -/// https://www.reddit.com/r/Unity3D/comments/6iskah/movetowards_vs_lerp_vs_slerp_vs_smoothdamp/ -/// How to use: Attach it to a GameObject and then assign the target to follow and the variables like offset and speed -/// If it's not moving check the speed -/// -/// -namespace UnityLibrary -{ - [RequireComponent(typeof(Rigidbody2D))] - public class Follow2DRigidbody : MonoBehaviour { - - public enum FollowType { - MoveTowards, - Lerp, - Slerp, - SmoothDamp, - Acceleration - } - - #region Fields - - public Transform target; - public FollowType followType = FollowType.MoveTowards; - public Vector2 speed; - public Vector2 time; - public Vector2 offset; - public bool bounds; - public Vector2 lowerBounds; - public Vector2 higherBounds; - public Vector2 acceleration; - #endregion - - #region Variables - - protected Vector2 velocity; - protected Vector2 step; - private Vector2 localSpeed; - Rigidbody2D rb; - #endregion - - #region MonoBehaviour Messages - protected virtual void Start() - { - rb = GetComponent(); - } - - protected virtual void FixedUpdate() - { - - // Exit if the target object not specified - if (target == null) { - return; - } - - switch (followType) - { - case FollowType.MoveTowards: - MoveTowards(); - break; - case FollowType.Lerp: - Lerp(); - break; - case FollowType.Slerp: - Slerp(); - break; - case FollowType.SmoothDamp: - SmoothDamp(); - break; - case FollowType.Acceleration: - Acceleration(); - break; - } - - if (bounds) - { - CheckForBounds(); - } - } - - #endregion - - #region Methods - - protected virtual void MoveTowards() - { - step = speed * Time.deltaTime; - rb.MovePosition(new Vector2(Vector2.MoveTowards(transform.position, (Vector2)target.position + offset, step.x).x, Vector2.MoveTowards(transform.position, (Vector2)target.position + offset, step.x).y)); - } - - protected virtual void Lerp() - { - float posX = Mathf.Lerp(transform.position.x, target.position.x + offset.x, time.x * Time.fixedDeltaTime); - float posY = Mathf.Lerp(transform.position.y, target.position.y + offset.y, time.y * Time.fixedDeltaTime); - rb.MovePosition(new Vector3(posX, posY, transform.position.z)); - } - - protected virtual void Slerp() - { - float posX = Vector3.Slerp(transform.position, (Vector3)((Vector2)target.position + offset), time.x * Time.fixedDeltaTime).x; - float posY = Vector3.Slerp(transform.position, (Vector3)((Vector2)target.position + offset), time.y * Time.fixedDeltaTime).y; - rb.MovePosition(new Vector3(posX, posY, transform.position.z)); - } - - protected virtual void SmoothDamp() - { - Vector2 position; - - position.x = Mathf.SmoothDamp(transform.position.x, target.position.x + offset.x, ref velocity.x, time.x); - position.y = Mathf.SmoothDamp(transform.position.y, target.position.y + offset.y, ref velocity.y, time.y); - - rb.MovePosition(new Vector3(position.x, position.y, transform.position.z)); - } - protected virtual void Acceleration() - { - if (Vector2.Distance(transform.position, (Vector2)target.position + offset) == 0) - localSpeed = Vector2.zero; - else - { - localSpeed = localSpeed + acceleration * Time.deltaTime; - step = localSpeed * Time.deltaTime; - rb.MovePosition(new Vector2(Vector2.MoveTowards(transform.position, (Vector2)target.position + offset, step.x).x, Vector2.MoveTowards(transform.position, (Vector2)target.position + offset, step.x).y)); - } - } - - protected virtual void CheckForBounds() - { - rb.MovePosition(new Vector3(Mathf.Clamp(transform.position.x, lowerBounds.x, higherBounds.x), Mathf.Clamp(transform.position.y, lowerBounds.y, higherBounds.y), transform.position.z)); - } - - #endregion - - } -} \ No newline at end of file diff --git a/Assets/Scripts/2D/Follow2DRigidbody.cs.meta b/Assets/Scripts/2D/Follow2DRigidbody.cs.meta deleted file mode 100644 index ee1020a..0000000 --- a/Assets/Scripts/2D/Follow2DRigidbody.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a7e1aa39bc8f2a147a374cdb56ddfb24 -timeCreated: 1511611021 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/2D/Tilemaps.meta b/Assets/Scripts/2D/Tilemaps.meta deleted file mode 100644 index 199d1ef..0000000 --- a/Assets/Scripts/2D/Tilemaps.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 05fee6bf94c73074eba0af2df86b04c6 -folderAsset: yes -timeCreated: 1500793396 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/2D/Tilemaps/Editor.meta b/Assets/Scripts/2D/Tilemaps/Editor.meta deleted file mode 100644 index cfdae7b..0000000 --- a/Assets/Scripts/2D/Tilemaps/Editor.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 59362721e8fa09e40934df875ea5459a -folderAsset: yes -timeCreated: 1500793398 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/2D/Tilemaps/Editor/TilemapLayerHelper.cs b/Assets/Scripts/2D/Tilemaps/Editor/TilemapLayerHelper.cs deleted file mode 100644 index 3258a03..0000000 --- a/Assets/Scripts/2D/Tilemaps/Editor/TilemapLayerHelper.cs +++ /dev/null @@ -1,223 +0,0 @@ -using UnityEngine; -using UnityEditor; - -#if UNITY_2017_2_OR_NEWER -using UnityEngine.Tilemaps; - -//Requires Unity 2017.2 or newer - -// TilemapLayerHelper -// Use PageDown/PageUp to select between tilemap layers -// First assign tileRoot into the editorwindow field and hit GetTileMaps button -// Set scene view zoom: Press G to toggle between: Framed, PixelPerfect, HalfWay - -public enum FrameMode -{ - Framed, - PixelPerfect, - HalfWay -} - -public class TilemapLayerHelper : EditorWindow -{ - Transform tileRoot; - GameObject[] tilemapGos; - - bool fadeOtherLayers = false; - int selectedLayer = 0; - string[] layerNames = new string[] { "" }; - - // new frame tool - FrameMode frameMode = FrameMode.Framed; - - [MenuItem("Window/TilemapLayerHelper")] - static void Init() - { - TilemapLayerHelper window = (TilemapLayerHelper)EditorWindow.GetWindow(typeof(TilemapLayerHelper)); - window.titleContent = new GUIContent("TilemapLayerHelper"); - window.minSize = new Vector2(320, 128); - window.Show(); - } - - void OnEnable() - { - SceneView.onSceneGUIDelegate += this.OnSceneGUI; - } - - void OnDisable() - { - SceneView.onSceneGUIDelegate -= this.OnSceneGUI; - - // reset colors on exit - fadeOtherLayers = false; - SetTileMapLayerColors(); - } - - void OnGUI() - { - GUILayout.Label("tileRoot", EditorStyles.boldLabel); - GUI.changed = false; - tileRoot = (Transform)EditorGUILayout.ObjectField("", tileRoot, typeof(Transform), true); - if (GUI.changed && tileRoot) - { - // get list of tilemap layers - var childTileMaps = tileRoot.GetComponentsInChildren(); - layerNames = new string[childTileMaps.Length]; - tilemapGos = new GameObject[childTileMaps.Length]; - - int i = 0; - foreach (var tm in childTileMaps) - { - layerNames[i] = tm.name; - tilemapGos[i] = tm.gameObject; - i++; - } - } - - GUI.changed = false; - fadeOtherLayers = GUILayout.Toggle(fadeOtherLayers, "Fade other layers"); - - if (GUI.changed) // reset tilemap layer colors - { - if (tileRoot == null) return; - SetTileMapLayerColors(); - } - - } - - - - void OnSceneGUI(SceneView sceneView) - { - if (tileRoot == null) return; - - // USER EVENTS - Event e = Event.current; - if (e.type == EventType.KeyDown) - { - switch (e.keyCode) - { - case KeyCode.PageUp: // select higher - selectedLayer = Wrap(--selectedLayer, layerNames.Length); - Selection.activeGameObject = tilemapGos[selectedLayer]; - e.Use(); - break; - - case KeyCode.PageDown: // select lower - selectedLayer = Wrap(++selectedLayer, layerNames.Length); - Selection.activeGameObject = tilemapGos[selectedLayer]; - e.Use(); - break; - - case KeyCode.Escape: // reset brush, TODO - break; - - case KeyCode.G: // Toggle Frame selected and PixelPerfectZoom *Cannot override F key.. - - switch (frameMode) - { - case FrameMode.Framed: - Selection.activeGameObject = tilemapGos[selectedLayer]; - sceneView.FrameSelected(); - frameMode = FrameMode.PixelPerfect; - break; - case FrameMode.PixelPerfect: - if (tilemapGos[selectedLayer] != null) - { - // var tm = tilemapGos[selectedLayer].GetComponent(); - // var s = tm.GetSprite(new Vector3Int(0, 0, 0)); - // var tr = tilemapGos[selectedLayer].GetComponent(); - - var cam = SceneView.currentDrawingSceneView.camera; - var pixelPerUnits = 16; // TODO get from sprites - var orthoSize = cam.pixelHeight / pixelPerUnits / 2; - - Vector3 mousePosition = Event.current.mousePosition; - mousePosition.y = SceneView.currentDrawingSceneView.camera.pixelHeight - mousePosition.y; - var mouseWorldPos = cam.ScreenToWorldPoint(mousePosition); - - sceneView.LookAtDirect(mouseWorldPos, SceneView.lastActiveSceneView.rotation, orthoSize); - //sceneView.LookAtDirect(SceneView.lastActiveSceneView.pivot, SceneView.lastActiveSceneView.rotation, orthoSize); - } - frameMode = FrameMode.HalfWay; - break; - case FrameMode.HalfWay: - if (tilemapGos[selectedLayer] != null) - { - var cam = SceneView.currentDrawingSceneView.camera; - var pixelPerUnits = 16; // TODO get from sprites - var orthoSize = cam.pixelHeight / pixelPerUnits * 2; - - Vector3 mousePosition = Event.current.mousePosition; - mousePosition.y = SceneView.currentDrawingSceneView.camera.pixelHeight - mousePosition.y; - var mouseWorldPos = cam.ScreenToWorldPoint(mousePosition); - - sceneView.LookAtDirect(mouseWorldPos, SceneView.lastActiveSceneView.rotation, orthoSize); - } - frameMode = FrameMode.Framed; - break; - default: - break; - } - - e.Use(); - break; - - - default: - break; - } - } - - // SCENE UI - Handles.BeginGUI(); - selectedLayer = GUI.SelectionGrid(new Rect(0, 32, 128, 64), selectedLayer, layerNames, 1); - if (fadeOtherLayers) - { - SetTileMapLayerColors(); - } - Handles.EndGUI(); - } - - // http://answers.unity3d.com/answers/249513/view.html - Rect BoundsToScreenRect(Bounds bounds, Camera cam) - { - Vector3 origin = cam.WorldToScreenPoint(new Vector3(bounds.min.x, bounds.max.y, 0f)); - Vector3 extent = cam.WorldToScreenPoint(new Vector3(bounds.max.x, bounds.min.y, 0f)); - // Create rect in screen space and return - does not account for camera perspective - return new Rect(origin.x, Screen.height - origin.y, extent.x - origin.x, origin.y - extent.y); - } - - // make non-selected layers semi-transparent - void SetTileMapLayerColors() - { - for (int i = 0; i < layerNames.Length; i++) - { - if (i == selectedLayer || !fadeOtherLayers) - { - tilemapGos[i].GetComponent().color = Color.white; - } else { - tilemapGos[i].GetComponent().color = Color.white * 0.5f; - } - } - } - - - - // HELPERS - - // wrap value between 0-max - int Wrap(int i, int i_max) - { - return ((i % i_max) + i_max) % i_max; - } -} -#else -public class TilemapLayerHelper : MonoBehaviour -{ - public void Start() - { - Debug.LogWarning("This version of unity doesnt support UnityEngine.Tilemaps"); - } -} -#endif \ No newline at end of file diff --git a/Assets/Scripts/2D/Tilemaps/Editor/TilemapLayerHelper.cs.meta b/Assets/Scripts/2D/Tilemaps/Editor/TilemapLayerHelper.cs.meta deleted file mode 100644 index 1e5a676..0000000 --- a/Assets/Scripts/2D/Tilemaps/Editor/TilemapLayerHelper.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: b7620f39da11c9f44a1b32c056766a4c -timeCreated: 1500793403 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/2D/Tilemaps/Icons.meta b/Assets/Scripts/2D/Tilemaps/Icons.meta deleted file mode 100644 index 89bf689..0000000 --- a/Assets/Scripts/2D/Tilemaps/Icons.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: fe1a6407b41666346a76d2fc33ca904a -folderAsset: yes -timeCreated: 1500793398 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/2D/Tilemaps/Icons/.gitkeep b/Assets/Scripts/2D/Tilemaps/Icons/.gitkeep deleted file mode 100644 index 8b13789..0000000 --- a/Assets/Scripts/2D/Tilemaps/Icons/.gitkeep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Assets/Scripts/2D/Tilemaps/Icons/icon_DownArrow2.png b/Assets/Scripts/2D/Tilemaps/Icons/icon_DownArrow2.png deleted file mode 100644 index 771de0e..0000000 Binary files a/Assets/Scripts/2D/Tilemaps/Icons/icon_DownArrow2.png and /dev/null differ diff --git a/Assets/Scripts/2D/Tilemaps/Icons/icon_UpArrow2.png b/Assets/Scripts/2D/Tilemaps/Icons/icon_UpArrow2.png deleted file mode 100644 index 46642b0..0000000 Binary files a/Assets/Scripts/2D/Tilemaps/Icons/icon_UpArrow2.png and /dev/null differ diff --git a/Assets/Scripts/2D/Tilemaps/Icons/icon_tilemap.png b/Assets/Scripts/2D/Tilemaps/Icons/icon_tilemap.png deleted file mode 100644 index 277e320..0000000 Binary files a/Assets/Scripts/2D/Tilemaps/Icons/icon_tilemap.png and /dev/null differ diff --git a/Assets/Scripts/2D/Tilemaps/Icons/icon_tilemap_disabled.png b/Assets/Scripts/2D/Tilemaps/Icons/icon_tilemap_disabled.png deleted file mode 100644 index 567d3f2..0000000 Binary files a/Assets/Scripts/2D/Tilemaps/Icons/icon_tilemap_disabled.png and /dev/null differ diff --git a/Assets/Scripts/2D/Tilemaps/RandomTiles.cs b/Assets/Scripts/2D/Tilemaps/RandomTiles.cs deleted file mode 100644 index 39b62d0..0000000 --- a/Assets/Scripts/2D/Tilemaps/RandomTiles.cs +++ /dev/null @@ -1,83 +0,0 @@ -// tested with unity version: 2017.2.0b4 -// info: Fills tilemap with random tiles -// usage: Attach this script to empty gameobject, assign some tiles, then press play -// please make sure that you have at least version 2017.2 or the experimental 2d unity 5_5 -// https://forum.unity3d.com/threads/update-july-2017.484397/ - -using UnityEngine; -#if UNITY_2017_2_OR_NEWER -using UnityEngine.Tilemaps; -namespace UnityLibary -{ - public class RandomTiles : MonoBehaviour - { - public int width = 32; - public int height = 32; - - public Tile[] tiles; - - void Start() - { - RandomTileMap(); - } - - void RandomTileMap() - { - // validation - if (tiles == null || tiles.Length < 1) - { - Debug.LogError("Tiles not assigned", gameObject); - return; - } - - var parent = transform.parent; - if (parent == null) - { - var go = new GameObject("grid"); - go.AddComponent(); - transform.SetParent(go.transform); - } - else - { - if (parent.GetComponent() == null) - { - parent.gameObject.AddComponent(); - } - } - - TilemapRenderer tr = GetComponent(); - if (tr == null) - { - tr = gameObject.AddComponent(); - } - - Tilemap map = GetComponent(); - if (map == null) - { - map = gameObject.AddComponent(); - } - - - // random map generation - Vector3Int tilePos = Vector3Int.zero; - for (int x = 0; x < width; x++) - { - for (int y = 0; y < height; y++) - { - tilePos.x = x; - tilePos.y = y; - map.SetTile(tilePos, tiles[Random.Range(0, tiles.Length)]); - } - } - } - } -} -#else -public class RandomTiles : MonoBehaviour -{ - public void Start() - { - Debug.LogWarning("This version of unity doesnt support UnityEngine.Tilemaps"); - } -} -#endif diff --git a/Assets/Scripts/2D/Tilemaps/RandomTiles.cs.meta b/Assets/Scripts/2D/Tilemaps/RandomTiles.cs.meta deleted file mode 100644 index e7726c3..0000000 --- a/Assets/Scripts/2D/Tilemaps/RandomTiles.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 2aec585d61714a14cad8db4ae90ae900 -timeCreated: 1500793401 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/2D/Tilemaps/TileMapHierarchyHelper.cs b/Assets/Scripts/2D/Tilemaps/TileMapHierarchyHelper.cs deleted file mode 100644 index 2176e9d..0000000 --- a/Assets/Scripts/2D/Tilemaps/TileMapHierarchyHelper.cs +++ /dev/null @@ -1,85 +0,0 @@ -using UnityEditor; -using UnityEditor.SceneManagement; -using UnityEngine; - -// Hierarchy icons http://answers.unity3d.com/answers/1113260/view.html - -// displays icons for tilemaps in hierarchy -// adds up/down arrows for tilemap layers (to arrange them up or down) -//requires unity 2017.2 or newer - - -#if UNITY_2017_2_OR_NEWER -using UnityEngine.Tilemaps; -[InitializeOnLoad] -class TileMapHierarchyHelper -{ - static Texture2D tilemapIcon, tilemapIconDisabled, upArrow, downArrow; - - static TileMapHierarchyHelper() - { - tilemapIcon = AssetDatabase.LoadAssetAtPath("Assets/Icons/icon_tilemap.png", typeof(Texture2D)) as Texture2D; - tilemapIconDisabled = AssetDatabase.LoadAssetAtPath("Assets/Icons/icon_tilemap_disabled.png", typeof(Texture2D)) as Texture2D; - upArrow = AssetDatabase.LoadAssetAtPath("Assets/Icons/icon_UpArrow2.png", typeof(Texture2D)) as Texture2D; - downArrow = AssetDatabase.LoadAssetAtPath("Assets/Icons/icon_DownArrow2.png", typeof(Texture2D)) as Texture2D; - EditorApplication.hierarchyWindowItemOnGUI += HierarchyItemCallBack; - } - - - static void HierarchyItemCallBack(int instanceID, Rect selectionRect) - { - // catch events inside hierarchy window - Event e = Event.current; - if (e.type == EventType.MouseDown && e.button == 0) - { -// Vector3 mousePos = Event.current.mousePosition; - //Debug.Log(selectionRect); - //Debug.Log(mousePos); - } - - Rect r = new Rect(selectionRect); - var origX = r.x; - r.x = r.width; //icon at end - r.y = r.y + 4 + 1; - r.width = 12; // for button - - GameObject go = EditorUtility.InstanceIDToObject(instanceID) as GameObject; - - // if (go && Selection.activeGameObject == go && go.GetComponent()) - if (go && go.GetComponent()) - { - // buttons - if (GUI.Button(r, upArrow, GUIStyle.none)) - { - EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene()); - MoveInHierarchy(go, -1); - } - r.x += 13; - if (GUI.Button(r, downArrow, GUIStyle.none)) - { - EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene()); - MoveInHierarchy(go, 1); - } - - // icons - r.x = origX - 12; // icon at front - r.y -= 1; - GUI.Label(r, go.activeInHierarchy ? tilemapIcon : tilemapIconDisabled); - } - } - - // http://answers.unity3d.com/answers/807156/view.html - static void MoveInHierarchy(GameObject go, int delta) - { - go.transform.SetSiblingIndex(go.transform.GetSiblingIndex() + delta); - } -} -#else -public class TileMapHierarchyHelper : MonoBehaviour -{ - public void Start() - { - Debug.LogWarning("This version of unity doesnt support UnityEngine.Tilemaps"); - } -} -#endif diff --git a/Assets/Scripts/2D/Tilemaps/TileMapHierarchyHelper.cs.meta b/Assets/Scripts/2D/Tilemaps/TileMapHierarchyHelper.cs.meta deleted file mode 100644 index 14edfa1..0000000 --- a/Assets/Scripts/2D/Tilemaps/TileMapHierarchyHelper.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 992bbcd9a2e351040883f3ed6ffe7115 -timeCreated: 1500793403 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/AssetBundles.meta b/Assets/Scripts/AssetBundles.meta deleted file mode 100644 index 78de1f8..0000000 --- a/Assets/Scripts/AssetBundles.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 21d456c6e751b564e80f9cf743f1a72f -folderAsset: yes -timeCreated: 1500793394 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/AssetBundles/AssetBundleLoader.cs b/Assets/Scripts/AssetBundles/AssetBundleLoader.cs deleted file mode 100644 index 215d6de..0000000 --- a/Assets/Scripts/AssetBundles/AssetBundleLoader.cs +++ /dev/null @@ -1,141 +0,0 @@ -using System.Collections; -using UnityEngine; -using UnityEngine.Networking; - -// AssetBundle cache checker & loader with caching -// worsk by loading .manifest file from server and parsing hash string from it - -namespace UnityLibrary -{ - public class AssetBundleLoader : MonoBehaviour - { - public string assetBundleURL = "http://localhost/bundle"; - - void Start() - { - //StartCoroutine(DownloadAndCache(assetBundleURL)); - } - - /// - /// load assetbundle manifest, check hash, load actual bundle with hash parameter to use caching - /// instantiate gameobject - /// - /// full url to assetbundle file - /// optional parameter to access specific asset from assetbundle - /// - IEnumerator DownloadAndCache(string bundleURL, string assetName = "") - { - // Wait for the Caching system to be ready - while (!Caching.ready) - { - yield return null; - } - - // if you want to always load from server, can clear cache first - // Caching.CleanCache(); - - // get current bundle hash from server, random value added to avoid caching - UnityWebRequest www = UnityWebRequest.Get(bundleURL + ".manifest?r=" + (Random.value * 9999999)); - Debug.Log("Loading manifest:" + bundleURL + ".manifest"); - - // wait for load to finish - yield return www.Send(); - - // if received error, exit - if (www.isNetworkError == true) - { - Debug.LogError("www error: " + www.error); - www.Dispose(); - www = null; - yield break; - } - - // create empty hash string - Hash128 hashString = (default(Hash128));// new Hash128(0, 0, 0, 0); - - // check if received data contains 'ManifestFileVersion' - if (www.downloadHandler.text.Contains("ManifestFileVersion")) - { - // extract hash string from the received data, TODO should add some error checking here - var hashRow = www.downloadHandler.text.ToString().Split("\n".ToCharArray())[5]; - hashString = Hash128.Parse(hashRow.Split(':')[1].Trim()); - - if (hashString.isValid == true) - { - // we can check if there is cached version or not - if (Caching.IsVersionCached(bundleURL, hashString) == true) - { - Debug.Log("Bundle with this hash is already cached!"); - } else - { - Debug.Log("No cached version founded for this hash.."); - } - } else - { - // invalid loaded hash, just try loading latest bundle - Debug.LogError("Invalid hash:" + hashString); - yield break; - } - - } else - { - Debug.LogError("Manifest doesn't contain string 'ManifestFileVersion': " + bundleURL + ".manifest"); - yield break; - } - - // now download the actual bundle, with hashString parameter it uses cached version if available - www = UnityWebRequest.GetAssetBundle(bundleURL + "?r=" + (Random.value * 9999999), hashString, 0); - - // wait for load to finish - yield return www.Send(); - - if (www.error != null) - { - Debug.LogError("www error: " + www.error); - www.Dispose(); - www = null; - yield break; - } - - // get bundle from downloadhandler - AssetBundle bundle = ((DownloadHandlerAssetBundle)www.downloadHandler).assetBundle; - - GameObject bundlePrefab = null; - - // if no asset name is given, take the first/main asset - if (assetName == "") - { - bundlePrefab = (GameObject)bundle.LoadAsset(bundle.GetAllAssetNames()[0]); - } else - { // use asset name to access inside bundle - bundlePrefab = (GameObject)bundle.LoadAsset(assetName); - } - - // if we got something out - if (bundlePrefab != null) - { - - // instantiate at 0,0,0 and without rotation - Instantiate(bundlePrefab, Vector3.zero, Quaternion.identity); - - /* - // fix pink shaders, NOTE: not always needed.. - foreach (Renderer r in go.GetComponentsInChildren(includeInactive: true)) - { - // FIXME: creates multiple materials, not good - var material = Shader.Find(r.material.shader.name); - r.material.shader = null; - r.material.shader = material; - }*/ - } - - www.Dispose(); - www = null; - - // try to cleanup memory - Resources.UnloadUnusedAssets(); - bundle.Unload(false); - bundle = null; - } - } -} diff --git a/Assets/Scripts/AssetBundles/AssetBundleLoader.cs.meta b/Assets/Scripts/AssetBundles/AssetBundleLoader.cs.meta deleted file mode 100644 index bf527aa..0000000 --- a/Assets/Scripts/AssetBundles/AssetBundleLoader.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 03cf67e7ff38596418c74e18a882150f -timeCreated: 1500793399 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Camera.meta b/Assets/Scripts/Camera.meta deleted file mode 100644 index f237375..0000000 --- a/Assets/Scripts/Camera.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: f6741ca26024b1140a6866a3952649b0 -folderAsset: yes -timeCreated: 1500793396 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Camera/CameraShake.cs b/Assets/Scripts/Camera/CameraShake.cs deleted file mode 100644 index d8814bb..0000000 --- a/Assets/Scripts/Camera/CameraShake.cs +++ /dev/null @@ -1,58 +0,0 @@ -using UnityEngine; -using System.Collections; - -// usage: attach this script into camera, call Shake() method to start -// source: http://answers.unity3d.com/answers/992509/view.html -namespace UnityLibrary -{ - public class CameraShake : MonoBehaviour - { - public bool shakePosition; - public bool shakeRotation; - - public float shakeIntensityMin = 0.1f; - public float shakeIntensityMax = 0.5f; - public float shakeDecay = 0.02f; - - private Vector3 OriginalPos; - private Quaternion OriginalRot; - - private bool isShakeRunning = false; - - // call this function to start shaking - public void Shake() - { - OriginalPos = transform.position; - OriginalRot = transform.rotation; - StartCoroutine("ProcessShake"); - } - - IEnumerator ProcessShake() - { - if (!isShakeRunning) - { - isShakeRunning = true; - float currentShakeIntensity = Random.Range(shakeIntensityMin, shakeIntensityMax); - - while (currentShakeIntensity > 0) - { - if (shakePosition) - { - transform.position = OriginalPos + Random.insideUnitSphere * currentShakeIntensity; - } - if (shakeRotation) - { - transform.rotation = new Quaternion(OriginalRot.x + Random.Range(-currentShakeIntensity, currentShakeIntensity) * .2f, - OriginalRot.y + Random.Range(-currentShakeIntensity, currentShakeIntensity) * .2f, - OriginalRot.z + Random.Range(-currentShakeIntensity, currentShakeIntensity) * .2f, - OriginalRot.w + Random.Range(-currentShakeIntensity, currentShakeIntensity) * .2f); - } - currentShakeIntensity -= shakeDecay; - yield return null; - } - - isShakeRunning = false; - } - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Camera/CameraShake.cs.meta b/Assets/Scripts/Camera/CameraShake.cs.meta deleted file mode 100644 index 57e8c96..0000000 --- a/Assets/Scripts/Camera/CameraShake.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: c03cc4ef2cf2cb54c82653f431e22d78 -timeCreated: 1500793403 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Camera/CameraSwitcher.cs b/Assets/Scripts/Camera/CameraSwitcher.cs deleted file mode 100644 index 05f683a..0000000 --- a/Assets/Scripts/Camera/CameraSwitcher.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Camera switcher, https://forum.unity3d.com/threads/how-can-i-switch-between-multiple-cameras-using-one-key-click.472009/ -// usage: Assign cameras into the array, press C to switch into next camera - -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityLibrary -{ - public class CameraSwitcher : MonoBehaviour - { - public Camera[] cameras; - int currentCamera = 0; - - void Awake() - { - if (cameras == null || cameras.Length == 0) - { - Debug.LogError("No cameras assigned..", gameObject); - this.enabled = false; - } - - EnableOnlyFirstCamera(); - } - - void Update() - { - if (Input.GetKeyDown(KeyCode.C)) - { - // disable current - cameras[currentCamera].enabled = false; - - // increment index and wrap after finished array - currentCamera = (currentCamera + 1) % cameras.Length; - - // enable next - cameras[currentCamera].enabled = true; - } - } - - void EnableOnlyFirstCamera() - { - for (int i = 0; i < cameras.Length; i++) - { - // only returns true when i is 0 - cameras[i].enabled = (i == 0); - } - } - } -} diff --git a/Assets/Scripts/Camera/CameraSwitcher.cs.meta b/Assets/Scripts/Camera/CameraSwitcher.cs.meta deleted file mode 100644 index dcf1948..0000000 --- a/Assets/Scripts/Camera/CameraSwitcher.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 06e035d5b04a4994285b8436101a9f82 -timeCreated: 1500793399 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Camera/SmoothMouseLook.cs b/Assets/Scripts/Camera/SmoothMouseLook.cs deleted file mode 100644 index a01d008..0000000 --- a/Assets/Scripts/Camera/SmoothMouseLook.cs +++ /dev/null @@ -1,72 +0,0 @@ -// original source: http://forum.unity3d.com/threads/a-free-simple-smooth-mouselook.73117/ -// Very simple smooth mouselook modifier for the MainCamera in Unity -// by Francis R. Griffiths-Keam - www.runningdimensions.com -// Modified: Escape key for hide/show & lock/unlock mouse - -using UnityEngine; -namespace UnityLibrary -{ - public class SmoothMouseLook : MonoBehaviour - { - Vector2 _mouseAbsolute; - Vector2 _smoothMouse; - - public Vector2 clampInDegrees = new Vector2(360, 180); - public bool lockCursor; - public Vector2 sensitivity = new Vector2(2, 2); - public Vector2 smoothing = new Vector2(3, 3); - public Vector2 targetDirection; - - void Start() - { - // Set target direction to the camera's initial orientation. - targetDirection = transform.rotation.eulerAngles; - Cursor.visible = !lockCursor; - } - - void LateUpdate() - { - - // pressing esc toggles between hide/show and lock/unlock cursor - if (Input.GetKeyDown(KeyCode.Escape)) - { - lockCursor = !lockCursor; - } - - // Ensure the cursor is always locked when set - Cursor.lockState = lockCursor ? CursorLockMode.Locked : CursorLockMode.None; - Cursor.visible = !lockCursor; - - // Allow the script to clamp based on a desired target value. - Quaternion targetOrientation = Quaternion.Euler(targetDirection); - - // Get raw mouse input for a cleaner reading on more sensitive mice. - var mouseDelta = new Vector2(Input.GetAxisRaw("Mouse X"), Input.GetAxisRaw("Mouse Y")); - - // Scale input against the sensitivity setting and multiply that against the smoothing value. - mouseDelta = Vector2.Scale(mouseDelta, new Vector2(sensitivity.x * smoothing.x, sensitivity.y * smoothing.y)); - - // Interpolate mouse movement over time to apply smoothing delta. - _smoothMouse.x = Mathf.Lerp(_smoothMouse.x, mouseDelta.x, 1f / smoothing.x); - _smoothMouse.y = Mathf.Lerp(_smoothMouse.y, mouseDelta.y, 1f / smoothing.y); - - // Find the absolute mouse movement value from point zero. - _mouseAbsolute += _smoothMouse; - - // Clamp and apply the local x value first, so as not to be affected by world transforms. - if (clampInDegrees.x < 360) - _mouseAbsolute.x = Mathf.Clamp(_mouseAbsolute.x, -clampInDegrees.x * 0.5f, clampInDegrees.x * 0.5f); - - var xRotation = Quaternion.AngleAxis(-_mouseAbsolute.y, targetOrientation * Vector3.right); - transform.localRotation = xRotation; - - // Then clamp and apply the global y value. - if (clampInDegrees.y < 360) - _mouseAbsolute.y = Mathf.Clamp(_mouseAbsolute.y, -clampInDegrees.y * 0.5f, clampInDegrees.y * 0.5f); - - var yRotation = Quaternion.AngleAxis(_mouseAbsolute.x, transform.InverseTransformDirection(Vector3.up)); - transform.localRotation *= yRotation; - transform.rotation *= targetOrientation; - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Camera/SmoothMouseLook.cs.meta b/Assets/Scripts/Camera/SmoothMouseLook.cs.meta deleted file mode 100644 index 5931d49..0000000 --- a/Assets/Scripts/Camera/SmoothMouseLook.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 44c00afd5e9966b49a5ba1bfd4ce4ba5 -timeCreated: 1500793401 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Camera/SmoothMouseLookAveraged.cs b/Assets/Scripts/Camera/SmoothMouseLookAveraged.cs deleted file mode 100644 index b0e17ce..0000000 --- a/Assets/Scripts/Camera/SmoothMouseLookAveraged.cs +++ /dev/null @@ -1,104 +0,0 @@ -using UnityEngine; -using System.Collections; -using System.Collections.Generic; - -// source: https://forum.unity3d.com/threads/a-free-simple-smooth-mouselook.73117/#post-3101292 -// added: lockCursor - -namespace UnityLibrary -{ - public class SmoothMouseLookAveraged : MonoBehaviour - { - [Header("Info")] - private List _rotArrayX = new List(); // TODO: could use fixed array, or queue - private List _rotArrayY = new List(); - private float rotAverageX; - private float rotAverageY; - private float mouseDeltaX; - private float mouseDeltaY; - - [Header("Settings")] - public float _sensitivityX = 1.5f; - public float _sensitivityY = 1.5f; - [Tooltip("The more steps, the smoother it will be.")] - public int _averageFromThisManySteps = 3; - public bool lockCursor = false; - - [Header("References")] - [Tooltip("Object to be rotated when mouse moves left/right.")] - public Transform _playerRootT; - [Tooltip("Object to be rotated when mouse moves up/down.")] - public Transform _cameraT; - - //============================================ - // FUNCTIONS (UNITY) - //============================================ - - void Start() - { - Cursor.visible = !lockCursor; - } - - void Update() - { - HandleCursorLock(); - MouseLookAveraged(); - } - - //============================================ - // FUNCTIONS (CUSTOM) - //============================================ - - void HandleCursorLock() - { - // pressing esc toggles between hide/show and lock/unlock cursor - if (Input.GetKeyDown(KeyCode.Escape)) - { - lockCursor = !lockCursor; - } - - // Ensure the cursor is always locked when set - Cursor.lockState = lockCursor ? CursorLockMode.Locked : CursorLockMode.None; - Cursor.visible = !lockCursor; - } - - - - void MouseLookAveraged() - { - rotAverageX = 0f; - rotAverageY = 0f; - mouseDeltaX = 0f; - mouseDeltaY = 0f; - - mouseDeltaX += Input.GetAxis("Mouse X") * _sensitivityX; - mouseDeltaY += Input.GetAxis("Mouse Y") * _sensitivityY; - - // Add current rot to list, at end - _rotArrayX.Add(mouseDeltaX); - _rotArrayY.Add(mouseDeltaY); - - // Reached max number of steps? Remove oldest from list - if (_rotArrayX.Count >= _averageFromThisManySteps) - _rotArrayX.RemoveAt(0); - - if (_rotArrayY.Count >= _averageFromThisManySteps) - _rotArrayY.RemoveAt(0); - - // Add all of these rotations together - for (int i_counterX = 0; i_counterX < _rotArrayX.Count; i_counterX++) - rotAverageX += _rotArrayX[i_counterX]; - - for (int i_counterY = 0; i_counterY < _rotArrayY.Count; i_counterY++) - rotAverageY += _rotArrayY[i_counterY]; - - // Get average - rotAverageX /= _rotArrayX.Count; - rotAverageY /= _rotArrayY.Count; - - // Apply - _playerRootT.Rotate(0f, rotAverageX, 0f, Space.World); - _cameraT.Rotate(-rotAverageY, 0f, 0f, Space.Self); - } - } -} diff --git a/Assets/Scripts/Camera/SmoothMouseLookAveraged.cs.meta b/Assets/Scripts/Camera/SmoothMouseLookAveraged.cs.meta deleted file mode 100644 index abc151e..0000000 --- a/Assets/Scripts/Camera/SmoothMouseLookAveraged.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: be1c222ad88e6b04e945a890fd33e125 -timeCreated: 1500793403 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Camera/WowCamera.cs b/Assets/Scripts/Camera/WowCamera.cs deleted file mode 100644 index 7a6fa93..0000000 --- a/Assets/Scripts/Camera/WowCamera.cs +++ /dev/null @@ -1,159 +0,0 @@ -using UnityEngine; -using System.Collections; - - -namespace UnityLibrary -{ - public class WowCamera : MonoBehaviour - { - public Transform target; - - public float targetHeight = 1.7f; - public float distance = 5.0f; - public float offsetFromWall = 0.1f; - - public float maxDistance = 20; - public float minDistance = .6f; - - public float xSpeed = 200.0f; - public float ySpeed = 200.0f; - public float targetSpeed = 5.0f; - - - public int yMinLimit = -80; - public int yMaxLimit = 80; - - public int zoomRate = 40; - - public float rotationDampening = 3.0f; - public float zoomDampening = 5.0f; - - public LayerMask collisionLayers = -1; - - private float xDeg = 0.0f; - private float yDeg = 0.0f; - private float currentDistance; - private float desiredDistance; - private float correctedDistance; - - void Start() - { - Vector3 angles = transform.eulerAngles; - xDeg = angles.x; - yDeg = angles.y; - - currentDistance = distance; - desiredDistance = distance; - correctedDistance = distance; - - // Make the rigid body not change rotation - if (GetComponent()) - GetComponent().freezeRotation = true; - } - - - void Update() - { - - //Move the Player with left & right button press together - if (Input.GetMouseButton(1) && Input.GetMouseButton(0)) - { - float targetRotationAngle = target.eulerAngles.y; - float currentRotationAngle = transform.eulerAngles.y; - xDeg = Mathf.LerpAngle(currentRotationAngle, targetRotationAngle, rotationDampening * Time.deltaTime); - target.transform.Rotate(0, Input.GetAxis("Mouse X") * xSpeed * 0.02f, 0); - xDeg += Input.GetAxis("Mouse X") * targetSpeed * 0.02f; - target.transform.Translate(Vector3.forward * targetSpeed * Time.deltaTime); - } - } - - /** - * Camera logic on LateUpdate to only update after all character movement logic has been handled. - */ - void LateUpdate() - { - Vector3 vTargetOffset; - - // Don't do anything if target is not defined - if (!target) - return; - - // If either mouse buttons are down, let the mouse govern camera position - if (Input.GetMouseButton(0)) - { - xDeg += Input.GetAxis("Mouse X") * xSpeed * 0.02f; - yDeg -= Input.GetAxis("Mouse Y") * ySpeed * 0.02f; - } - //Reset the camera angle and Rotate the Target Around the World! - else if (Input.GetMouseButton(1)) - { - float targetRotationAngle = target.eulerAngles.y; - float currentRotationAngle = transform.eulerAngles.y; - xDeg = Mathf.LerpAngle(currentRotationAngle, targetRotationAngle, rotationDampening * Time.deltaTime); - target.transform.Rotate(0, Input.GetAxis("Mouse X") * xSpeed * 0.02f, 0); - xDeg += Input.GetAxis("Mouse X") * xSpeed * 0.02f; - } - - - // otherwise, ease behind the target if any of the directional keys are pressed - else if (Input.GetAxis("Vertical") != 0 || Input.GetAxis("Horizontal") != 0) - { - float targetRotationAngle = target.eulerAngles.y; - float currentRotationAngle = transform.eulerAngles.y; - xDeg = Mathf.LerpAngle(currentRotationAngle, targetRotationAngle, rotationDampening * Time.deltaTime); - } - - yDeg = ClampAngle(yDeg, yMinLimit, yMaxLimit); - - - // set camera rotation - Quaternion rotation = Quaternion.Euler(yDeg, xDeg, 0); - - // calculate the desired distance - desiredDistance -= Input.GetAxis("Mouse ScrollWheel") * Time.deltaTime * zoomRate * Mathf.Abs(desiredDistance); - desiredDistance = Mathf.Clamp(desiredDistance, minDistance, maxDistance); - correctedDistance = desiredDistance; - - // calculate desired camera position - vTargetOffset = new Vector3(0, -targetHeight, 0); - Vector3 position = target.position - (rotation * Vector3.forward * desiredDistance + vTargetOffset); - - // check for collision using the true target's desired registration point as set by user using height - RaycastHit collisionHit; - Vector3 trueTargetPosition = new Vector3(target.position.x, target.position.y + targetHeight, target.position.z); - - // if there was a collision, correct the camera position and calculate the corrected distance - bool isCorrected = false; - if (Physics.Linecast(trueTargetPosition, position, out collisionHit, collisionLayers.value)) - { - // calculate the distance from the original estimated position to the collision location, - // subtracting out a safety "offset" distance from the object we hit. The offset will help - // keep the camera from being right on top of the surface we hit, which usually shows up as - // the surface geometry getting partially clipped by the camera's front clipping plane. - correctedDistance = Vector3.Distance(trueTargetPosition, collisionHit.point) - offsetFromWall; - isCorrected = true; - } - - // For smoothing, lerp distance only if either distance wasn't corrected, or correctedDistance is more than currentDistance - currentDistance = !isCorrected || correctedDistance > currentDistance ? Mathf.Lerp(currentDistance, correctedDistance, Time.deltaTime * zoomDampening) : correctedDistance; - - // keep within legal limits - currentDistance = Mathf.Clamp(currentDistance, minDistance, maxDistance); - - // recalculate position based on the new currentDistance - position = target.position - (rotation * Vector3.forward * currentDistance + vTargetOffset); - - transform.rotation = rotation; - transform.position = position; - } - - private static float ClampAngle(float angle, float min, float max) - { - if (angle < -360) - angle += 360; - if (angle > 360) - angle -= 360; - return Mathf.Clamp(angle, min, max); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Camera/WowCamera.cs.meta b/Assets/Scripts/Camera/WowCamera.cs.meta deleted file mode 100644 index eba07e5..0000000 --- a/Assets/Scripts/Camera/WowCamera.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 3d99a01c1a910df45bea4973b72ad60b -timeCreated: 1500793401 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Camera/ZoomWithMouse.cs b/Assets/Scripts/Camera/ZoomWithMouse.cs deleted file mode 100644 index 45b0b1f..0000000 --- a/Assets/Scripts/Camera/ZoomWithMouse.cs +++ /dev/null @@ -1,21 +0,0 @@ -using UnityEngine; - -// Zoom forward and backward with mousewheel, Attach this script to camera - -namespace UnityLibrary -{ - public class ZoomWithMouse : MonoBehaviour - { - public float zoomSpeed = 20; - - void Update() - { - var mouseScroll = Input.GetAxis("Mouse ScrollWheel"); - - if (mouseScroll != 0) - { - transform.Translate(transform.forward * mouseScroll * zoomSpeed * Time.deltaTime, Space.Self); - } - } - } -} diff --git a/Assets/Scripts/Camera/ZoomWithMouse.cs.meta b/Assets/Scripts/Camera/ZoomWithMouse.cs.meta deleted file mode 100644 index 09ee286..0000000 --- a/Assets/Scripts/Camera/ZoomWithMouse.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f63c7db2f4eaccb4a8c82158ed83fc72 -timeCreated: 1500793404 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Docs.meta b/Assets/Scripts/Docs.meta deleted file mode 100644 index 3717894..0000000 --- a/Assets/Scripts/Docs.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: a5f32495e2dec8f4f9793a3b0c2c16cc -folderAsset: yes -timeCreated: 1502256483 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Docs/Camera.meta b/Assets/Scripts/Docs/Camera.meta deleted file mode 100644 index 67ee210..0000000 --- a/Assets/Scripts/Docs/Camera.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: f156ebd0553293648ad08d0bb96d6a17 -folderAsset: yes -timeCreated: 1502256483 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Docs/Camera/Camera_depthTextureMode.cs b/Assets/Scripts/Docs/Camera/Camera_depthTextureMode.cs deleted file mode 100644 index 2b70930..0000000 --- a/Assets/Scripts/Docs/Camera/Camera_depthTextureMode.cs +++ /dev/null @@ -1,21 +0,0 @@ -// page https://docs.unity3d.com/ScriptReference/Camera-depthTextureMode.html -// usage: attach this script to Camera - -using UnityEngine; - -namespace UnityLibrary -{ - public class Camera_depthTextureMode : MonoBehaviour - { - void OnEnable() - { - var cam = GetComponent(); - if (cam!=null) - { - // enable camera depth texture - cam.depthTextureMode = DepthTextureMode.Depth; - } -// Debug.Log(Camera.main.depthTextureMode); - } - } -} diff --git a/Assets/Scripts/Docs/Camera/Camera_depthTextureMode.cs.meta b/Assets/Scripts/Docs/Camera/Camera_depthTextureMode.cs.meta deleted file mode 100644 index 98beb3d..0000000 --- a/Assets/Scripts/Docs/Camera/Camera_depthTextureMode.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 952055200907e8b4f95a7539f6d5607f -timeCreated: 1502256483 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Docs/Graphics.meta b/Assets/Scripts/Docs/Graphics.meta deleted file mode 100644 index 57ac596..0000000 --- a/Assets/Scripts/Docs/Graphics.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 8f51a49ed57226740a48b0c16003d736 -folderAsset: yes -timeCreated: 1502256483 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Docs/Graphics/Graphics_Blit.cs b/Assets/Scripts/Docs/Graphics/Graphics_Blit.cs deleted file mode 100644 index 6760898..0000000 --- a/Assets/Scripts/Docs/Graphics/Graphics_Blit.cs +++ /dev/null @@ -1,32 +0,0 @@ -using UnityEngine; -using System.Collections; - -// Example: Using Graphics.Blit to draw a full screen texture, with particle shader -// Usage: Attach to Main Camera -// Optional: Assign some texture into the displayTexture field in inspector - -namespace UnityLibrary -{ - public class Graphics_Blit : MonoBehaviour - { - public Texture displayTexture; // assign texture you want to blit fullscreen - Material mat; // material(shader) to use for blitting - - void Awake() - { - if (displayTexture == null) displayTexture = Texture2D.whiteTexture; // use white texture, if nothing is set - - // use particle shader for the Blit material - var shader = Shader.Find("Particles/Multiply (Double)"); - mat = new Material(shader); - } - - // This function is called only if the script is attached to the camera and is enabled - void OnPostRender() - { - // Copies source texture into destination render texture with a shader - // Destination RenderTexture is null to blit directly to screen - Graphics.Blit(displayTexture, null, mat); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Docs/Graphics/Graphics_Blit.cs.meta b/Assets/Scripts/Docs/Graphics/Graphics_Blit.cs.meta deleted file mode 100644 index b9cc5b1..0000000 --- a/Assets/Scripts/Docs/Graphics/Graphics_Blit.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 57240369e62ddfe4f89dbf0b4462a1ea -timeCreated: 1502256483 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Docs/Mesh/MeshExample.cs b/Assets/Scripts/Docs/Mesh/MeshExample.cs deleted file mode 100644 index 03e2799..0000000 --- a/Assets/Scripts/Docs/Mesh/MeshExample.cs +++ /dev/null @@ -1,53 +0,0 @@ -using UnityEngine; - -/// -/// Build single triangle mesh from script, with vertex colors, normals, uvs. -/// Usage: Assign this script into empty gameobject in the scene, press play. Optional: Add point light to scene for testing lights -/// - -namespace UnityLibrary -{ - public class MeshExample : MonoBehaviour - { - - void Start() - { - // create empty gameobject with meshrenderer and meshfilter - var mr = gameObject.AddComponent(); - var mf = gameObject.AddComponent(); - - // build new mesh - Mesh mesh = new Mesh(); - // assign to meshfilter - mf.mesh = mesh; - - // create one triangle face - // 3 vertices - var vertices = new Vector3[] { new Vector3(0, 0, 0), new Vector3(0, 0, 1), new Vector3(1, 0, 1) }; - // connect vertices to build triangle face - var triangles = new int[] { 0, 1, 2 }; - // assign UV per vertex - var uvs = new Vector2[] { new Vector2(0, 0), new Vector2(0, 1), new Vector2(1, 1) }; - // assign normal direction per vertex - var normals = new Vector3[] { Vector3.up, Vector3.up, Vector3.up }; - // assign color per vertex - var colors = new Color[] { Color.red, Color.green, Color.blue }; - - // assign values to mesh - mesh.vertices = vertices; - mesh.uv = uvs; - mesh.triangles = triangles; - mesh.normals = normals; - mesh.colors = colors; - - // if have issues of disappearing mesh, uncomment next line - //mesh.RecalculateBounds(); - - // assign sprite diffuce shader material to see vertex colors and lights - var shader = Shader.Find("Sprites/Diffuse"); - var material = new Material(shader); - mr.material = material; - } - - } -} diff --git a/Assets/Scripts/Docs/MonoBehaviour.meta b/Assets/Scripts/Docs/MonoBehaviour.meta deleted file mode 100644 index e084d9a..0000000 --- a/Assets/Scripts/Docs/MonoBehaviour.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 9855b6fa6f6a43b468a2c8bb672a64a6 -folderAsset: yes -timeCreated: 1502256483 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Docs/MonoBehaviour/MonoBehaviour_OnValidate.cs b/Assets/Scripts/Docs/MonoBehaviour/MonoBehaviour_OnValidate.cs deleted file mode 100644 index 6b0b99f..0000000 --- a/Assets/Scripts/Docs/MonoBehaviour/MonoBehaviour_OnValidate.cs +++ /dev/null @@ -1,25 +0,0 @@ -using UnityEngine; -using System.Collections; - -// Example: Using OnValidate() to validate inspector fields in editor -// https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnValidate.html - -namespace UnityLibrary -{ - public class MonoBehaviour_OnValidate : MonoBehaviour - { - // try setting this number larger than 100 in inspector - public float number = 0; - - // this gets called only in editor, when inspector field is modified - void OnValidate() - { - // you can print warnings also - // if (number < 0 || number > 100) Debug.LogWarning("OnValidate: number value is invalid.."); - - // clamp number to 0-100 - number = Mathf.Clamp(number, 0, 100); - } - } -} - diff --git a/Assets/Scripts/Docs/MonoBehaviour/MonoBehaviour_OnValidate.cs.meta b/Assets/Scripts/Docs/MonoBehaviour/MonoBehaviour_OnValidate.cs.meta deleted file mode 100644 index 8b2f5ef..0000000 --- a/Assets/Scripts/Docs/MonoBehaviour/MonoBehaviour_OnValidate.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a69f3fc609439c64381e334c508b0b82 -timeCreated: 1502256483 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Docs/README.md.meta b/Assets/Scripts/Docs/README.md.meta deleted file mode 100644 index 2d208e8..0000000 --- a/Assets/Scripts/Docs/README.md.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 2d99c632bd78fa748850ab71f0eed232 -timeCreated: 1502256483 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Docs/UnityEngine.meta b/Assets/Scripts/Docs/UnityEngine.meta deleted file mode 100644 index 1ca44cd..0000000 --- a/Assets/Scripts/Docs/UnityEngine.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: bb36932ec6987c54189247496091d7f6 -folderAsset: yes -timeCreated: 1511611015 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Docs/UnityEngine/CanvasRenderMode.cs b/Assets/Scripts/Docs/UnityEngine/CanvasRenderMode.cs deleted file mode 100644 index a8b26ca..0000000 --- a/Assets/Scripts/Docs/UnityEngine/CanvasRenderMode.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -// usage: Attach this script to gameobject with Canvas component -// click mouse button to switch modes *note: worldspace will not be visible without scaling it -// https://docs.unity3d.com/ScriptReference/Canvas-renderMode.html - -namespace UnityLibrary -{ - public class CanvasRenderMode : MonoBehaviour - { - Canvas canvas; - - void Start() - { - canvas = GetComponent(); - if (canvas == null) - { - Debug.LogError("Canvas not found..", gameObject); - this.enabled = false; - } - } - - void Update() - { - // switch modes on left mouse click - if (Input.GetMouseButtonDown(0)) - { - if (canvas.renderMode != RenderMode.WorldSpace) - { - canvas.renderMode = RenderMode.WorldSpace; - } else - { - canvas.renderMode = RenderMode.ScreenSpaceOverlay; - } - } - } - } -} diff --git a/Assets/Scripts/Docs/UnityEngine/CanvasRenderMode.cs.meta b/Assets/Scripts/Docs/UnityEngine/CanvasRenderMode.cs.meta deleted file mode 100644 index f44cb21..0000000 --- a/Assets/Scripts/Docs/UnityEngine/CanvasRenderMode.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 37aa85463a82a3448886076125e86145 -timeCreated: 1511611020 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Docs/UnityEngine/CullingGroupExample.cs b/Assets/Scripts/Docs/UnityEngine/CullingGroupExample.cs deleted file mode 100644 index 2a5f505..0000000 --- a/Assets/Scripts/Docs/UnityEngine/CullingGroupExample.cs +++ /dev/null @@ -1,93 +0,0 @@ -// gets nearby objects using CullingGroup -// Assign this script to some gameobject, that the distance is measured from - -using UnityEngine; - -namespace UnityLibrary -{ - public class CullingGroupExample : MonoBehaviour - { - // just some dummy prefab to spawn (use default sphere for example) - public GameObject prefab; - - // distance to search objects from - public float searchDistance = 3; - - public bool colorInvisibleObjects = false; - - int objectCount = 5000; - - // collection of objects - Renderer[] objects; - CullingGroup cullGroup; - BoundingSphere[] bounds; - - void Start() - { - // create culling group - cullGroup = new CullingGroup(); - cullGroup.targetCamera = Camera.main; - - // measure distance to our transform - cullGroup.SetDistanceReferencePoint(transform); - - // search distance "bands" starts from 0, so index=0 is from 0 to searchDistance - cullGroup.SetBoundingDistances(new float[] { searchDistance, float.PositiveInfinity }); - - bounds = new BoundingSphere[objectCount]; - - // spam random objects - objects = new Renderer[objectCount]; - for (int i = 0; i < objectCount; i++) - { - var pos = Random.insideUnitCircle * 30; - var go = Instantiate(prefab, pos, Quaternion.identity); - objects[i] = go.GetComponent(); - - // collect bounds for objects - var b = new BoundingSphere(); - b.position = go.transform.position; - - // get simple radius..works for our sphere - b.radius = go.GetComponent().mesh.bounds.extents.x; - bounds[i] = b; - } - - // set bounds that we track - cullGroup.SetBoundingSpheres(bounds); - cullGroup.SetBoundingSphereCount(objects.Length); - - // subscribe to event - cullGroup.onStateChanged += StateChanged; - } - - // object state has changed in culling group - void StateChanged(CullingGroupEvent e) - { - if (colorInvisibleObjects == true && e.isVisible == false) - { - objects[e.index].material.color = Color.gray; - return; - } - - // if we are in distance band index 0, that is between 0 to searchDistance - if (e.currentDistance == 0) - { - objects[e.index].material.color = Color.green; - } - else // too far, set color to red - { - objects[e.index].material.color = Color.red; - } - } - - // cleanup - private void OnDestroy() - { - cullGroup.onStateChanged -= StateChanged; - cullGroup.Dispose(); - cullGroup = null; - } - - } -} diff --git a/Assets/Scripts/Drawing.meta b/Assets/Scripts/Drawing.meta deleted file mode 100644 index d39dcb5..0000000 --- a/Assets/Scripts/Drawing.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: e1c3dce8b3aafb34786d2bb6fa8a24df -folderAsset: yes -timeCreated: 1501390147 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Drawing/DrawLine.cs b/Assets/Scripts/Drawing/DrawLine.cs deleted file mode 100644 index 44d6c53..0000000 --- a/Assets/Scripts/Drawing/DrawLine.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -namespace UnityLibrary -{ - public class DrawLine : MonoBehaviour - { - - [SerializeField] - protected LineRenderer m_LineRenderer; - [SerializeField] - protected Camera m_Camera; - protected List m_Points; - - public virtual LineRenderer lineRenderer { - get { - return m_LineRenderer; - } - } - - public virtual new Camera camera { - get { - return m_Camera; - } - } - - public virtual List points { - get { - return m_Points; - } - } - - protected virtual void Awake() - { - if (m_LineRenderer == null) - { - Debug.LogWarning("DrawLine: Line Renderer not assigned, Adding and Using default Line Renderer."); - CreateDefaultLineRenderer(); - } - if (m_Camera == null) - { - Debug.LogWarning("DrawLine: Camera not assigned, Using Main Camera or Creating Camera if main not exists."); - CreateDefaultCamera(); - } - m_Points = new List(); - } - - protected virtual void Update() - { - if (Input.GetMouseButtonDown(0)) - { - Reset(); - } - if (Input.GetMouseButton(0)) - { - Vector3 mousePosition = m_Camera.ScreenToWorldPoint(Input.mousePosition); - mousePosition.z = m_LineRenderer.transform.position.z; - if (!m_Points.Contains(mousePosition)) - { - m_Points.Add(mousePosition); - m_LineRenderer.positionCount = m_Points.Count; - m_LineRenderer.SetPosition(m_LineRenderer.positionCount - 1, mousePosition); - } - } - } - - protected virtual void Reset() - { - if (m_LineRenderer != null) - { - m_LineRenderer.positionCount = 0; - } - if (m_Points != null) - { - m_Points.Clear(); - } - } - - protected virtual void CreateDefaultLineRenderer() - { - m_LineRenderer = gameObject.AddComponent(); - m_LineRenderer.positionCount = 0; - m_LineRenderer.material = new Material(Shader.Find("Particles/Additive")); - m_LineRenderer.startColor = Color.white; - m_LineRenderer.endColor = Color.white; - m_LineRenderer.startWidth = 0.3f; - m_LineRenderer.endWidth = 0.3f; - m_LineRenderer.useWorldSpace = true; - } - - protected virtual void CreateDefaultCamera() - { - m_Camera = Camera.main; - if (m_Camera == null) - { - m_Camera = gameObject.AddComponent(); - } - m_Camera.orthographic = true; - } - - } -} diff --git a/Assets/Scripts/Drawing/DrawLine.cs.meta b/Assets/Scripts/Drawing/DrawLine.cs.meta deleted file mode 100644 index ea2e2b1..0000000 --- a/Assets/Scripts/Drawing/DrawLine.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a98122fb61ecbdc42be2a513a469f129 -timeCreated: 1501390147 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor.meta b/Assets/Scripts/Editor.meta deleted file mode 100644 index 08253ed..0000000 --- a/Assets/Scripts/Editor.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 13ed0fd2b41b56e4eae1ca4cda5ec8c7 -folderAsset: yes -timeCreated: 1500793394 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/AddDefineSymbols.cs b/Assets/Scripts/Editor/AddDefineSymbols.cs deleted file mode 100644 index d04e951..0000000 --- a/Assets/Scripts/Editor/AddDefineSymbols.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -using UnityEditor; - -/// -/// Adds the given define symbols to PlayerSettings define symbols. -/// Just add your own define symbols to the Symbols property at the below. -/// -[InitializeOnLoad] -public class AddDefineSymbols : Editor -{ - - /// - /// Symbols that will be added to the editor - /// - public static readonly string [] Symbols = new string[] { - "MYCOMPANY", - "MYCOMPANY_MYPACKAGE" - }; - - /// - /// Add define symbols as soon as Unity gets done compiling. - /// - static AddDefineSymbols () - { - string definesString = PlayerSettings.GetScriptingDefineSymbolsForGroup ( EditorUserBuildSettings.selectedBuildTargetGroup ); - List allDefines = definesString.Split ( ';' ).ToList (); - allDefines.AddRange ( Symbols.Except ( allDefines ) ); - PlayerSettings.SetScriptingDefineSymbolsForGroup ( - EditorUserBuildSettings.selectedBuildTargetGroup, - string.Join ( ";", allDefines.ToArray () ) ); - } - -} diff --git a/Assets/Scripts/Editor/AddDefineSymbols.cs.meta b/Assets/Scripts/Editor/AddDefineSymbols.cs.meta deleted file mode 100644 index 6aea040..0000000 --- a/Assets/Scripts/Editor/AddDefineSymbols.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 7fe019cd59a9a6c469975bb98490ba24 -timeCreated: 1511611020 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/BatchTools.meta b/Assets/Scripts/Editor/BatchTools.meta deleted file mode 100644 index 3d56885..0000000 --- a/Assets/Scripts/Editor/BatchTools.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 5b412ecce3fdda84085c2963eba28095 -folderAsset: yes -timeCreated: 1511611015 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/BatchTools/MassRenameChildren.cs b/Assets/Scripts/Editor/BatchTools/MassRenameChildren.cs deleted file mode 100644 index cfcf9d4..0000000 --- a/Assets/Scripts/Editor/BatchTools/MassRenameChildren.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Renames child gameobjects in hierarchy (by replacting strings) -// open wizard from GameObject/MassRenameChildren menu item - -using UnityEditor; -using UnityEngine; - -namespace UnityLibrary -{ - public class MassRenameChildren : ScriptableWizard - { - public string findString = ""; - public string replaceWith = ""; - // if set false: would replace "Hand" inside "RightHandRig", if set true: would replace "Hand" only if name starts with "Hand" like "HandRigWasd" - public bool onlyIfStartsWithFindString = true; - - [MenuItem("GameObject/Mass Rename Children")] - static void CreateWizard() - { - DisplayWizard("MassRenamer", "Apply"); - } - - // user clicked create button - void OnWizardCreate() - { - if (Selection.activeTransform == null || findString == "") - { - Debug.Log(name + " Select Root Transform and set FindString first.."); - return; - } - - // get all children for the selection, NOTE: includeInactive is true, so disabled objects will get selected also - Transform[] allChildren = Selection.activeTransform.GetComponentsInChildren(includeInactive: true); - foreach (Transform child in allChildren) - { - // skip self (selection root) - if (child != Selection.activeTransform) - { - string newName = child.name; - if (onlyIfStartsWithFindString == true) - { - // string starts with our search string - if (child.name.IndexOf(findString) == 0) - { - newName = child.name.Replace(findString, replaceWith); - } - } else // replace anywhere in target string - { - newName = child.name.Replace(findString, replaceWith); - } - - // if would have any changes to name, print out and change - if (child.name != newName) - { - Debug.LogFormat("Before: {0} | After: {1}", child.name, newName); - child.name = newName; - } - } - } - } - } -} diff --git a/Assets/Scripts/Editor/BatchTools/MassRenameChildren.cs.meta b/Assets/Scripts/Editor/BatchTools/MassRenameChildren.cs.meta deleted file mode 100644 index de3bd71..0000000 --- a/Assets/Scripts/Editor/BatchTools/MassRenameChildren.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: c9ef2083b7d1fba4aa65c75605fbf37c -timeCreated: 1511611021 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/BuildProcess.meta b/Assets/Scripts/Editor/BuildProcess.meta deleted file mode 100644 index 4f602b9..0000000 --- a/Assets/Scripts/Editor/BuildProcess.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: d115dabccac4e7341a0f797c709e9ee7 -folderAsset: yes -timeCreated: 1500793397 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/BuildProcess/PostProcessBuild.cs b/Assets/Scripts/Editor/BuildProcess/PostProcessBuild.cs deleted file mode 100644 index 3ddccf2..0000000 --- a/Assets/Scripts/Editor/BuildProcess/PostProcessBuild.cs +++ /dev/null @@ -1,25 +0,0 @@ -// OnPostprocessBuild() gets called after build has completed -// usage: copy to Editor/ folder in your project - -using UnityEditor; -using UnityEditor.Build; -using System.Diagnostics; -using Debug = UnityEngine.Debug; - -namespace UnityLibrary -{ - public class PostProcessBuild : IPostprocessBuild - { - public int callbackOrder { get { return 0; } } - - public void OnPostprocessBuild(BuildTarget target, string path) - { - Debug.Log("OnPostprocessBuild for target " + target + " at path " + path); - - // Run some process after successful build - Process proc = new Process(); - proc.StartInfo.FileName = "C:/WINDOWS/system32/notepad.exe"; - proc.Start(); - } - } -} diff --git a/Assets/Scripts/Editor/BuildProcess/PostProcessBuild.cs.meta b/Assets/Scripts/Editor/BuildProcess/PostProcessBuild.cs.meta deleted file mode 100644 index 4ae3cd6..0000000 --- a/Assets/Scripts/Editor/BuildProcess/PostProcessBuild.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 650b440cfd97b6c43af9eba650d33741 -timeCreated: 1500793402 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/EditorShortCutKeys.cs b/Assets/Scripts/Editor/EditorShortCutKeys.cs deleted file mode 100644 index d6f50fe..0000000 --- a/Assets/Scripts/Editor/EditorShortCutKeys.cs +++ /dev/null @@ -1,22 +0,0 @@ -using UnityEngine; -using UnityEditor; -using UnityEditor.SceneManagement; -using UnityEngine.SceneManagement; - -// original source by "Mavina" http://answers.unity3d.com/answers/1204307/view.html -// usage: Place this script into Editor/ folder, then you can press F5 to enter/exit Play Mode -namespace UnityLibrary -{ - public class EditorShortCutKeys : ScriptableObject - { - [MenuItem("Edit/Run _F5")] // shortcut key F5 to Play (and exit playmode also) - static void PlayGame() - { - if (!Application.isPlaying) - { - EditorSceneManager.SaveScene(SceneManager.GetActiveScene(), "", false); // optional: save before run - } - EditorApplication.ExecuteMenuItem("Edit/Play"); - } - } -} diff --git a/Assets/Scripts/Editor/EditorShortCutKeys.cs.meta b/Assets/Scripts/Editor/EditorShortCutKeys.cs.meta deleted file mode 100644 index ab840e1..0000000 --- a/Assets/Scripts/Editor/EditorShortCutKeys.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f55ab5721c1f1714e8ff849ddb613432 -timeCreated: 1500793404 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/GameObject/ResetTransform.cs b/Assets/Scripts/Editor/GameObject/ResetTransform.cs deleted file mode 100644 index 8726d41..0000000 --- a/Assets/Scripts/Editor/GameObject/ResetTransform.cs +++ /dev/null @@ -1,25 +0,0 @@ -using UnityEngine; -using UnityEditor; - -// reset transform position, rotation and scale - -namespace UnityLibrary -{ - public class ResetTransform : ScriptableObject - { - [MenuItem("GameObject/Reset Transform #r")] - static public void MoveSceneViewCamera() - { - // TODO add multiple object support - var go = Selection.activeGameObject; - if (go != null) - { - // TODO: add undo - go.transform.position = Vector3.zero; - go.transform.rotation = Quaternion.identity; - go.transform.localScale = Vector3.one; - } - } - - } // class -} // namespace diff --git a/Assets/Scripts/Editor/Gizmos.meta b/Assets/Scripts/Editor/Gizmos.meta deleted file mode 100644 index 937bc2f..0000000 --- a/Assets/Scripts/Editor/Gizmos.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 1a9b3e3cace9b2a45a7ef8a517017aa2 -folderAsset: yes -timeCreated: 1500793396 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/Gizmos/DrawCameraFrustumGizmos.cs b/Assets/Scripts/Editor/Gizmos/DrawCameraFrustumGizmos.cs deleted file mode 100644 index b0f87f9..0000000 --- a/Assets/Scripts/Editor/Gizmos/DrawCameraFrustumGizmos.cs +++ /dev/null @@ -1,18 +0,0 @@ -using UnityEngine; -using UnityEditor; - -// draws camera frustum lines with Gizmo lines (when camera is not selected) -// Usage: add this script into Editor/ folder on your project -// WARNING: cam.transform.position does not work, DrawFrustum ignores the value, unity bug? -namespace UnityLibrary -{ - static class DrawCameraFrustumGizmos - { - [DrawGizmo(GizmoType.NotInSelectionHierarchy)]// | GizmoType.Active)] - static void DrawGizmoForMyScript(Camera cam, GizmoType gizmoType) - { - Gizmos.color = Color.red; - Gizmos.DrawFrustum(cam.transform.position, cam.fieldOfView, cam.farClipPlane, cam.nearClipPlane, cam.aspect); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Editor/Gizmos/DrawCameraFrustumGizmos.cs.meta b/Assets/Scripts/Editor/Gizmos/DrawCameraFrustumGizmos.cs.meta deleted file mode 100644 index 84a2501..0000000 --- a/Assets/Scripts/Editor/Gizmos/DrawCameraFrustumGizmos.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 45f18a6639b731f4caa6b5b1a01429b7 -timeCreated: 1500793401 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/GridGenerator.meta b/Assets/Scripts/Editor/GridGenerator.meta deleted file mode 100644 index cd9b640..0000000 --- a/Assets/Scripts/Editor/GridGenerator.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: a6d652b3b2e09c341916f676f9620af4 -folderAsset: yes -timeCreated: 1500793397 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/GridGenerator/Editor.meta b/Assets/Scripts/Editor/GridGenerator/Editor.meta deleted file mode 100644 index 52d2f55..0000000 --- a/Assets/Scripts/Editor/GridGenerator/Editor.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: bfd74206b49d0814fba364735df6024b -folderAsset: yes -timeCreated: 1500793398 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/GridGenerator/Editor/GridGeneratorEditor.cs b/Assets/Scripts/Editor/GridGenerator/Editor/GridGeneratorEditor.cs deleted file mode 100644 index 33a608c..0000000 --- a/Assets/Scripts/Editor/GridGenerator/Editor/GridGeneratorEditor.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEditor; -using UnityEngine; -using UnityEditor.SceneManagement; -using System.Linq; -namespace UnityLibrary -{ - [CustomEditor(typeof(GridGenerator))] - public class GridGeneratorEditor : Editor - { - GridGenerator t; - - private void OnEnable() - { - t = (GridGenerator)target; - } - - public override void OnInspectorGUI() - { - base.OnInspectorGUI(); - - if (GUILayout.Button("Cleanup")) - { - CleanUp(); - } - - if (GUILayout.Button("Generate Grid")) - { - CleanUp(); - GenerateGrid(); - } - } - - private void CleanUp() - { - List tempList = t.transform.Cast().ToList(); - tempList.ForEach(x => DestroyImmediate(x.gameObject)); - } - - private void GenerateGrid() - { - for (int x = 0; x < t.SizeX; x++) - { - for (int y = 0; y < t.SizeY; y++) - { - Vector3 localOffset = new Vector3( - t.Offset.x * x, - 0, - t.Offset.y * y - ); - - GameObject spawnedObject = Instantiate(t.PrefabToPlace); - - spawnedObject.transform.SetParent(t.transform); - spawnedObject.transform.localPosition = localOffset; - - spawnedObject.name = string.Format("{0} ({1},{2})", t.PrefabToPlace.name, x, y); - } - } - - EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene()); - } - - } -} \ No newline at end of file diff --git a/Assets/Scripts/Editor/GridGenerator/Editor/GridGeneratorEditor.cs.meta b/Assets/Scripts/Editor/GridGenerator/Editor/GridGeneratorEditor.cs.meta deleted file mode 100644 index 0c9ab35..0000000 --- a/Assets/Scripts/Editor/GridGenerator/Editor/GridGeneratorEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 62a17510090efae4591eaa951197003d -timeCreated: 1500793402 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/GridGenerator/GridGenerator.cs b/Assets/Scripts/Editor/GridGenerator/GridGenerator.cs deleted file mode 100644 index 9d0d15d..0000000 --- a/Assets/Scripts/Editor/GridGenerator/GridGenerator.cs +++ /dev/null @@ -1,24 +0,0 @@ -using UnityEngine; -namespace UnityLibrary -{ - public class GridGenerator : MonoBehaviour - { - [SerializeField] - private GameObject prefabToPlace; - - [SerializeField] - private uint sizeX = 2; - - [SerializeField] - private uint sizeY = 2; - - [SerializeField] - private Vector2 offset = Vector2.one; - - public GameObject PrefabToPlace { get { return prefabToPlace; } } - public Vector2 Offset { get { return offset; } } - - public uint SizeX { get { return sizeX; } } - public uint SizeY { get { return sizeY; } } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Editor/GridGenerator/GridGenerator.cs.meta b/Assets/Scripts/Editor/GridGenerator/GridGenerator.cs.meta deleted file mode 100644 index c23f309..0000000 --- a/Assets/Scripts/Editor/GridGenerator/GridGenerator.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 50d99d82db098f143b97912777f8c022 -timeCreated: 1500793401 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/HelpLastRelease.cs b/Assets/Scripts/Editor/HelpLastRelease.cs deleted file mode 100644 index 076fdce..0000000 --- a/Assets/Scripts/Editor/HelpLastRelease.cs +++ /dev/null @@ -1,556 +0,0 @@ -/* - * Version: 2.4 - * Fork from the original script: https://pastebin.com/LzEHNB6U - * Purpose: Download new versions of Unity (alpha, beta, - * patches and releases) straight from the Editor. - * Shortcut in the editor for Statistics, Experimental - * Features and the Unity Roadmap. - * - * Usage: Menu, Links, Last Releases. - */ - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Reflection; -using System.Text; -using UnityEditor; -using UnityEngine; -using Debug = UnityEngine.Debug; -namespace UnityLibrary -{ - public class HelpLastRelease : EditorWindow - { - const string statsUrl = @"http://hwstats.unity3d.com/index.html"; - const string experimenalUrl = @"http://unity3d.com/experimental"; - const string roadmapUrl = @"http://unity3d.com/unity/roadmap"; - const string archiveUrl = @"http://unity3d.com/get-unity/download/archive"; - const string betaArchiveUrl = @"http://unity3d.com/unity/beta/archive"; - const string releaseUrl = @"http://beta.unity3d.com/download/{0}/download.html"; - const string assistantUrl = @"http://beta.unity3d.com/download/{0}/UnityDownloadAssistant-{1}.{2}"; - const string serverUrl = @"http://symbolserver.unity3d.com/"; - const string historyUrl = serverUrl + @"000Admin/history.txt"; - const string finalRN = @"http://unity3d.com/unity/whats-new/unity-"; - const string betaRN = @"http://unity3d.com/unity/beta/unity"; - const string patchRN = @"http://unity3d.com/unity/qa/patch-releases"; - - const string baseName = "UnityYAMLMerge.ex"; - const string compressedName = baseName + "_"; - const string extractedName = baseName + "e"; - static string tempDir; - static WWW wwwHistory, wwwList, wwwMerger, wwwAssistant; - static readonly string zipName = Application.platform == RuntimePlatform.WindowsEditor ? "7z" : "7za"; - - static SortedList fullList; - static SortedList sortedList; - static SortedList currentList; - static int selected; - static bool assistant; - static HelpLastRelease window; - const string wndTitle = "Unity Builds"; - [SerializeField] - string search = ""; - static GUIStyle style; - const string prefsCount = "HelpLastRelease.count"; - const float minWidth = 162f; - [SerializeField] - private Vector2 scroll; - static Dictionary colors = new Dictionary() { - { "5.0.", new Color32(236, 239, 241 ,255) }, - { "5.1.", new Color32(207, 216, 220, 255) }, - { "5.2.", new Color32(176, 190, 197, 255) }, - { "5.3.", new Color32(144, 164, 174, 255) }, - { "5.4.", new Color32(120, 144, 156, 255) }, - { "5.5.", new Color32(96, 125, 139, 255) }, - { "5.6.", new Color32(84, 110, 122, 255) }, - { "2017.1.", new Color32(69, 90, 100, 255) }, - { "2017.2.", new Color32(55, 71, 79, 255) }, - { "2017.3.", new Color32(38, 50, 56, 255) } - }; - - static Dictionary textColors = new Dictionary() { - { "5.0.", new Color32(0, 0, 0, 255) }, - { "5.1.", new Color32(0, 0, 0, 255) }, - { "5.2.", new Color32(0, 0, 0, 255) }, - { "5.3.", new Color32(0, 0, 0, 255) }, - { "5.4.", new Color32(255, 255, 255, 255) }, - { "5.5.", new Color32(255, 255, 255, 255) }, - { "5.6.", new Color32(255, 255, 255, 255) }, - { "2017.1.", new Color32(255, 255, 255, 255) }, - { "2017.2.", new Color32(255, 255, 255, 255) }, - { "2017.3.", new Color32(255, 255, 255, 255) } - }; - - [MenuItem("Help/Links/Statistics")] - static void OpenStatistics() - { - Application.OpenURL(statsUrl); - } - - [MenuItem("Help/Links/Experimental")] - static void OpenExperimental() - { - Application.OpenURL(experimenalUrl); - } - - [MenuItem("Help/Links/Roadmap")] - static void OpenRoadmap() - { - Application.OpenURL(roadmapUrl); - } - - [MenuItem("Help/Links/Release Archive")] - static void OpenArchive() - { - Application.OpenURL(archiveUrl); - } - - [MenuItem("Help/Links/Patch Archive")] - static void OpenPatchArchive() - { - Application.OpenURL(patchRN); - } - - [MenuItem("Help/Links/Beta Archive")] - static void OpenBetaArchive() - { - Application.OpenURL(betaArchiveUrl); - } - - [MenuItem("Help/Links/Last Releases")] - static void Init() - { - window = GetWindow(wndTitle); - } - - void OnGUI() - { - if (fullList != null) - { - ListGUI(); - } - else - WaitGUI(); - } - - public void ListGUI() - { - style = new GUIStyle(EditorStyles.miniButton); - style.alignment = TextAnchor.MiddleLeft; - //GUILayout.BeginVertical(); - DoToolbar(); - scroll = EditorGUILayout.BeginScrollView(scroll, false, false); - if (currentList == null) - currentList = fullList; - - for (int i = currentList.Count - 1; i >= 0; i--) - DoItemGUI(i, currentList.Keys[i], currentList.Values[i]); - - EditorGUILayout.EndScrollView(); - GUILayout.FlexibleSpace(); - DoDownloadProgressBar(wwwAssistant, "Downloading Assistant"); - DoDownloadProgressBar(wwwHistory, "Downloading History"); - DoDownloadProgressBar(wwwList, "Downloading List"); - DoDownloadProgressBar(wwwMerger, "Downloading Merger"); - //GUILayout.EndVertical(); - } - - private void Update() - { - Repaint(); - } - - void DoDownloadProgressBar(WWW www, string text) - { - if (www != null && !www.isDone && string.IsNullOrEmpty(www.error)) - { - text = string.Format("{0} ({1})", text, EditorUtility.FormatBytes(www.bytesDownloaded)); - EditorGUI.ProgressBar(EditorGUILayout.GetControlRect(), www.progress, string.IsNullOrEmpty(www.error) ? text : www.error); - } - } - - void DoItemGUI(int index, string key, string value) - { - var rect = EditorGUILayout.BeginHorizontal((index & 1) == 1 ? "ObjectPickerResultsOdd" : "ObjectPickerResultsEven"); - var color = GetGUIColor(index); - var colorText = GetGUITextColor(index); - var s = new GUIStyle(); - s.normal.textColor = colorText; - - EditorGUI.DrawRect(rect, color); - GUILayout.Label("Unity " + value, s); - GUILayout.FlexibleSpace(); - - var notesURL = GetReleaseNotesURL(index); - if (GUILayout.Button("Open", "minibuttonleft")) - { - DownloadList(index); - } - GUI.enabled = !string.IsNullOrEmpty(notesURL); - if (GUILayout.Button("Release Notes", "minibuttonmid")) - { - OpenReleaseNotes(index); - } - GUI.enabled = true; - if (GUILayout.Button("Download Assistant", "minibuttonright")) - { - DownloadList(index, true); - } - EditorGUILayout.EndHorizontal(); - } - - static Color32 GetGUIColor(int i) - { - foreach (var k in colors.Keys) - { - if (currentList.Values[i].Contains(k)) - { - return colors[k]; - } - } - return new Color32(255, 255, 255, 255); - } - - static Color32 GetGUITextColor(int i) - { - foreach (var k in textColors.Keys) - { - if (currentList.Values[i].Contains(k)) - { - return textColors[k]; - } - } - return new Color32(0, 0, 0, 255); - } - - void OnEnable() - { - tempDir = Application.dataPath + "/../Temp/LastRelease"; - DownloadHistory(); - } - - static void CheckNewVersion() - { - int count = EditorPrefs.GetInt(prefsCount, 0); - if (count > 0 && fullList.Count > count) - { - EditorApplication.Beep(); - Debug.LogFormat("New version: {0}", fullList.Values[fullList.Count - 1]); - } - EditorPrefs.SetInt(prefsCount, fullList.Count); - } - - static string GetReleaseNotesURL(int num) - { - string url = "", version = ""; - if (currentList.Values[num].Contains("a")) - return string.Empty; - if (currentList.Values[num].Contains("p")) - { - version = currentList.Values[num].Split(' ')[0]; - url = patchRN + version; - } - if (currentList.Values[num].Contains("f")) - { - version = currentList.Values[num].Split('f')[0]; - url = finalRN + version; - } - if (currentList.Values[num].Contains("b")) - { - version = currentList.Values[num].Split(' ')[0]; - url = betaRN + version; - } - - return url; - } - - static void OpenReleaseNotes(int num) - { - var url = GetReleaseNotesURL(num); - - if (!string.IsNullOrEmpty(url)) - Application.OpenURL(url); - } - - static void FillMenu(WWW history) - { - fullList = new SortedList(); - string build; - string[] parts, releases = history.text.Split('\n'); - for (int i = 0; i < releases.Length; i++) - { - parts = releases[i].Split(','); - DateTime dt; - if (DateTime.TryParse(string.Format("{0} {1}", parts[3], parts[4]), out dt)) - { - build = string.Format("{0} ({1})", parts[6].Trim('\"'), dt.ToString("dd-MM-yyyy")); - fullList.Add(parts[0], build); - } - //Debug.LogWarningFormat("releases[{0}]={1}\nparts={2}", i, releases[i], parts.ToStringRecursive()); - } - if (window == null) - { - HelpLastRelease[] w = Resources.FindObjectsOfTypeAll(); - if (w != null && w.Length > 0) - window = w[0]; - } - if (window != null) - window.Repaint(); - } - - static void SearchVersion() - { - string path = Path.Combine(tempDir, extractedName); - if (File.Exists(path)) - { - string[] lines; - lines = File.ReadAllLines(path, Encoding.Unicode); - FileUtil.DeleteFileOrDirectory(Path.GetDirectoryName(path)); - string version = currentList.Values[selected].Split(' ')[0] + "_"; - for (int i = 0; i < lines.Length; i++) - { - if (lines[i].Contains(version)) - { - int pos = lines[i].IndexOf(version); - string revision = lines[i].Substring(pos + version.Length, 12); - if (!assistant) - { - Application.OpenURL(string.Format(releaseUrl, revision)); - } - else - { - DownloadAssistant(revision); - } - break; - } - } - } - } - - static void DownloadAssistant(string revision) - { - string version = currentList.Values[selected].Split(' ')[0]; - string ext = Application.platform == RuntimePlatform.WindowsEditor ? "exe" : "dmg"; - string url = string.Format(assistantUrl, revision, version, ext); - wwwAssistant = new WWW(url); - EditorApplication.update += WaitAssistant; - } - - static void DownloadHistory() - { - wwwHistory = new WWW(historyUrl); - EditorApplication.update += WaitHistory; - } - - static void DownloadList(int historyNum, bool assist = false) - { - selected = historyNum; - assistant = assist; - string listUrl = string.Format("{0}000Admin/{1}", serverUrl, currentList.Keys[historyNum]); - wwwList = new WWW(listUrl); - EditorApplication.update += WaitList; - } - - static void WaitList() - { - Wait(wwwList, WaitList, ParseList); - } - - static void WaitHistory() - { - Wait(wwwHistory, WaitHistory, FillMenu, CheckNewVersion); - } - - static void WaitAssistant() - { - Wait(wwwAssistant, WaitAssistant, SaveAssistant); - } - - static void SaveAssistant(WWW assistant) - { - if (!Directory.Exists(tempDir)) - { - Directory.CreateDirectory(tempDir); - } - string name = Path.GetFileName(assistant.url); - string path = Path.Combine(tempDir, name); - File.WriteAllBytes(path, assistant.bytes); - if (Application.platform == RuntimePlatform.WindowsEditor) - { - Application.OpenURL(path); - } - else - { - StartAssistant(path); - } - } - - static void StartAssistant(string path) - { - string cmd = "hdiutil"; - string arg = string.Format("mount '{0}'", path); - try - { - using (Process assist = new Process()) - { - assist.StartInfo.FileName = cmd; - assist.StartInfo.Arguments = arg; - assist.StartInfo.WorkingDirectory = Path.GetDirectoryName(path); - assist.StartInfo.CreateNoWindow = true; - assist.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; - assist.Start(); - } - } - catch (Exception e) - { - Debug.LogErrorFormat("{0} {1}\n{2}", cmd, arg, e.Message); - } - } - - static void Wait(WWW www, EditorApplication.CallbackFunction caller, Action action, Action done = null) - { - if (www != null && www.isDone) - { - EditorApplication.update -= caller; - if (string.IsNullOrEmpty(www.error) && www.bytesDownloaded > 0) - { - //Debug.LogFormat("{0} kB: {1}", www.size/1024, www.url); - if (action != null) - action(www); - if (done != null) - done(); - } - else - Debug.LogWarningFormat("{0} {1}", www.url, www.error); - www = null; - } - else - { - if (www == null) - EditorApplication.update -= caller; - } - } - - static void ParseList(WWW list) - { - string[] files = list.text.Split('\n'); - string[] parts; - for (int i = 0; i < files.Length; i++) - { - parts = files[i].Split(','); - if (parts[0].Contains(extractedName)) - { - string mergerUrl = string.Format("{0}{1}/{2}", serverUrl, parts[0].Trim('\"').Replace('\\', '/'), compressedName); - DownloadMerger(mergerUrl); - break; - } - } - } - - static void DownloadMerger(string mergerUrl) - { - wwwMerger = new WWW(mergerUrl); - EditorApplication.update += WaitMerger; - } - - static void WaitMerger() - { - Wait(wwwMerger, WaitMerger, SaveMerger); - } - - static void SaveMerger(WWW merger) - { - if (!Directory.Exists(tempDir)) - { - Directory.CreateDirectory(tempDir); - } - string path = Path.Combine(tempDir, compressedName); - //Debug.LogFormat("path: {0}", path); - File.WriteAllBytes(path, merger.bytes); - ExtractMerger(path); - } - - static void ExtractMerger(string path) - { - string zipPath = string.Format("{0}/Tools/{1}", EditorApplication.applicationContentsPath, zipName); - string arg = string.Format("e -y \"{0}\"", path); - try - { - using (Process unzip = new Process()) - { - unzip.StartInfo.FileName = zipPath; - unzip.StartInfo.Arguments = arg; - unzip.StartInfo.WorkingDirectory = Path.GetDirectoryName(path); - unzip.StartInfo.CreateNoWindow = true; - unzip.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; - unzip.Start(); - unzip.WaitForExit(); - SearchVersion(); - } - } - catch (Exception e) - { - Debug.LogErrorFormat("{0} {1}\n{2}", zipPath, arg, e.Message); - } - } - - void DoToolbar() - { - EditorGUILayout.BeginHorizontal("toolbar"); - GUILayout.FlexibleSpace(); - SearchGUI(); - EditorGUILayout.EndHorizontal(); - } - - void SearchGUI() - { - string s = string.Empty; - - try - { - var methods = typeof(EditorGUILayout).GetMethods(BindingFlags.NonPublic | BindingFlags.Static); - - for (var i = 0; i < methods.Length; i++) - if (methods[i].Name == "ToolbarSearchField" && methods[i].GetParameters().Length <= 2) - { - s = (string)methods[i].Invoke(null, new object[] { search, null }); - break; - } - } - catch (Exception e) - { - Debug.LogException(e); - s = EditorGUILayout.TextField(search, GUILayout.MaxWidth(minWidth + 56f)); - } - - if (s != search) - { - search = s; - if (!string.IsNullOrEmpty(search)) - { - sortedList = new SortedList(); - for (int i = fullList.Count - 1; i >= 0; i--) - { - if (fullList.Values[i].Contains(search)) - { - sortedList.Add(fullList.Keys[i], fullList.Values[i]); - } - } - currentList = sortedList; - } - else - currentList = fullList; - } - } - - void WaitGUI() - { - GUILayout.BeginHorizontal(); - GUILayout.FlexibleSpace(); - GUILayout.Label("Wait..."); - GUILayout.FlexibleSpace(); - GUILayout.EndHorizontal(); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Editor/HelpLastRelease.cs.meta b/Assets/Scripts/Editor/HelpLastRelease.cs.meta deleted file mode 100644 index 64b1d97..0000000 --- a/Assets/Scripts/Editor/HelpLastRelease.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: e709b023ac010b643ad268fc30d93568 -timeCreated: 1511611021 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/Hierarchy/UnparentMe.cs b/Assets/Scripts/Editor/Hierarchy/UnparentMe.cs deleted file mode 100644 index 18e75b1..0000000 --- a/Assets/Scripts/Editor/Hierarchy/UnparentMe.cs +++ /dev/null @@ -1,21 +0,0 @@ -// unparents selected gameobject in hierarchy (by moving to grandparents if available) - -using UnityEditor; - -namespace UnityLibrary -{ - public class UnparentMe - { - // https://docs.unity3d.com/ScriptReference/MenuItem.html - // shift U shortcut key - [MenuItem("GameObject/Unparent #u")] - static void UnParent() - { - // TODO: add undo - if (Selection.activeGameObject != null && Selection.activeGameObject.transform.parent != null) - { - Selection.activeGameObject.transform.parent = Selection.activeGameObject.transform.parent.parent; - } - } - } -} diff --git a/Assets/Scripts/Editor/ImageEffects.meta b/Assets/Scripts/Editor/ImageEffects.meta deleted file mode 100644 index 4130726..0000000 --- a/Assets/Scripts/Editor/ImageEffects.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 8a3e1002f6a65554fb21b5baea37a33b -folderAsset: yes -timeCreated: 1500793397 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/ImageEffects/ColorCorrectionCurvesEditorLayers b/Assets/Scripts/Editor/ImageEffects/ColorCorrectionCurvesEditorLayers deleted file mode 100644 index 16d5f71..0000000 --- a/Assets/Scripts/Editor/ImageEffects/ColorCorrectionCurvesEditorLayers +++ /dev/null @@ -1,135 +0,0 @@ -using System; -using UnityEditor; -using UnityEngine; - -// Usage: Import builtin Effects package first, then place this in Editor/ImageEffects/-folder -// then to camera assign from Components/Image Effects/Color Adjustments/Color Correction (Curves, Saturation) Layers -// Requires ColorCorrectionCurvesLayers.cs script also - -namespace UnityStandardAssets.ImageEffects -{ - [CustomEditor (typeof(ColorCorrectionCurvesLayers))] - class ColorCorrectionCurvesEditorLayers : Editor { - SerializedObject serObj; - - SerializedProperty mode; - - SerializedProperty redChannel; - SerializedProperty greenChannel; - SerializedProperty blueChannel; - - SerializedProperty useDepthCorrection; - - SerializedProperty depthRedChannel; - SerializedProperty depthGreenChannel; - SerializedProperty depthBlueChannel; - - SerializedProperty zCurveChannel; - - SerializedProperty saturation; - - SerializedProperty selectiveCc; - SerializedProperty selectiveFromColor; - SerializedProperty selectiveToColor; - - SerializedProperty excludeLayers; - - private bool applyCurveChanges = false; - - void OnEnable () { - serObj = new SerializedObject (target); - - mode = serObj.FindProperty ("mode"); - - saturation = serObj.FindProperty ("saturation"); - - redChannel = serObj.FindProperty ("redChannel"); - greenChannel = serObj.FindProperty ("greenChannel"); - blueChannel = serObj.FindProperty ("blueChannel"); - - useDepthCorrection = serObj.FindProperty ("useDepthCorrection"); - - zCurveChannel = serObj.FindProperty ("zCurve"); - - depthRedChannel = serObj.FindProperty ("depthRedChannel"); - depthGreenChannel = serObj.FindProperty ("depthGreenChannel"); - depthBlueChannel = serObj.FindProperty ("depthBlueChannel"); - - serObj.ApplyModifiedProperties (); - - selectiveCc = serObj.FindProperty ("selectiveCc"); - selectiveFromColor = serObj.FindProperty ("selectiveFromColor"); - selectiveToColor = serObj.FindProperty ("selectiveToColor"); - - excludeLayers = serObj.FindProperty("excludeLayers"); - - - } - - void CurveGui ( string name, SerializedProperty animationCurve, Color color) { - // @NOTE: EditorGUILayout.CurveField is buggy and flickers, using PropertyField for now - //animationCurve.animationCurveValue = EditorGUILayout.CurveField (GUIContent (name), animationCurve.animationCurveValue, color, Rect (0.0f,0.0f,1.0f,1.0f)); - EditorGUILayout.PropertyField (animationCurve, new GUIContent (name)); - if (GUI.changed) - applyCurveChanges = true; - } - - void BeginCurves () { - applyCurveChanges = false; - } - - void ApplyCurves () { - if (applyCurveChanges) { - serObj.ApplyModifiedProperties (); - (serObj.targetObject as ColorCorrectionCurvesLayers).gameObject.SendMessage ("UpdateTextures"); - } - } - - - public override void OnInspectorGUI () { - serObj.Update (); - - GUILayout.Label ("Use curves to tweak RGB channel colors", EditorStyles.miniBoldLabel); - - saturation.floatValue = EditorGUILayout.Slider( "Saturation", saturation.floatValue, 0.0f, 5.0f); - - EditorGUILayout.PropertyField (mode, new GUIContent ("Mode")); - EditorGUILayout.Separator (); - - BeginCurves (); - - CurveGui (" Red", redChannel, Color.red); - CurveGui (" Green", greenChannel, Color.green); - CurveGui (" Blue", blueChannel, Color.blue); - - EditorGUILayout.Separator (); - - if (mode.intValue > 0) - useDepthCorrection.boolValue = true; - else - useDepthCorrection.boolValue = false; - - if (useDepthCorrection.boolValue) { - CurveGui (" Red (depth)", depthRedChannel, Color.red); - CurveGui (" Green (depth)", depthGreenChannel, Color.green); - CurveGui (" Blue (depth)", depthBlueChannel, Color.blue); - EditorGUILayout.Separator (); - CurveGui (" Blend Curve", zCurveChannel, Color.grey); - } - - EditorGUILayout.Separator (); - EditorGUILayout.PropertyField (selectiveCc, new GUIContent ("Selective")); - if (selectiveCc.boolValue) { - EditorGUILayout.PropertyField (selectiveFromColor, new GUIContent (" Key")); - EditorGUILayout.PropertyField (selectiveToColor, new GUIContent (" Target")); - } - - EditorGUILayout.PropertyField(excludeLayers, new GUIContent(" ExcludeLayers")); - - ApplyCurves(); - - if (!applyCurveChanges) - serObj.ApplyModifiedProperties (); - } - } -} diff --git a/Assets/Scripts/Editor/ImageEffects/ColorCorrectionCurvesEditorLayers.meta b/Assets/Scripts/Editor/ImageEffects/ColorCorrectionCurvesEditorLayers.meta deleted file mode 100644 index 07b343c..0000000 --- a/Assets/Scripts/Editor/ImageEffects/ColorCorrectionCurvesEditorLayers.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 71cb5aca4636e344db9f91f7236a532e -timeCreated: 1500793398 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/README.md b/Assets/Scripts/Editor/README.md deleted file mode 100644 index bbcec7e..0000000 --- a/Assets/Scripts/Editor/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Editor Scripts -Extend the Unity Editor with the power of Community. - -Experiencing errors and problems, no worry, [File them, and let us fix them](https://github.com/UnityCommunity/UnityLibrary/issues) - -## License -[MIT](https://github.com/UnityCommunity/UnityLibrary/blob/master/LICENSE.md) @ [Unity Community](https://github.com/UnityCommunity/) - -Made with :heart: by [Unity Community](https://github.com/UnityCommunity/) diff --git a/Assets/Scripts/Editor/README.md.meta b/Assets/Scripts/Editor/README.md.meta deleted file mode 100644 index 1bd5cc5..0000000 --- a/Assets/Scripts/Editor/README.md.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d99cb649a69348c42b9a6e8d62766538 -timeCreated: 1500793397 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/SetPivot.cs b/Assets/Scripts/Editor/SetPivot.cs deleted file mode 100644 index 33663ed..0000000 --- a/Assets/Scripts/Editor/SetPivot.cs +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Version: 1.0 - * Author: Yilmaz Kiymaz (@VoxelBoy) - * Purpose: To be able to change the pivot of Game Objects - * without needing to use a separate 3D application. - * License: Free to use and distribute, in both free and commercial projects. - * Do not try to sell as your own work. Simply put, play nice :) - * Contact: VoxelBoy on Unity Forums - */ - -/* - * TODO: - * - Doesn't work properly with rotated objects. - * - Can't compensate for the positioning of Mesh Colliders. - * - Need to figure out if the "Instantiating mesh" error in Editor is a big issue, if not, how to supress it. - * - Allowing the pivot to move outside the bounds of the mesh, ideally using the movement gizmo but only affecting the pivot. - */ - - -using UnityEngine; -using UnityEditor; -namespace UnityLibrary -{ - public class SetPivot : EditorWindow - { - - Vector3 p; //Pivot value -1..1, calculated from Mesh bounds - Vector3 last_p; //Last used pivot - - GameObject obj; //Selected object in the Hierarchy - MeshFilter meshFilter; //Mesh Filter of the selected object - Mesh mesh; //Mesh of the selected object - Collider col; //Collider of the selected object - - bool pivotUnchanged; //Flag to decide when to instantiate a copy of the mesh - - [MenuItem("GameObject/Set Pivot")] //Place the Set Pivot menu item in the GameObject menu - static void Init() - { - SetPivot window = (SetPivot)EditorWindow.GetWindow(typeof(SetPivot)); - window.RecognizeSelectedObject(); //Initialize the variables by calling RecognizeSelectedObject on the class instance - window.Show(); - } - - void OnGUI() - { - if (obj) - { - if (mesh) - { - p.x = EditorGUILayout.Slider("X", p.x, -1.0f, 1.0f); - p.y = EditorGUILayout.Slider("Y", p.y, -1.0f, 1.0f); - p.z = EditorGUILayout.Slider("Z", p.z, -1.0f, 1.0f); - if (p != last_p) - { //Detects user input on any of the three sliders - //Only create instance of mesh when user changes pivot - if (pivotUnchanged) mesh = meshFilter.mesh; pivotUnchanged = false; - UpdatePivot(); - last_p = p; - } - if (GUILayout.Button("Center")) - { //Set pivot to the center of the mesh bounds - //Only create instance of mesh when user changes pivot - if (pivotUnchanged) mesh = meshFilter.mesh; pivotUnchanged = false; - p = Vector3.zero; - UpdatePivot(); - last_p = p; - } - GUILayout.Label("Bounds " + mesh.bounds.ToString()); - } - else - { - GUILayout.Label("Selected object does not have a Mesh specified."); - } - } - else - { - GUILayout.Label("No object selected in Hierarchy."); - } - } - - //Achieve the movement of the pivot by moving the transform position in the specified direction - //and then moving all vertices of the mesh in the opposite direction back to where they were in world-space - void UpdatePivot() - { - Vector3 diff = Vector3.Scale(mesh.bounds.extents, last_p - p); //Calculate difference in 3d position - obj.transform.position -= Vector3.Scale(diff, obj.transform.localScale); //Move object position by taking localScale into account - //Iterate over all vertices and move them in the opposite direction of the object position movement - Vector3[] verts = mesh.vertices; - for (int i = 0; i < verts.Length; i++) - { - verts[i] += diff; - } - mesh.vertices = verts; //Assign the vertex array back to the mesh - mesh.RecalculateBounds(); //Recalculate bounds of the mesh, for the renderer's sake - //The 'center' parameter of certain colliders needs to be adjusted - //when the transform position is modified - if (col) - { - if (col is BoxCollider) - { - ((BoxCollider)col).center += diff; - } - else if (col is CapsuleCollider) - { - ((CapsuleCollider)col).center += diff; - } - else if (col is SphereCollider) - { - ((SphereCollider)col).center += diff; - } - } - } - - //Look at the object's transform position in comparison to the center of its mesh bounds - //and calculate the pivot values for xyz - void UpdatePivotVector() - { - Bounds b = mesh.bounds; - Vector3 offset = -1 * b.center; - p = last_p = new Vector3(offset.x / b.extents.x, offset.y / b.extents.y, offset.z / b.extents.z); - } - - //When a selection change notification is received - //recalculate the variables and references for the new object - void OnSelectionChange() - { - RecognizeSelectedObject(); - } - - //Gather references for the selected object and its components - //and update the pivot vector if the object has a Mesh specified - void RecognizeSelectedObject() - { - Transform t = Selection.activeTransform; - obj = t ? t.gameObject : null; - if (obj) - { - meshFilter = obj.GetComponent(typeof(MeshFilter)) as MeshFilter; - mesh = meshFilter ? meshFilter.sharedMesh : null; - if (mesh) - UpdatePivotVector(); - col = obj.GetComponent(typeof(Collider)) as Collider; - pivotUnchanged = true; - } - else - { - mesh = null; - } - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Editor/SetPivot.cs.meta b/Assets/Scripts/Editor/SetPivot.cs.meta deleted file mode 100644 index f2c0f24..0000000 --- a/Assets/Scripts/Editor/SetPivot.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a41d285eb1e4e5148a8eb9faf1d929ec -timeCreated: 1500793403 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/SpriteBackgroundRemover.cs b/Assets/Scripts/Editor/SpriteBackgroundRemover.cs deleted file mode 100644 index 295324c..0000000 --- a/Assets/Scripts/Editor/SpriteBackgroundRemover.cs +++ /dev/null @@ -1,161 +0,0 @@ -// original script : http://answers.unity3d.com/answers/252528/view.html - -// Usage: Place this script in Editor/ folder -// Start the tool from menu, Window/Tools/Alpha-fy Images - -using UnityEngine; -using UnityEditor; -using System.IO; -namespace UnityLibrary -{ - public class SpriteBackgroundRemover : EditorWindow - { - Texture2D img; - Texture2D newImg; - Color colorToRemove = Color.magenta; - public static SpriteBackgroundRemover win; - - [MenuItem("Window/Tools/Alpha-fy Images")] - static void Init() - { - win = ScriptableObject.CreateInstance(typeof(SpriteBackgroundRemover)) as SpriteBackgroundRemover; - win.minSize = new Vector2(300, 350); - win.ShowUtility(); - } - - void OnGUI() - { - GUILayout.BeginHorizontal(); - - /** Toolbar **/ - GUILayout.BeginVertical(); - img = (Texture2D)EditorGUILayout.ObjectField(img, typeof(Texture2D), false, GUILayout.MinWidth(128), GUILayout.MinHeight(128), GUILayout.MaxWidth(128), GUILayout.MaxHeight(128)); - - colorToRemove = EditorGUILayout.ColorField(colorToRemove, GUILayout.MaxWidth(128)); - - if (GUILayout.Button("Preview", GUILayout.MinWidth(128), GUILayout.MinHeight(32), GUILayout.MaxWidth(128), GUILayout.MaxHeight(128))) - newImg = RemoveColor(colorToRemove, img); - - if (GUILayout.Button("Alpha-fy All", GUILayout.MinWidth(128), GUILayout.MinHeight(32), GUILayout.MaxWidth(128), GUILayout.MaxHeight(128))) - RemoveColor(colorToRemove, (UnityEngine.Object[])Selection.GetFiltered(typeof(Texture2D), SelectionMode.Assets)); - - GUILayout.EndVertical(); - - GUILayout.BeginVertical(); - GUILayout.Label("Selected Files", EditorStyles.boldLabel); - foreach (Texture2D selected in Selection.GetFiltered(typeof(Texture2D), SelectionMode.Assets)) - { - GUILayout.Label(selected.name); - } - GUILayout.EndVertical(); - - /** Image Display **/ - GUILayout.BeginVertical(); - GUILayout.Label("Preview", EditorStyles.boldLabel); - if (newImg) - { - GUILayout.Label(newImg); - } - GUILayout.EndVertical(); - - GUILayout.EndHorizontal(); - - } - - // for multiple images - void RemoveColor(Color c, UnityEngine.Object[] imgs) - { - if (!Directory.Exists("Assets/AlphaImages/")) - { - Directory.CreateDirectory("Assets/AlphaImages/"); - } - - float inc = 0f; - foreach (Texture2D i in imgs) - { - inc++; - if (inc % 512 == 0 && EditorUtility.DisplayCancelableProgressBar("Playin' With Pixels", "Seaching for Color Matches", ((float)inc / (float)imgs.Length))) - { - Debug.LogError("Cancelled.."); - break; - } - - CheckTextureSettings(i); - - Color[] pixels = i.GetPixels(0, 0, i.width, i.height, 0); - var clear = new Color(0, 0, 0, 0); - - for (int p = 0; p < pixels.Length; p++) - { - if (pixels[p] == c) - { - pixels[p] = clear; - } - } - - Texture2D n = new Texture2D(i.width, i.height); - n.SetPixels(0, 0, i.width, i.height, pixels, 0); - n.Apply(); - - byte[] bytes = n.EncodeToPNG(); - File.WriteAllBytes("Assets/AlphaImages/" + i.name + "_alpha.png", bytes); - } - - EditorUtility.ClearProgressBar(); - - AssetDatabase.SaveAssets(); - AssetDatabase.Refresh(); - } - - // for single image - Texture2D RemoveColor(Color c, Texture2D i) - { - CheckTextureSettings(i); - - Color[] pixels = i.GetPixels(0, 0, i.width, i.height, 0); - - var clear = new Color(0, 0, 0, 0); - - for (int p = 0; p < pixels.Length; p++) - { - if (p % 512 == 0 && EditorUtility.DisplayCancelableProgressBar("Playin' With Pixels", "Seaching for Color Matches", ((float)p / pixels.Length))) - { - Debug.LogError("Cancelled.."); - break; - } - - if (pixels[p] == c) - { - pixels[p] = clear; - } - - } - - Texture2D n = new Texture2D(i.width, i.height); - n.SetPixels(0, 0, i.width, i.height, pixels, 0); - n.Apply(); - EditorUtility.ClearProgressBar(); - return (n); - } - - public void CheckTextureSettings(Texture2D texture) - { - if (texture == null) { Debug.LogError("CheckTextureSettings Failed - Texture is null"); return; } - - string path = AssetDatabase.GetAssetPath(texture); - if (string.IsNullOrEmpty(path)) { Debug.LogError("CheckTextureSettings Failed - Texture path is null"); return; } - - TextureImporter textureImporter = AssetImporter.GetAtPath(path) as TextureImporter; - - if (!textureImporter.isReadable) - { - Debug.Log("Enabling read/write for image " + path); - // textureImporter.mipmapEnabled = false; - textureImporter.isReadable = true; - AssetDatabase.ImportAsset(path, ImportAssetOptions.ForceUpdate); - } - - } - - } -} diff --git a/Assets/Scripts/Editor/SpriteBackgroundRemover.cs.meta b/Assets/Scripts/Editor/SpriteBackgroundRemover.cs.meta deleted file mode 100644 index 8945f25..0000000 --- a/Assets/Scripts/Editor/SpriteBackgroundRemover.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 2737bc699c1d92f4ca840a5dc0992efa -timeCreated: 1500793401 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/Tools.meta b/Assets/Scripts/Editor/Tools.meta deleted file mode 100644 index ff5a06e..0000000 --- a/Assets/Scripts/Editor/Tools.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 2a517a11ecc7f514381fcf9318d8fbfa -folderAsset: yes -timeCreated: 1500793396 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/Tools/ColorPickerWindow.cs b/Assets/Scripts/Editor/Tools/ColorPickerWindow.cs deleted file mode 100644 index 3290be2..0000000 --- a/Assets/Scripts/Editor/Tools/ColorPickerWindow.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEditor; - -public class ColorPickerWindow : EditorWindow -{ - - protected Color color = Color.white; - protected Color32 color32 = new Color32 ( 255, 255, 255, 255 ); - protected string hexCode = "FFFFFF"; - - [MenuItem ( "Tools/Color Picker" )] - public static void Init () - { - var window = EditorWindow.GetWindow ( "Color Picker" ); - window.Show (); - } - - protected virtual void OnGUI () - { - this.color = EditorGUILayout.ColorField ( "Color", this.color ); - if ( GUI.changed ) - { - this.color32 = this.color; - this.hexCode = ColorUtility.ToHtmlStringRGB ( this.color ); - } - this.hexCode = EditorGUILayout.TextField ( "Hex Code", this.hexCode ); - if ( GUI.changed ) - { - ColorUtility.TryParseHtmlString ( this.hexCode, out this.color ); - } - this.color32.r = ( byte )EditorGUILayout.IntSlider ( "Red", this.color32.r, 0, 255 ); - this.color32.g = ( byte )EditorGUILayout.IntSlider ( "Green", this.color32.g, 0, 255 ); - this.color32.b = ( byte )EditorGUILayout.IntSlider ( "Blue", this.color32.b, 0, 255 ); - this.color32.a = ( byte )EditorGUILayout.IntSlider ( "Alpha", this.color32.a, 0, 255 ); - if ( GUI.changed ) - { - this.color = this.color32; - this.hexCode = ColorUtility.ToHtmlStringRGB ( this.color ); - } - EditorGUILayout.TextField ( - "Color Code", - string.Format ( - "new Color ( {0}f, {1}f, {2}f, {3}f )", - this.color.r, - this.color.g, - this.color.b, - this.color.a ) ); - EditorGUILayout.TextField ( - "Color32 Code", - string.Format ( - "new Color32 ( {0}, {1}, {2}, {3} )", - this.color32.r, - this.color32.g, - this.color32.b, - this.color32.a ) ); - } - -} diff --git a/Assets/Scripts/Editor/Tools/CopyPasteHelper.cs b/Assets/Scripts/Editor/Tools/CopyPasteHelper.cs deleted file mode 100644 index aca2a8b..0000000 --- a/Assets/Scripts/Editor/Tools/CopyPasteHelper.cs +++ /dev/null @@ -1,200 +0,0 @@ -using UnityEditor; -using UnityEngine; -using System.IO; -using System; -using Object = UnityEngine.Object; - -// Editor tool to easily paste scripts from web (automagically creates new file) -// original source: https://unitycoder.com/blog/2017/07/12/editor-plugin-paste-script-to-file/ -// additional browser helper (add copy button to unity docs) https://unitycoder.com/blog/2017/07/13/browser-plugin-add-copy-button-to-unity-scripting-docs/ - -namespace UnityLibrary -{ - public class CopyPasteHelper : EditorWindow - { - // settings: output folder is set as Assets/Scripts/Paste/ - // TODO: need to support shaders folder too - static string baseFolder = "Scripts"; - static string subFolder = "Paste"; - - - [MenuItem("Window/UnityLibrary/CopyPasteHelper")] - public static void ShowWindow() - { - //Show existing window instance. If one doesn't exist, make one. - var window = EditorWindow.GetWindow(typeof(CopyPasteHelper)); - window.titleContent = new GUIContent("CopyPasteHelper"); - window.minSize = new Vector2(64, 24); - } - - // mainloop - void OnGUI() - { - if (GUILayout.Button("Paste", GUILayout.Width(44))) - { - PasteToFile(); - } - } - - static void PasteToFile() - { - // combine paths, TODO: cleanup - var mainFolder = Application.dataPath + Path.DirectorySeparatorChar + baseFolder + Path.DirectorySeparatorChar; - var childFolder = subFolder + Path.DirectorySeparatorChar; - - // check folders and create them if missing - if (Directory.Exists(mainFolder) == false) - { - Debug.Log("Creating missing folder: " + mainFolder); - AssetDatabase.CreateFolder("Assets", baseFolder); - } - if (Directory.Exists(mainFolder + childFolder) == false) - { - Debug.Log("Creating missing folder: " + mainFolder + childFolder); - AssetDatabase.CreateFolder("Assets" + Path.DirectorySeparatorChar + baseFolder, subFolder); - } - - // get clipboard text - var clipboardString = ReadClipboard(); - if (string.IsNullOrEmpty(clipboardString.Trim())) - { - Debug.LogError("Nothing to paste.."); - return; - } - - // TODO: check if its editor script, then place to editor/ folder - - var fileName = GetFileName(clipboardString); - var fullPath = mainFolder + childFolder + fileName; - - // TODO: fix line endings (so that there wont be visual studio popup) - - // confirm overwrite dialog - if (File.Exists(fullPath) == true) - { - // TODO: add option to autorename file (and class name) - if (EditorUtility.DisplayDialog("Copy Paste Helper", "Replace existing file: " + fullPath, "Replace", "Cancel") == false) - { - return; - } - } - - // save to file - File.WriteAllText(fullPath, clipboardString, System.Text.Encoding.Default); - Debug.Log("CopyPasteHelper Script saved at: " + fullPath); - - AssetDatabase.Refresh(); - - // FIXME: script compilation can fail here if it was bad script, then the lines below wont run? - - // show-select created asset - Object newScript = AssetDatabase.LoadAssetAtPath("Assets" + Path.DirectorySeparatorChar + baseFolder + Path.DirectorySeparatorChar + subFolder + Path.DirectorySeparatorChar + fileName, typeof(Object)); - EditorGUIUtility.PingObject(newScript); - - // FIXME: this doesnt work, file is still there but becomes zombie (have to delete through explorer..) - // Undo.RegisterCreatedObjectUndo(newScript, "CopyPaste Helper object creation"); - } - - - // paste text to temporary texteditor and then get text - static string ReadClipboard() - { - TextEditor textEditor = new TextEditor(); - textEditor.multiline = true; - textEditor.Paste(); - return textEditor.text; - } - - - // returns class name (or shader name) and file extension .cs or .shader - static string GetFileName(string str) - { - var fileName = "NewScript"; - var fileExtension = ".cs"; - - // check if this looks like c# or shader - if (str.IndexOf("using ") > -1 || str.IndexOf("class ") > -1 || str.IndexOf("namespace ") > -1) - { - // should be c#, try to get class name - // NOTE: this would fail if comment lines have same "class " string - var classSplit = str.Split(new string[] { "class " }, StringSplitOptions.None); - - var index = 0; - var looping = true; - while (looping == true) - { - var c = classSplit[1].Substring(index++, 1); - // check characters until hit end of class name - switch (c) - { - case " ": - case ":": - case "{": - case "\t": - case ",": - case "\r": - case "\n": - looping = false; - break; - default: - break; - } - - if (index >= classSplit[1].Length) - { - fileName = "NewScript"; // default.. - Debug.LogError("Failed parsing class name.."); - looping = false; - index = -1; - } - } - - // we founded end of class name - if (index > 0) - { - fileName = classSplit[1].Substring(0, --index); - } else - { - Debug.LogError("Failed parsing class name.."); - } - - } else if (str.IndexOf("Shader ") > -1 || str.IndexOf("SubShader") > -1 || str.IndexOf("CGPROGRAM") > -1) - { - fileName = "NewShader"; - - // probably its shader then, get name - // TODO: this would fail if name starts without space: 'Shader"myshader..' - var classSplit = str.Split(new string[] { "Shader " }, StringSplitOptions.None); - - if (classSplit.Length > 0) - { - var shaderNameSplit = classSplit[1].Split('"'); - - if (shaderNameSplit.Length > 1) - { - // TODO: this takes the whole shader name string, custom/some/more/here.shader, could take name without path - fileName = shaderNameSplit[1]; - } else - { - Debug.LogError("Failed parsing shader name.."); - } - } else - { - Debug.LogError("Failed parsing shader name.."); - } - - fileExtension = ".shader"; - } else - { - // unknown format - Debug.LogError("Unknown format..saving as default c#"); - } - - // just to be sure, cleanup illegal characters from filename, https://stackoverflow.com/a/13617375/5452781 - var invalidChars = Path.GetInvalidFileNameChars(); - fileName = string.Join("_", fileName.Split(invalidChars, StringSplitOptions.RemoveEmptyEntries)).TrimEnd('.'); - - return fileName + fileExtension; - } - } -} diff --git a/Assets/Scripts/Editor/Tools/CopyPasteHelper.cs.meta b/Assets/Scripts/Editor/Tools/CopyPasteHelper.cs.meta deleted file mode 100644 index f4742ce..0000000 --- a/Assets/Scripts/Editor/Tools/CopyPasteHelper.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a02af6a99d72383438d6fdca2684b2cf -timeCreated: 1500793403 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/Tools/GetSelectedMeshInfo.cs b/Assets/Scripts/Editor/Tools/GetSelectedMeshInfo.cs deleted file mode 100644 index 06aba89..0000000 --- a/Assets/Scripts/Editor/Tools/GetSelectedMeshInfo.cs +++ /dev/null @@ -1,52 +0,0 @@ -// display selected gameobject mesh stats (should work on prefabs,models in project window also) - -using UnityEditor; -using UnityEngine; - -namespace UnityLibrary -{ - public class GetSelectedMeshInfo : EditorWindow - { - [MenuItem("Tools/UnityLibrary/GetMeshInfo")] - public static void ShowWindow() - { - var window = GetWindow(typeof(GetSelectedMeshInfo)); - window.titleContent = new GUIContent("MeshInfo"); - } - - void OnGUI() - { - var selection = Selection.activeGameObject; - - if (selection != null) - { - EditorGUILayout.LabelField("Selected: " + selection.name); - - int totalMeshes = 0; - int totalVertices = 0; - int totalTris = 0; - - // get all meshes - var meshes = selection.GetComponentsInChildren(); - for (int i = 0, length = meshes.Length; i < length; i++) - { - totalVertices += meshes[i].sharedMesh.vertexCount; - totalTris += meshes[i].sharedMesh.triangles.Length; - totalMeshes++; - } - - // display stats - EditorGUILayout.LabelField("Meshes: " + totalMeshes); - EditorGUILayout.LabelField("Vertices: " + totalVertices); - EditorGUILayout.LabelField("Triangles: " + totalTris); - } - - } - - void OnSelectionChange() - { - // force redraw window - Repaint(); - } - } -} diff --git a/Assets/Scripts/Editor/Tools/GetSelectedMeshInfo.cs.meta b/Assets/Scripts/Editor/Tools/GetSelectedMeshInfo.cs.meta deleted file mode 100644 index 8d74757..0000000 --- a/Assets/Scripts/Editor/Tools/GetSelectedMeshInfo.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: eff5480c5ab3f114792d467d0ad841c1 -timeCreated: 1511611021 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/Tools/SceneManagerWindow.cs b/Assets/Scripts/Editor/Tools/SceneManagerWindow.cs deleted file mode 100644 index 6543586..0000000 --- a/Assets/Scripts/Editor/Tools/SceneManagerWindow.cs +++ /dev/null @@ -1,181 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.SceneManagement; -using UnityEditor; -using UnityEditor.SceneManagement; - -public class SceneManagerWindow : EditorWindow -{ - - protected Vector2 scrollPosition; - protected NewSceneSetup newSceneSetup = NewSceneSetup.DefaultGameObjects; - protected NewSceneMode newSceneMode = NewSceneMode.Single; - protected OpenSceneMode openSceneMode = OpenSceneMode.Single; - protected bool showPath = false; - protected bool showAddToBuild = true; - protected bool askBeforeDelete = true; - protected bool [] selectedScenes; - protected string [] guids; - - [MenuItem ( "Tools/Scene Manager" )] - public static void Init () - { - var window = EditorWindow.GetWindow ( "Scene Manager" ); - window.Show (); - } - - protected virtual void OnGUI () - { - List buildScenes = new List ( EditorBuildSettings.scenes ); - GUILayout.Label ( "Scenes", EditorStyles.boldLabel ); - this.guids = AssetDatabase.FindAssets ( "t:Scene" ); - if ( this.selectedScenes == null || this.selectedScenes.Length != guids.Length ) - { - this.selectedScenes = new bool[guids.Length]; - } - this.scrollPosition = EditorGUILayout.BeginScrollView ( this.scrollPosition ); - EditorGUILayout.BeginVertical (); - for ( int i = 0; i < guids.Length; i++ ) - { - string path = AssetDatabase.GUIDToAssetPath ( guids [ i ] ); - SceneAsset sceneAsset = AssetDatabase.LoadAssetAtPath ( path ); - EditorBuildSettingsScene buildScene = buildScenes.Find ( (editorBuildScene ) => - { - return editorBuildScene.path == path; - } ); - Scene scene = SceneManager.GetSceneByPath ( path ); - bool isOpen = scene.IsValid () && scene.isLoaded; - EditorGUILayout.BeginHorizontal (); - this.selectedScenes [ i ] = EditorGUILayout.Toggle ( this.selectedScenes [ i ], GUILayout.Width ( 15 ) ); - if ( isOpen ) - { - GUILayout.Label ( sceneAsset.name, EditorStyles.whiteLabel ); - } - else - { - GUILayout.Label ( sceneAsset.name, EditorStyles.wordWrappedLabel ); - } - if ( this.showPath ) - { - GUILayout.Label ( path, EditorStyles.wordWrappedLabel ); - } - if ( buildScene == null ) - { - if ( this.showAddToBuild ) - { - if ( GUILayout.Button ( "Add to Build" ) ) - { - AddToBuild ( path ); - } - } - } - if ( GUILayout.Button ( isOpen ? "Close" : "Open", GUILayout.Width ( 50 ) ) ) - { - if ( isOpen ) - { - EditorSceneManager.CloseScene ( scene, true ); - } - else - { - Open ( path ); - } - } - if ( GUILayout.Button ( "Delete", GUILayout.Width ( 50 ) ) ) - { - Delete ( path ); - } - EditorGUILayout.EndHorizontal (); - } - if ( GUILayout.Button ( "Create New Scene" ) ) - { - Scene newScene = EditorSceneManager.NewScene ( this.newSceneSetup, this.newSceneMode ); - EditorSceneManager.SaveScene ( newScene ); - } - EditorGUILayout.EndVertical (); - EditorGUILayout.EndScrollView (); - GUILayout.Label ( "Bulk Actions", EditorStyles.boldLabel ); - bool anySelected = false; - for ( int i = 0; i < this.selectedScenes.Length; i++ ) - { - anySelected |= this.selectedScenes [ i ]; - } - GUI.enabled = anySelected; - EditorGUILayout.BeginHorizontal (); - if ( GUILayout.Button ( "Delete" ) ) - { - for ( int i = 0; i < this.selectedScenes.Length; i++ ) - { - if ( this.selectedScenes [ i ] ) - { - Delete ( AssetDatabase.GUIDToAssetPath ( this.guids [ i ] ) ); - } - } - } - if ( GUILayout.Button ( "Open Additive" ) ) - { - OpenSceneMode openMode = this.openSceneMode; - this.openSceneMode = OpenSceneMode.Additive; - for ( int i = 0; i < this.selectedScenes.Length; i++ ) - { - if ( this.selectedScenes [ i ] ) - { - Open ( AssetDatabase.GUIDToAssetPath ( this.guids [ i ] ) ); - } - } - this.openSceneMode = openMode; - } - EditorGUILayout.EndHorizontal (); - GUI.enabled = true; - GUILayout.Label ( "Actions", EditorStyles.boldLabel ); - EditorGUILayout.BeginHorizontal (); - if ( GUILayout.Button ( "Save Modified Scenes" ) ) - { - EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo (); - } - if ( GUILayout.Button ( "Save Open Scenes" ) ) - { - EditorSceneManager.SaveOpenScenes (); - } - EditorGUILayout.EndHorizontal (); - GUILayout.Label ( "Settings", EditorStyles.boldLabel ); - this.newSceneSetup = ( NewSceneSetup )EditorGUILayout.EnumPopup ( "New Scene Setup", this.newSceneSetup ); - this.newSceneMode = ( NewSceneMode )EditorGUILayout.EnumPopup ( "New Scene Mode", this.newSceneMode ); - this.openSceneMode = ( OpenSceneMode )EditorGUILayout.EnumPopup ( "Open Scene Mode", this.openSceneMode ); - this.showPath = EditorGUILayout.Toggle ( "Show Path", this.showPath ); - this.showAddToBuild = EditorGUILayout.Toggle ( "Show Add To Build", this.showAddToBuild ); - this.askBeforeDelete = EditorGUILayout.Toggle ( "Ask Before Delete", this.askBeforeDelete ); - } - - public virtual void Open ( string path ) - { - if ( EditorSceneManager.EnsureUntitledSceneHasBeenSaved ( "You don't have saved the Untitled Scene, Do you want to leave?" ) ) - { - EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo (); - EditorSceneManager.OpenScene ( path, this.openSceneMode ); - } - } - - public virtual void Delete ( string path ) - { - if ( !askBeforeDelete || EditorUtility.DisplayDialog ( - "Delete Scene", - string.Format ( - "Are you sure you want to delete the below scene: {0}", - path ), - "Delete", - "Cancel" ) ) - { - AssetDatabase.DeleteAsset ( path ); - AssetDatabase.Refresh (); - } - } - - public virtual void AddToBuild ( string path ) - { - List scenes = new List ( EditorBuildSettings.scenes ); - scenes.Add ( new EditorBuildSettingsScene ( path, true ) ); - EditorBuildSettings.scenes = scenes.ToArray (); - } - -} diff --git a/Assets/Scripts/Editor/Tools/SceneSwitcherWindow.cs b/Assets/Scripts/Editor/Tools/SceneSwitcherWindow.cs deleted file mode 100644 index e78a0bd..0000000 --- a/Assets/Scripts/Editor/Tools/SceneSwitcherWindow.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.SceneManagement; -using UnityEditor; -using UnityEditor.SceneManagement; - -public class SceneSwitcherWindow : EditorWindow -{ - - public enum ScenesSource - { - Assets, - BuildSettings - } - - protected Vector2 scrollPosition; - protected ScenesSource scenesSource = ScenesSource.Assets; - protected OpenSceneMode openSceneMode = OpenSceneMode.Single; - - [MenuItem ( "Tools/Scene Switcher" )] - public static void Init () - { - var window = EditorWindow.GetWindow ( "Scene Switcher" ); - window.Show (); - } - - protected virtual void OnGUI () - { - List buildScenes = new List ( EditorBuildSettings.scenes ); - this.scenesSource = ( ScenesSource )EditorGUILayout.EnumPopup ( "Scenes Source", this.scenesSource ); - this.openSceneMode = ( OpenSceneMode )EditorGUILayout.EnumPopup ( "Open Scene Mode", this.openSceneMode ); - GUILayout.Label ( "Scenes", EditorStyles.boldLabel ); - string [] guids = AssetDatabase.FindAssets ( "t:Scene" ); - this.scrollPosition = EditorGUILayout.BeginScrollView ( this.scrollPosition ); - EditorGUILayout.BeginVertical (); - for ( int i = 0; i < guids.Length; i++ ) - { - string path = AssetDatabase.GUIDToAssetPath ( guids [ i ] ); - SceneAsset sceneAsset = AssetDatabase.LoadAssetAtPath ( path ); - EditorBuildSettingsScene buildScene = buildScenes.Find ( (editorBuildScene ) => - { - return editorBuildScene.path == path; - } ); - Scene scene = SceneManager.GetSceneByPath ( path ); - bool isOpen = scene.IsValid () && scene.isLoaded; - GUI.enabled = !isOpen; - if ( this.scenesSource == ScenesSource.Assets ) - { - if ( GUILayout.Button ( sceneAsset.name ) ) - { - Open ( path ); - } - } - else - { - if ( buildScene != null ) - { - if ( GUILayout.Button ( sceneAsset.name ) ) - { - Open ( path ); - } - } - } - GUI.enabled = true; - } - if ( GUILayout.Button ( "Create New Scene" ) ) - { - Scene newScene = EditorSceneManager.NewScene ( NewSceneSetup.DefaultGameObjects, NewSceneMode.Single ); - EditorSceneManager.SaveScene ( newScene ); - } - EditorGUILayout.EndVertical (); - EditorGUILayout.EndScrollView (); - } - - public virtual void Open ( string path ) - { - if ( EditorSceneManager.EnsureUntitledSceneHasBeenSaved ( "You don't have saved the Untitled Scene, Do you want to leave?" ) ) - { - EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo (); - EditorSceneManager.OpenScene ( path, this.openSceneMode ); - } - } - -} diff --git a/Assets/Scripts/Editor/UI.meta b/Assets/Scripts/Editor/UI.meta deleted file mode 100644 index 97b5f19..0000000 --- a/Assets/Scripts/Editor/UI.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: ae079ea44417ab84fa840a15feb4daca -folderAsset: yes -timeCreated: 1500793397 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/UI/CanvasScalerUtil.meta b/Assets/Scripts/Editor/UI/CanvasScalerUtil.meta deleted file mode 100644 index 8cdd599..0000000 --- a/Assets/Scripts/Editor/UI/CanvasScalerUtil.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 4506db3ef67122146adf637a6b43e8eb -folderAsset: yes -timeCreated: 1500793397 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/UI/CanvasScalerUtil/CanvasScalerUtil.cs b/Assets/Scripts/Editor/UI/CanvasScalerUtil/CanvasScalerUtil.cs deleted file mode 100644 index 69ba7a9..0000000 --- a/Assets/Scripts/Editor/UI/CanvasScalerUtil/CanvasScalerUtil.cs +++ /dev/null @@ -1,33 +0,0 @@ -using UnityEngine; - -/// -/// Author: https://github.com/Sacristan -/// Script to hastily create correct canvas scales. Logic handled at editor's side -/// -namespace UnityLibrary -{ - [RequireComponent(typeof(Canvas))] - public class CanvasScalerUtil : MonoBehaviour - { - [SerializeField] - private uint canvasWidth = 800; - - [SerializeField] - private uint canvasHeight = 600; - - [SerializeField] - private float canvasWorldSizeInMeters = 1; - - public uint CanvasWidth { get { return canvasWidth; } } - public uint CanvasHeight { get { return canvasHeight; } } - public float CanvasWorldSizeInMeters { get { return canvasWorldSizeInMeters; } } - - #region MonoBehaviour - private void Awake() - { - Debug.Log("CanvasScalerUtil has nothing to do with realtime logic"); - Destroy(this); - } - #endregion - } -} \ No newline at end of file diff --git a/Assets/Scripts/Editor/UI/CanvasScalerUtil/CanvasScalerUtil.cs.meta b/Assets/Scripts/Editor/UI/CanvasScalerUtil/CanvasScalerUtil.cs.meta deleted file mode 100644 index 109bcdc..0000000 --- a/Assets/Scripts/Editor/UI/CanvasScalerUtil/CanvasScalerUtil.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: bdd93193cc75c9d4f8fc66423ec514b9 -timeCreated: 1499173346 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/UI/CanvasScalerUtil/Editor.meta b/Assets/Scripts/Editor/UI/CanvasScalerUtil/Editor.meta deleted file mode 100644 index 73f3ef5..0000000 --- a/Assets/Scripts/Editor/UI/CanvasScalerUtil/Editor.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: b598d8a9158f9fe4080b54101474f951 -folderAsset: yes -timeCreated: 1499174027 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/UI/CanvasScalerUtil/Editor/CanvasScalerUtilEditor.cs b/Assets/Scripts/Editor/UI/CanvasScalerUtil/Editor/CanvasScalerUtilEditor.cs deleted file mode 100644 index 2ee9e8a..0000000 --- a/Assets/Scripts/Editor/UI/CanvasScalerUtil/Editor/CanvasScalerUtilEditor.cs +++ /dev/null @@ -1,46 +0,0 @@ -using UnityEngine; -using UnityEditor; - -/// -/// Author: Girts Kesteris 2017 -/// Script to hastily create correct canvas scales. Logic handled at editor's side -/// -namespace UnityLibrary -{ - [CustomEditor(typeof(CanvasScalerUtil))] - public class CanvasScalerUtilEditor : Editor - { - CanvasScalerUtil t; - - private void OnEnable() - { - t = (CanvasScalerUtil)target; - } - - public override void OnInspectorGUI() - { - base.OnInspectorGUI(); - if (GUILayout.Button("Scale Canvas")) ScaleCanvas(); - } - - private void ScaleCanvas() - { - Canvas canvas = t.GetComponent(); - RectTransform rectTransform = t.GetComponent(); - - Vector2 sizeDelta = new Vector2(t.CanvasWidth, t.CanvasHeight); - Vector3 scale = t.CanvasWorldSizeInMeters / t.CanvasWidth * Vector3.one; - - if (canvas.renderMode != RenderMode.WorldSpace) - { - Debug.Log("CanvasScalerUtil: Swiched to WorldSpace Render Mode from " + canvas.renderMode); - canvas.renderMode = RenderMode.WorldSpace; - } - - Debug.LogFormat("CanvasScalerUtil: calculated sizeDelta: {0} scale: {1}", sizeDelta, scale); - - rectTransform.sizeDelta = sizeDelta; - rectTransform.localScale = scale; - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Editor/UI/CanvasScalerUtil/Editor/CanvasScalerUtilEditor.cs.meta b/Assets/Scripts/Editor/UI/CanvasScalerUtil/Editor/CanvasScalerUtilEditor.cs.meta deleted file mode 100644 index d9ac9c7..0000000 --- a/Assets/Scripts/Editor/UI/CanvasScalerUtil/Editor/CanvasScalerUtilEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f46d15874e9dfbb4882b301fb5dd1160 -timeCreated: 1499174035 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Extensions.meta b/Assets/Scripts/Extensions.meta deleted file mode 100644 index 1e3f99d..0000000 --- a/Assets/Scripts/Extensions.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: f22051d526f0e5841b3027059c57a6cc -folderAsset: yes -timeCreated: 1501517477 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Extensions/MonoBehaviourExtensions/Example/MonoBehaviorExtensionsExample.cs b/Assets/Scripts/Extensions/MonoBehaviourExtensions/Example/MonoBehaviorExtensionsExample.cs deleted file mode 100644 index 20d47a7..0000000 --- a/Assets/Scripts/Extensions/MonoBehaviourExtensions/Example/MonoBehaviorExtensionsExample.cs +++ /dev/null @@ -1,21 +0,0 @@ -using UnityEngine; -using Sacristan.Utils.Extensions; - -public class MonoBehaviorExtensionsTest : MonoBehaviour -{ - private void Start() - { - this.InvokeRepeatingSafe(Tick, 1f, 1f); - this.InvokeSafe(Tock, 2f); - } - - private void Tick() - { - Debug.Log("Tick"); - } - - private void Tock() - { - Debug.Log("Tock"); - } -} diff --git a/Assets/Scripts/Extensions/MonoBehaviourExtensions/MonoBehaviourExtensions.cs b/Assets/Scripts/Extensions/MonoBehaviourExtensions/MonoBehaviourExtensions.cs deleted file mode 100644 index 652e071..0000000 --- a/Assets/Scripts/Extensions/MonoBehaviourExtensions/MonoBehaviourExtensions.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections; -using UnityEngine; - -namespace Sacristan.Utils.Extensions -{ - public static class MonoBehaviourExtensions - { - public static void InvokeSafe(this MonoBehaviour behavior, System.Action method, float delayInSeconds) - { - behavior.StartCoroutine(InvokeSafeRoutine(method, delayInSeconds)); - } - - public static void InvokeRepeatingSafe(this MonoBehaviour behavior, System.Action method, float delayInSeconds, float repeatRateInSeconds) - { - behavior.StartCoroutine(InvokeSafeRepeatingRoutine(method, delayInSeconds, repeatRateInSeconds)); - } - - private static IEnumerator InvokeSafeRepeatingRoutine(System.Action method, float delayInSeconds, float repeatRateInSeconds) - { - yield return new WaitForSeconds(delayInSeconds); - - while (true) - { - if (method != null) method.Invoke(); - yield return new WaitForSeconds(repeatRateInSeconds); - } - } - - private static IEnumerator InvokeSafeRoutine(System.Action method, float delayInSeconds) - { - yield return new WaitForSeconds(delayInSeconds); - if (method != null) method.Invoke(); - } - } -} diff --git a/Assets/Scripts/Extensions/TransformExtensions.cs b/Assets/Scripts/Extensions/TransformExtensions.cs deleted file mode 100644 index ade95b8..0000000 --- a/Assets/Scripts/Extensions/TransformExtensions.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -namespace UnityLibrary -{ - - /// - /// Transform extensions. - /// Useful transform utilities and methods. - /// - public static class TransformExtensions - { - - /// - /// Rotates the transform so the forward vector points at target's current position. - /// - /// Transform. - /// Target. - public static void LookAt2D ( this Transform transform, Transform target ) - { - transform.LookAt2D ( ( Vector2 )target.position ); - } - - /// - /// Rotates the transform so the forward vector points at worldPosition. - /// - /// Transform. - /// World position. - public static void LookAt2D ( this Transform transform, Vector3 worldPosition ) - { - transform.LookAt2D ( ( Vector2 )worldPosition ); - } - - /// - /// Rotates the transform so the forward vector points at worldPosition. - /// - /// Transform. - /// World position. - public static void LookAt2D ( this Transform transform, Vector2 worldPosition ) - { - Vector2 distance = worldPosition - ( Vector2 )transform.position; - transform.eulerAngles = new Vector3 ( - transform.eulerAngles.x, - transform.eulerAngles.y, - Mathf.Atan2 ( distance.y, distance.x ) * Mathf.Rad2Deg ); - } - - } - -} \ No newline at end of file diff --git a/Assets/Scripts/Extensions/TransformExtensions.cs.meta b/Assets/Scripts/Extensions/TransformExtensions.cs.meta deleted file mode 100644 index d9c11a2..0000000 --- a/Assets/Scripts/Extensions/TransformExtensions.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 2b0381052a6d9064b9dbd65600663886 -timeCreated: 1501517485 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Helpers.meta b/Assets/Scripts/Helpers.meta deleted file mode 100644 index d4b54c5..0000000 --- a/Assets/Scripts/Helpers.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: f420d7df62f441e43b80fb1fc389ff95 -folderAsset: yes -timeCreated: 1500793395 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Helpers/Debug.meta b/Assets/Scripts/Helpers/Debug.meta deleted file mode 100644 index 07aa051..0000000 --- a/Assets/Scripts/Helpers/Debug.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 163f9d000f608304ab9d958351b79726 -folderAsset: yes -timeCreated: 1500793396 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Helpers/Debug/Timer.cs b/Assets/Scripts/Helpers/Debug/Timer.cs deleted file mode 100644 index 9fd0cb2..0000000 --- a/Assets/Scripts/Helpers/Debug/Timer.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Timer: get time elapsed in milliseconds -using UnityEngine; -using System.Diagnostics; -using Debug = UnityEngine.Debug; - -namespace UnityLibrary -{ - public class Timer : MonoBehaviour - { - void Start () - { - // init and start timer - var stopwatch = new Stopwatch (); - stopwatch.Start (); - - // put your function here.. - for ( int i = 0; i < 1000000; i++ ) - { - // Example : var tmp = "asdf" + 1.ToString(); - } - - // get results in ms - stopwatch.Stop (); - Debug.LogFormat ( "Timer: {0} ms", stopwatch.ElapsedMilliseconds ); - stopwatch.Reset (); - } - } -} diff --git a/Assets/Scripts/Helpers/Debug/Timer.cs.meta b/Assets/Scripts/Helpers/Debug/Timer.cs.meta deleted file mode 100644 index 12b4f5d..0000000 --- a/Assets/Scripts/Helpers/Debug/Timer.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 0a04997683d5b6b459caa6cdfb9df9cc -timeCreated: 1500793400 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Helpers/DrawGLLine.cs b/Assets/Scripts/Helpers/DrawGLLine.cs deleted file mode 100644 index d659766..0000000 --- a/Assets/Scripts/Helpers/DrawGLLine.cs +++ /dev/null @@ -1,54 +0,0 @@ -using UnityEngine; - -// Draws lines with GL : https://docs.unity3d.com/ScriptReference/GL.html -// Usage: Attach this script to gameobject in scene -namespace UnityLibrary -{ - public class DrawGLLine : MonoBehaviour - { - public Color lineColor = Color.red; - - Material lineMaterial; - - void Awake() - { - // must be called before trying to draw lines.. - CreateLineMaterial(); - } - - void CreateLineMaterial() - { - // Unity has a built-in shader that is useful for drawing simple colored things - var shader = Shader.Find("Hidden/Internal-Colored"); - lineMaterial = new Material(shader); - lineMaterial.hideFlags = HideFlags.HideAndDontSave; - // Turn on alpha blending - lineMaterial.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha); - lineMaterial.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha); - // Turn backface culling off - lineMaterial.SetInt("_Cull", (int)UnityEngine.Rendering.CullMode.Off); - // Turn off depth writes - lineMaterial.SetInt("_ZWrite", 0); - } - - - // cannot call this on update, line wont be visible then.. and if used OnPostRender() thats works when attached to camera only - void OnRenderObject() - { - lineMaterial.SetPass(0); - - GL.PushMatrix(); - GL.MultMatrix(transform.localToWorldMatrix); - - GL.Begin(GL.LINES); - GL.Color(lineColor); - // start line from transform position - GL.Vertex(transform.position); - // end line 100 units forward from transform position - GL.Vertex(transform.position + transform.forward * 100); - - GL.End(); - GL.PopMatrix(); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Helpers/DrawGLLine.cs.meta b/Assets/Scripts/Helpers/DrawGLLine.cs.meta deleted file mode 100644 index bf6db10..0000000 --- a/Assets/Scripts/Helpers/DrawGLLine.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 95e3fc76aa41bf24089dcc6d549d0945 -timeCreated: 1500793403 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Helpers/DrawRendererBounds.cs b/Assets/Scripts/Helpers/DrawRendererBounds.cs deleted file mode 100644 index 627112c..0000000 --- a/Assets/Scripts/Helpers/DrawRendererBounds.cs +++ /dev/null @@ -1,49 +0,0 @@ -using UnityEngine; - -// draws mesh renderer bounding box using Debug.Drawline -namespace UnityLibrary -{ - public class DrawRendererBounds : MonoBehaviour - { - MeshRenderer meshRenderer; - - void Awake() - { - meshRenderer = GetComponent(); - } - - - void Update() - { - var b = meshRenderer.bounds; - - // bottom - var p1 = new Vector3(b.min.x, b.min.y, b.min.z); - var p2 = new Vector3(b.max.x, b.min.y, b.min.z); - var p3 = new Vector3(b.max.x, b.min.y, b.max.z); - var p4 = new Vector3(b.min.x, b.min.y, b.max.z); - - Debug.DrawLine(p1, p2, Color.blue); - Debug.DrawLine(p2, p3, Color.red); - Debug.DrawLine(p3, p4, Color.yellow); - Debug.DrawLine(p4, p1, Color.magenta); - - // top - var p5 = new Vector3(b.min.x, b.max.y, b.min.z); - var p6 = new Vector3(b.max.x, b.max.y, b.min.z); - var p7 = new Vector3(b.max.x, b.max.y, b.max.z); - var p8 = new Vector3(b.min.x, b.max.y, b.max.z); - - Debug.DrawLine(p5, p6, Color.blue); - Debug.DrawLine(p6, p7, Color.red); - Debug.DrawLine(p7, p8, Color.yellow); - Debug.DrawLine(p8, p5, Color.magenta); - - // sides - Debug.DrawLine(p1, p5, Color.white); - Debug.DrawLine(p2, p6, Color.gray); - Debug.DrawLine(p3, p7, Color.green); - Debug.DrawLine(p4, p8, Color.cyan); - } - } -} diff --git a/Assets/Scripts/Helpers/DrawRendererBounds.cs.meta b/Assets/Scripts/Helpers/DrawRendererBounds.cs.meta deleted file mode 100644 index fcd11d4..0000000 --- a/Assets/Scripts/Helpers/DrawRendererBounds.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: c54e110ad2490d9418390c4fa6ff8c98 -timeCreated: 1500793403 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Helpers/Drawing.meta b/Assets/Scripts/Helpers/Drawing.meta deleted file mode 100644 index aad493f..0000000 --- a/Assets/Scripts/Helpers/Drawing.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: dc1b64f3b947fe84796b604938b6c54b -folderAsset: yes -timeCreated: 1500793397 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Helpers/Drawing/DrawCrossHair.cs b/Assets/Scripts/Helpers/Drawing/DrawCrossHair.cs deleted file mode 100644 index 66df970..0000000 --- a/Assets/Scripts/Helpers/Drawing/DrawCrossHair.cs +++ /dev/null @@ -1,46 +0,0 @@ -using UnityEngine; -using System.Collections; - -// Draws crosshair to mouseposition with GL.Lines, takes line length in pixels -// Usage: Attach this script to Main Camera, Assign material (for example some particle shader) -namespace UnityLibrary -{ - public class DrawCrossHair : MonoBehaviour - { - public Material mat; - public float lineLen = 5f; // in pixels - - Vector3 mousePos; - float lineLenHorizontal; - float lineLenVertical; - - void Awake() - { - // if you want to adjust lineLen at runtime, would need to calculate these again - lineLenHorizontal = lineLen / Screen.width; - lineLenVertical = lineLen / Screen.height; - } - - void Update() - { - mousePos = Input.mousePosition; - mousePos.x /= Screen.width; - mousePos.y /= Screen.height; - } - - void OnPostRender() - { - GL.PushMatrix(); - mat.SetPass(0); - GL.LoadOrtho(); - GL.Begin(GL.LINES); - GL.Color(Color.white); - GL.Vertex(new Vector3(mousePos.x, mousePos.y - lineLenVertical, 0)); - GL.Vertex(new Vector3(mousePos.x, mousePos.y + lineLenVertical, 0)); - GL.Vertex(new Vector3(mousePos.x - lineLenHorizontal, mousePos.y, 0)); - GL.Vertex(new Vector3(mousePos.x + lineLenHorizontal, mousePos.y, 0)); - GL.End(); - GL.PopMatrix(); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Helpers/Drawing/DrawCrossHair.cs.meta b/Assets/Scripts/Helpers/Drawing/DrawCrossHair.cs.meta deleted file mode 100644 index 3d6d802..0000000 --- a/Assets/Scripts/Helpers/Drawing/DrawCrossHair.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 54f5f83ac4d434d4483d8af67fa6507c -timeCreated: 1500793401 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Helpers/FPSCounter.cs b/Assets/Scripts/Helpers/FPSCounter.cs deleted file mode 100644 index e140cb2..0000000 --- a/Assets/Scripts/Helpers/FPSCounter.cs +++ /dev/null @@ -1,44 +0,0 @@ -using UnityEngine; -namespace UnityLibrary -{ - public class FPSCounter : MonoBehaviour - { - [SerializeField] - private float updateInterval = 0.1f; - - private float accum = 0.0f; - private int frames = 0; - private float timeleft; - - int qty; - - float fps; - float avgFps; - - void Update() - { - timeleft -= Time.deltaTime; - accum += Time.timeScale / Time.deltaTime; - ++frames; - - if (timeleft <= 0.0) - { - fps = (accum / frames); - timeleft = updateInterval; - accum = 0f; - frames = 0; - } - - qty++; - - avgFps += (fps - avgFps) / qty; - } - - void OnGUI() - { - GUI.Label(new Rect(Screen.width - 150, 0, 150, 20), "FPS: " + fps.ToString("f2")); - GUI.Label(new Rect(Screen.width - 150, 20, 150, 20), "Avg FPS: " + avgFps.ToString("f2")); - } - - } -} diff --git a/Assets/Scripts/Helpers/FPSCounter.cs.meta b/Assets/Scripts/Helpers/FPSCounter.cs.meta deleted file mode 100644 index f58c237..0000000 --- a/Assets/Scripts/Helpers/FPSCounter.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 8992bbf361e600a419f30454b6113634 -timeCreated: 1500793402 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Helpers/FileSystem.meta b/Assets/Scripts/Helpers/FileSystem.meta deleted file mode 100644 index 53ec446..0000000 --- a/Assets/Scripts/Helpers/FileSystem.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 3f5edf9425760c84d8dab63f73e53638 -folderAsset: yes -timeCreated: 1500793396 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Helpers/FileSystem/FileSystemWatch.cs b/Assets/Scripts/Helpers/FileSystem/FileSystemWatch.cs deleted file mode 100644 index 4ea8c7a..0000000 --- a/Assets/Scripts/Helpers/FileSystem/FileSystemWatch.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using System.IO; -using UnityEngine; - -// watches specified folder changes in the filesystem -// "Listens to the file system change notifications and raises events when a directory, or file in a directory, changes." -// references: http://stackoverflow.com/questions/15017506/using-filesystemwatcher-to-monitor-a-directory and http://www.c-sharpcorner.com/article/monitoring-file-system-using-filesystemwatcher-class-part1/ - -public class FileSystemWatch : MonoBehaviour -{ - string myPath = "c:\\myfolder\\"; - FileSystemWatcher watcher; - - void Start() - { - InitFileSystemWatcher(); - } - - private void InitFileSystemWatcher() - { - watcher = new FileSystemWatcher(); - watcher.Path = myPath; - watcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName; - watcher.Filter = "*.*"; - - //Handler for Changed Event - watcher.Changed += new FileSystemEventHandler(FileChanged); - //Handler for Created Event - watcher.Created += new FileSystemEventHandler(FileCreated); - //Handler for Deleted Event - watcher.Deleted += new FileSystemEventHandler(FileDeleted); - //Handler for Renamed Event - watcher.Renamed += new RenamedEventHandler(FileRenamed); - - watcher.EnableRaisingEvents = true; - } - - private void FileChanged(object source, FileSystemEventArgs e) - { - Debug.Log("FileChanged:" + e.FullPath); - } - - private void FileCreated(object source, FileSystemEventArgs e) - { - Debug.Log("FileCreated:" + e.FullPath); - } - - private void FileDeleted(object source, FileSystemEventArgs e) - { - Debug.Log("FileDeleted:" + e.FullPath); - } - - private void FileRenamed(object source, FileSystemEventArgs e) - { - Debug.Log("FileChanged:" + e.FullPath); - } -} diff --git a/Assets/Scripts/Helpers/FileSystem/FileSystemWatch.cs.meta b/Assets/Scripts/Helpers/FileSystem/FileSystemWatch.cs.meta deleted file mode 100644 index 216ef49..0000000 --- a/Assets/Scripts/Helpers/FileSystem/FileSystemWatch.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 2ef04d2ffb61ab14c8622e026828e447 -timeCreated: 1500793401 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Helpers/FileSystem/OpenExternalFile.cs b/Assets/Scripts/Helpers/FileSystem/OpenExternalFile.cs deleted file mode 100644 index bb2b0bd..0000000 --- a/Assets/Scripts/Helpers/FileSystem/OpenExternalFile.cs +++ /dev/null @@ -1,36 +0,0 @@ -// opens external file in default viewer for that filetype -// for example: powerpoint file would open in powerpoint - -using UnityEngine; -using System.Collections; -using System.IO; -using System.Diagnostics; -using System; -using Debug = UnityEngine.Debug; -namespace UnityLibrary -{ - public class OpenExternalFile : MonoBehaviour - { - - // opens external file in default viewer - public static void OpenFile(string fullPath) - { - Debug.Log("opening:" + fullPath); - - if (File.Exists(fullPath)) - { - try - { - Process myProcess = new Process(); - myProcess.StartInfo.FileName = fullPath; - myProcess.Start(); - // myProcess.WaitForExit(); - } - catch (Exception e) - { - Debug.Log(e); - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Helpers/FileSystem/OpenExternalFile.cs.meta b/Assets/Scripts/Helpers/FileSystem/OpenExternalFile.cs.meta deleted file mode 100644 index 8149910..0000000 --- a/Assets/Scripts/Helpers/FileSystem/OpenExternalFile.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 81def09443d40044295eebf503e1398e -timeCreated: 1500793402 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Helpers/Screenshot.meta b/Assets/Scripts/Helpers/Screenshot.meta deleted file mode 100644 index e9591da..0000000 --- a/Assets/Scripts/Helpers/Screenshot.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 85fd4ff8eea2d1844aa2d78c3927ae08 -folderAsset: yes -timeCreated: 1500793397 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Helpers/Screenshot/GrabDesktop.cs b/Assets/Scripts/Helpers/Screenshot/GrabDesktop.cs deleted file mode 100644 index 75af304..0000000 --- a/Assets/Scripts/Helpers/Screenshot/GrabDesktop.cs +++ /dev/null @@ -1,57 +0,0 @@ -using UnityEngine; - -using Application = UnityEngine.Application; -using System; -using System.Runtime.InteropServices; - -// Drag windows desktop image using System.Drawing.dll -// guide on using System.Drawing.dll in unity : http://answers.unity3d.com/answers/253571/view.html - -/// -/// Instructions: -/// 1.- Uncomment the code below -/// 2.- Create a "Plugins" folder in your project -/// 3.- Import the System.Drawing.dll and System.Windows.Forms.dll from Unity_Location\Editor\Data\Mono\lib\mono\2.0 -/// - -//Uncomment this: - -/* -//using System.Windows.Forms.Screen; -//using System.Drawing; -//using System.Drawing.Imaging; -namespace UnityLibrary{ -public class GrabDesktop : MonoBehaviour -{ - [DllImport("kernel32", SetLastError = true)] - static extern IntPtr LoadLibrary(string lpFileName); - - static bool CheckLibrary(string fileName) - { - return LoadLibrary(fileName) == IntPtr.Zero; - } - private void Start() - { - try - { - // screenshot source: http://stackoverflow.com/a/363008/5452781 - - //Create a new bitmap. - var bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb); - - // Create a graphics object from the bitmap. - var gfxScreenshot = System.Drawing.Graphics.FromImage(bmpScreenshot); - - // Take the screenshot from the upper left corner to the right bottom corner. - gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy); - - // Save the screenshot to the specified path that the user has chosen. - bmpScreenshot.Save(Application.dataPath + "/Screenshot.png", ImageFormat.Png); - }catch(Exception e) { - Debug.LogError("You must import the dll to the project, refer to the instructions in the Script for more details"); - } - - } -} -} -*/ diff --git a/Assets/Scripts/Helpers/Screenshot/GrabDesktop.cs.meta b/Assets/Scripts/Helpers/Screenshot/GrabDesktop.cs.meta deleted file mode 100644 index 05493cc..0000000 --- a/Assets/Scripts/Helpers/Screenshot/GrabDesktop.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 0dd4e41efe19d45448977b6c170111d4 -timeCreated: 1500793400 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Helpers/String.meta b/Assets/Scripts/Helpers/String.meta deleted file mode 100644 index 18d2cfb..0000000 --- a/Assets/Scripts/Helpers/String.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 7a597f7452455c84bbe8aae4cbf2c88b -folderAsset: yes -timeCreated: 1500793397 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Helpers/String/StringOperationUtil.cs b/Assets/Scripts/Helpers/String/StringOperationUtil.cs deleted file mode 100644 index c819e22..0000000 --- a/Assets/Scripts/Helpers/String/StringOperationUtil.cs +++ /dev/null @@ -1,250 +0,0 @@ -using System.Threading; -using System.Text; - -// Info: OptimizedStringOperation -// Concatenating many strings allocates a lot of temporary memory in the managed heap. It is recommend to use System.Text.StringBuffer instead. -// Sometimes this is hard to fix, especially if you already have written a lot of code. This solution should help you to work around that problem easily. -// source: https://bitbucket.org/Unity-Technologies/enterprise-support - -namespace StringOperationUtil -{ - /// - /// Using this,you can optimize string concat operation easily. - /// To use this , you should put this on the top of code. - /// ------ - /// using StrOpe = StringOperationUtil.OptimizedStringOperation; - /// ------ - /// - /// - before code - /// string str = "aaa" + 20 + "bbbb"; - /// - /// - after code - /// string str = StrOpe.i + "aaa" + 20 + "bbbb"; - /// - /// "StrOpe.i" is for MainThread , do not call from other theads. - /// If "StrOpe.i" is called from Mainthread , reuse same object. - /// - /// You can also use "StrOpe.small" / "StrOpe.medium" / "StrOpe.large" instead of "StrOpe.i". - /// These are creating instance. - /// - public class OptimizedStringOperation - { - private static OptimizedStringOperation instance = null; - #if !UNITY_WEBGL - private static Thread singletonThread = null; - #endif - private StringBuilder sb = null; - - static OptimizedStringOperation() - { - instance = new OptimizedStringOperation(1024); - } - private OptimizedStringOperation(int capacity) - { - sb = new StringBuilder(capacity); - } - - public static OptimizedStringOperation Create(int capacity) - { - return new OptimizedStringOperation(capacity); - } - - public static OptimizedStringOperation small - { - get - { - return Create(64); - } - } - - public static OptimizedStringOperation medium - { - get - { - return Create(256); - } - } - public static OptimizedStringOperation large - { - get - { - return Create(1024); - } - } - - public static OptimizedStringOperation i - { - get - { - #if !UNITY_WEBGL - // Bind instance to thread. - if (singletonThread == null ) - { - singletonThread = Thread.CurrentThread; - } - // check thread... - if (singletonThread != Thread.CurrentThread) - { - #if DEBUG || UNITY_EDITOR - UnityEngine.Debug.LogError("Execute from another thread."); - #endif - return small; - } - #endif - instance.sb.Length = 0; - return instance; - } - } - - public int Capacity - { - set { this.sb.Capacity = value; } - get { return sb.Capacity; } - } - - public int Length - { - set { this.sb.Length = value; } - get { return this.sb.Length; } - } - public OptimizedStringOperation Remove(int startIndex, int length) - { - sb.Remove(startIndex, length); - return this; - } - public OptimizedStringOperation Replace(string oldValue, string newValue) - { - sb.Replace(oldValue, newValue); - return this; - } - - public override string ToString() - { - return sb.ToString(); - } - - public void Clear() - { - // StringBuilder.Clear() doesn't support .Net 3.5... - // "Capasity = 0" doesn't work.... - sb = new StringBuilder(0); - } - - public OptimizedStringOperation ToLower() - { - int length = sb.Length; - for (int i = 0; i < length; ++i) - { - if (char.IsUpper(sb[i])) - { - sb.Replace(sb[i], char.ToLower(sb[i]), i, 1); - } - } - return this; - } - public OptimizedStringOperation ToUpper() - { - int length = sb.Length; - for (int i = 0; i < length; ++i) - { - if (char.IsLower(sb[i])) - { - sb.Replace(sb[i], char.ToUpper(sb[i]), i, 1); - } - } - return this; - } - - public OptimizedStringOperation Trim() - { - return TrimEnd().TrimStart(); - } - - public OptimizedStringOperation TrimStart() - { - int length = sb.Length; - for (int i = 0; i < length; ++i) - { - if (!char.IsWhiteSpace(sb[i])) - { - if (i > 0) - { - sb.Remove(0, i); - } - break; - } - } - return this; - } - public OptimizedStringOperation TrimEnd() - { - int length = sb.Length; - for (int i = length - 1; i >= 0; --i) - { - if (!char.IsWhiteSpace(sb[i])) - { - if (i < length - 1) - { - sb.Remove(i, length - i); - } - break; - } - } - return this; - } - - - public static implicit operator string(OptimizedStringOperation t) - { - return t.ToString(); - } - - #region ADD_OPERATOR - public static OptimizedStringOperation operator +(OptimizedStringOperation t, bool v) - { - t.sb.Append(v); - return t; - } - public static OptimizedStringOperation operator +(OptimizedStringOperation t, int v) - { - t.sb.Append(v); - return t; - } - public static OptimizedStringOperation operator +(OptimizedStringOperation t, short v) - { - t.sb.Append(v); - return t; - } - public static OptimizedStringOperation operator +(OptimizedStringOperation t, byte v) - { - t.sb.Append(v); - return t; - } - public static OptimizedStringOperation operator +(OptimizedStringOperation t, float v) - { - t.sb.Append(v); - return t; - } - public static OptimizedStringOperation operator +(OptimizedStringOperation t, char c) - { - t.sb.Append(c); - return t; - } - public static OptimizedStringOperation operator +(OptimizedStringOperation t, char[] c) - { - t.sb.Append(c); - return t; - } - public static OptimizedStringOperation operator +(OptimizedStringOperation t, string str) - { - t.sb.Append(str); - return t; - } - public static OptimizedStringOperation operator +(OptimizedStringOperation t, StringBuilder sb) - { - t.sb.Append(sb); - return t; - } - #endregion ADD_OPERATOR - } -} diff --git a/Assets/Scripts/Helpers/String/StringOperationUtil.cs.meta b/Assets/Scripts/Helpers/String/StringOperationUtil.cs.meta deleted file mode 100644 index eb01be2..0000000 --- a/Assets/Scripts/Helpers/String/StringOperationUtil.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f19d41dbf283f0a468253c77d8342784 -timeCreated: 1500793404 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Helpers/Version.meta b/Assets/Scripts/Helpers/Version.meta deleted file mode 100644 index 9092080..0000000 --- a/Assets/Scripts/Helpers/Version.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: c9f673795c933264c8ded10a0f788f3e -folderAsset: yes -timeCreated: 1500793397 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Helpers/Version/GetVersion.cs b/Assets/Scripts/Helpers/Version/GetVersion.cs deleted file mode 100644 index 1803923..0000000 --- a/Assets/Scripts/Helpers/Version/GetVersion.cs +++ /dev/null @@ -1,19 +0,0 @@ -using UnityEngine; -using UnityEngine.UI; - -// Usage: attach this to UI Text component -// it displays current version number from Ios/Android player settings with Application.version -namespace UnityLibrary -{ - public class GetVersion : MonoBehaviour - { - void Awake() - { - var t = GetComponent(); - if (t != null) - { - t.text = "v" + Application.version; - } - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Helpers/Version/GetVersion.cs.meta b/Assets/Scripts/Helpers/Version/GetVersion.cs.meta deleted file mode 100644 index c7fba55..0000000 --- a/Assets/Scripts/Helpers/Version/GetVersion.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 6af499f915b5766429800fedfe008b72 -timeCreated: 1500793402 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/ImageEffects.meta b/Assets/Scripts/ImageEffects.meta deleted file mode 100644 index 7d96899..0000000 --- a/Assets/Scripts/ImageEffects.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 515803c91c2131040af4bfa75af4ad38 -folderAsset: yes -timeCreated: 1500793395 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/ImageEffects/GrayscaleLayers.cs b/Assets/Scripts/ImageEffects/GrayscaleLayers.cs deleted file mode 100644 index 47f7bd5..0000000 --- a/Assets/Scripts/ImageEffects/GrayscaleLayers.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System; -using UnityEngine; - -// Grayscale effect, with added ExcludeLayer option -// Usage: Attach this script to camera, Select excludeLayers, Set your excluded objects to that layer - - -#if !UNITY_5_3_OR_NEWER -namespace UnityStandardAssets.ImageEffects -{ - - [ExecuteInEditMode] - [AddComponentMenu("Image Effects/Color Adjustments/Grayscale")] - public class GrayscaleLayers : ImageEffectBase - { - public Texture textureRamp; - public LayerMask excludeLayers = 0; - - private GameObject tmpCam = null; - private Camera _camera; - - [Range(-1.0f, 1.0f)] - public float rampOffset; - - // Called by camera to apply image effect - void OnRenderImage(RenderTexture source, RenderTexture destination) - { - material.SetTexture("_RampTex", textureRamp); - material.SetFloat("_RampOffset", rampOffset); - Graphics.Blit(source, destination, material); - - // exclude layers - Camera cam = null; - if (excludeLayers.value != 0) cam = GetTmpCam(); - - if (cam && excludeLayers.value != 0) - { - cam.targetTexture = destination; - cam.cullingMask = excludeLayers; - cam.Render(); - } - } - - - // taken from CameraMotionBlur.cs - Camera GetTmpCam() - { - if (tmpCam == null) - { - if (_camera == null) _camera = GetComponent(); - - string name = "_" + _camera.name + "_GrayScaleTmpCam"; - GameObject go = GameObject.Find(name); - - if (null == go) // couldn't find, recreate - { - tmpCam = new GameObject(name, typeof(Camera)); - } else - { - tmpCam = go; - } - } - - tmpCam.hideFlags = HideFlags.DontSave; - tmpCam.transform.position = _camera.transform.position; - tmpCam.transform.rotation = _camera.transform.rotation; - tmpCam.transform.localScale = _camera.transform.localScale; - tmpCam.GetComponent().CopyFrom(_camera); - - tmpCam.GetComponent().enabled = false; - tmpCam.GetComponent().depthTextureMode = DepthTextureMode.None; - tmpCam.GetComponent().clearFlags = CameraClearFlags.Nothing; - - return tmpCam.GetComponent(); - } - } -} -#endif diff --git a/Assets/Scripts/ImageEffects/GrayscaleLayers.cs.meta b/Assets/Scripts/ImageEffects/GrayscaleLayers.cs.meta deleted file mode 100644 index 30a3e03..0000000 --- a/Assets/Scripts/ImageEffects/GrayscaleLayers.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 5edc2eab7c433e047b19d869fe66b021 -timeCreated: 1500793402 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Misc.meta b/Assets/Scripts/Misc.meta deleted file mode 100644 index 4f29603..0000000 --- a/Assets/Scripts/Misc.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 265af611d5d54e943985362e12ef25f2 -folderAsset: yes -timeCreated: 1500793394 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Misc/Messaging.meta b/Assets/Scripts/Misc/Messaging.meta deleted file mode 100644 index e7fdaf1..0000000 --- a/Assets/Scripts/Misc/Messaging.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 14a931c0152878540a9389097c2fcc9e -folderAsset: yes -timeCreated: 1500793396 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Misc/Messaging/Callback.cs b/Assets/Scripts/Misc/Messaging/Callback.cs deleted file mode 100644 index 560fc90..0000000 --- a/Assets/Scripts/Misc/Messaging/Callback.cs +++ /dev/null @@ -1,4 +0,0 @@ -public delegate void Callback(); -public delegate void Callback(T arg1); -public delegate void Callback(T arg1, U arg2); -public delegate void Callback(T arg1, U arg2, V arg3); \ No newline at end of file diff --git a/Assets/Scripts/Misc/Messaging/Callback.cs.meta b/Assets/Scripts/Misc/Messaging/Callback.cs.meta deleted file mode 100644 index b50044c..0000000 --- a/Assets/Scripts/Misc/Messaging/Callback.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5f8b822e50df6a24f8f2bcdb234e3e5a -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Scripts/Misc/Messaging/Messenger.cs b/Assets/Scripts/Misc/Messaging/Messenger.cs deleted file mode 100644 index 41759f9..0000000 --- a/Assets/Scripts/Misc/Messaging/Messenger.cs +++ /dev/null @@ -1,254 +0,0 @@ -using System; -using System.Collections.Generic; -namespace UnityLibrary -{ - public enum MessengerMode - { - DONT_REQUIRE_LISTENER, - REQUIRE_LISTENER, - } - - static internal class MessengerInternal - { - static public Dictionary eventTable = new Dictionary(); - static public readonly MessengerMode DEFAULT_MODE = MessengerMode.REQUIRE_LISTENER; - - static public void OnListenerAdding(string eventType, Delegate listenerBeingAdded) - { - if (!eventTable.ContainsKey(eventType)) - { - eventTable.Add(eventType, null); - } - - Delegate d = eventTable[eventType]; - if (d != null && d.GetType() != listenerBeingAdded.GetType()) - { - throw new ListenerException(string.Format("Attempting to add listener with inconsistent signature for event type {0}. Current listeners have type {1} and listener being added has type {2}", eventType, d.GetType().Name, listenerBeingAdded.GetType().Name)); - } - } - - static public void OnListenerRemoving(string eventType, Delegate listenerBeingRemoved) - { - if (eventTable.ContainsKey(eventType)) - { - Delegate d = eventTable[eventType]; - - if (d == null) - { - throw new ListenerException(string.Format("Attempting to remove listener with for event type {0} but current listener is null.", eventType)); - } - else if (d.GetType() != listenerBeingRemoved.GetType()) - { - throw new ListenerException(string.Format("Attempting to remove listener with inconsistent signature for event type {0}. Current listeners have type {1} and listener being removed has type {2}", eventType, d.GetType().Name, listenerBeingRemoved.GetType().Name)); - } - } - else - { - throw new ListenerException(string.Format("Attempting to remove listener for type {0} but Messenger doesn't know about this event type.", eventType)); - } - } - - static public void OnListenerRemoved(string eventType) - { - if (eventTable[eventType] == null) - { - eventTable.Remove(eventType); - } - } - - static public void OnBroadcasting(string eventType, MessengerMode mode) - { - if (mode == MessengerMode.REQUIRE_LISTENER && !eventTable.ContainsKey(eventType)) - { - throw new MessengerInternal.BroadcastException(string.Format("Broadcasting message {0} but no listener found.", eventType)); - } - } - - static public BroadcastException CreateBroadcastSignatureException(string eventType) - { - return new BroadcastException(string.Format("Broadcasting message {0} but listeners have a different signature than the broadcaster.", eventType)); - } - - public class BroadcastException : Exception - { - public BroadcastException(string msg) - : base(msg) - { - } - } - - public class ListenerException : Exception - { - public ListenerException(string msg) - : base(msg) - { - } - } - } - - - static public class Messenger - { - private static Dictionary eventTable = MessengerInternal.eventTable; - - static public void AddListener(string eventType, Callback handler) - { - MessengerInternal.OnListenerAdding(eventType, handler); - eventTable[eventType] = (Callback)eventTable[eventType] + handler; - } - - static public void RemoveListener(string eventType, Callback handler) - { - MessengerInternal.OnListenerRemoving(eventType, handler); - eventTable[eventType] = (Callback)eventTable[eventType] - handler; - MessengerInternal.OnListenerRemoved(eventType); - } - - static public void Broadcast(string eventType) - { - Broadcast(eventType, MessengerInternal.DEFAULT_MODE); - } - - static public void Broadcast(string eventType, MessengerMode mode) - { - MessengerInternal.OnBroadcasting(eventType, mode); - Delegate d; - if (eventTable.TryGetValue(eventType, out d)) - { - Callback callback = d as Callback; - if (callback != null) - { - callback(); - } - else - { - throw MessengerInternal.CreateBroadcastSignatureException(eventType); - } - } - } - } - - - static public class Messenger - { - private static Dictionary eventTable = MessengerInternal.eventTable; - - static public void AddListener(string eventType, Callback handler) - { - MessengerInternal.OnListenerAdding(eventType, handler); - eventTable[eventType] = (Callback)eventTable[eventType] + handler; - } - - static public void RemoveListener(string eventType, Callback handler) - { - MessengerInternal.OnListenerRemoving(eventType, handler); - eventTable[eventType] = (Callback)eventTable[eventType] - handler; - MessengerInternal.OnListenerRemoved(eventType); - } - - static public void Broadcast(string eventType, T arg1) - { - Broadcast(eventType, arg1, MessengerInternal.DEFAULT_MODE); - } - - static public void Broadcast(string eventType, T arg1, MessengerMode mode) - { - MessengerInternal.OnBroadcasting(eventType, mode); - Delegate d; - if (eventTable.TryGetValue(eventType, out d)) - { - Callback callback = d as Callback; - if (callback != null) - { - callback(arg1); - } - else - { - throw MessengerInternal.CreateBroadcastSignatureException(eventType); - } - } - } - } - - static public class Messenger - { - private static Dictionary eventTable = MessengerInternal.eventTable; - - static public void AddListener(string eventType, Callback handler) - { - MessengerInternal.OnListenerAdding(eventType, handler); - eventTable[eventType] = (Callback)eventTable[eventType] + handler; - } - - static public void RemoveListener(string eventType, Callback handler) - { - MessengerInternal.OnListenerRemoving(eventType, handler); - eventTable[eventType] = (Callback)eventTable[eventType] - handler; - MessengerInternal.OnListenerRemoved(eventType); - } - - static public void Broadcast(string eventType, T arg1, U arg2) - { - Broadcast(eventType, arg1, arg2, MessengerInternal.DEFAULT_MODE); - } - - static public void Broadcast(string eventType, T arg1, U arg2, MessengerMode mode) - { - MessengerInternal.OnBroadcasting(eventType, mode); - Delegate d; - if (eventTable.TryGetValue(eventType, out d)) - { - Callback callback = d as Callback; - if (callback != null) - { - callback(arg1, arg2); - } - else - { - throw MessengerInternal.CreateBroadcastSignatureException(eventType); - } - } - } - } - - static public class Messenger - { - private static Dictionary eventTable = MessengerInternal.eventTable; - - static public void AddListener(string eventType, Callback handler) - { - MessengerInternal.OnListenerAdding(eventType, handler); - eventTable[eventType] = (Callback)eventTable[eventType] + handler; - } - - static public void RemoveListener(string eventType, Callback handler) - { - MessengerInternal.OnListenerRemoving(eventType, handler); - eventTable[eventType] = (Callback)eventTable[eventType] - handler; - MessengerInternal.OnListenerRemoved(eventType); - } - - static public void Broadcast(string eventType, T arg1, U arg2, V arg3) - { - Broadcast(eventType, arg1, arg2, arg3, MessengerInternal.DEFAULT_MODE); - } - - static public void Broadcast(string eventType, T arg1, U arg2, V arg3, MessengerMode mode) - { - MessengerInternal.OnBroadcasting(eventType, mode); - Delegate d; - if (eventTable.TryGetValue(eventType, out d)) - { - Callback callback = d as Callback; - if (callback != null) - { - callback(arg1, arg2, arg3); - } - else - { - throw MessengerInternal.CreateBroadcastSignatureException(eventType); - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Misc/Messaging/Messenger.cs.meta b/Assets/Scripts/Misc/Messaging/Messenger.cs.meta deleted file mode 100644 index b5ba475..0000000 --- a/Assets/Scripts/Misc/Messaging/Messenger.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: cd9a8c4f314d1534c8f40f201c6dd894 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Scripts/Misc/Messaging/MessengerUnitTest.cs b/Assets/Scripts/Misc/Messaging/MessengerUnitTest.cs deleted file mode 100644 index 8ad484e..0000000 --- a/Assets/Scripts/Misc/Messaging/MessengerUnitTest.cs +++ /dev/null @@ -1,159 +0,0 @@ -#pragma warning disable 0168 - -// MessengerUnitTest.cs v1.0 by Magnus Wolffelt, magnus.wolffelt@gmail.com -// -// Some functionality testing of the classes in Messenger.cs. -// A lot of attention is paid to proper exception throwing from the Messenger. - -using System; -namespace UnityLibrary -{ - class MessengerUnitTest - { - - private readonly string eventType1 = "__testEvent1"; - private readonly string eventType2 = "__testEvent2"; - - bool wasCalled = false; - - public void RunTest() - { - RunAddTests(); - RunBroadcastTests(); - RunRemoveTests(); - Console.Out.WriteLine("All Messenger tests passed."); - } - - - private void RunAddTests() - { - Messenger.AddListener(eventType1, TestCallback); - - try - { - // This should fail because we're adding a new event listener for same event type but a different delegate signature - Messenger.AddListener(eventType1, TestCallbackFloat); - throw new Exception("Unit test failure - expected a ListenerException"); - } - catch (MessengerInternal.ListenerException e) - { - // All good - } - - Messenger.AddListener(eventType2, TestCallbackFloat); - } - - - private void RunBroadcastTests() - { - wasCalled = false; - Messenger.Broadcast(eventType1); - if (!wasCalled) { throw new Exception("Unit test failure - event handler appears to have not been called."); } - wasCalled = false; - Messenger.Broadcast(eventType2, 1.0f); - if (!wasCalled) { throw new Exception("Unit test failure - event handler appears to have not been called."); } - - // No listener should exist for this event, but we don't require a listener so it should pass - Messenger.Broadcast(eventType2 + "_", 1.0f, MessengerMode.DONT_REQUIRE_LISTENER); - - try - { - // Broadcasting for an event there exists listeners for, but using wrong signature - Messenger.Broadcast(eventType1, 1.0f, MessengerMode.DONT_REQUIRE_LISTENER); - throw new Exception("Unit test failure - expected a BroadcastException"); - } - catch (MessengerInternal.BroadcastException e) - { - // All good - } - - try - { - // Same thing, but now we (implicitly) require at least one listener - Messenger.Broadcast(eventType2 + "_", 1.0f); - throw new Exception("Unit test failure - expected a BroadcastException"); - } - catch (MessengerInternal.BroadcastException e) - { - // All good - } - - try - { - // Wrong generic type for this broadcast, and we implicitly require a listener - Messenger.Broadcast(eventType2, 1.0); - throw new Exception("Unit test failure - expected a BroadcastException"); - } - catch (MessengerInternal.BroadcastException e) - { - // All good - } - - } - - - private void RunRemoveTests() - { - - try - { - // Removal with wrong signature should fail - Messenger.RemoveListener(eventType1, TestCallbackFloat); - throw new Exception("Unit test failure - expected a ListenerException"); - } - catch (MessengerInternal.ListenerException e) - { - // All good - } - - Messenger.RemoveListener(eventType1, TestCallback); - - try - { - // Repeated removal should fail - Messenger.RemoveListener(eventType1, TestCallback); - throw new Exception("Unit test failure - expected a ListenerException"); - } - catch (MessengerInternal.ListenerException e) - { - // All good - } - - - - Messenger.RemoveListener(eventType2, TestCallbackFloat); - - try - { - // Repeated removal should fail - Messenger.RemoveListener(eventType2, TestCallbackFloat); - throw new Exception("Unit test failure - expected a ListenerException"); - } - catch (MessengerInternal.ListenerException e) - { - // All good - } - } - - - void TestCallback() - { - wasCalled = true; - Console.Out.WriteLine("TestCallback() was called."); - } - - void TestCallbackFloat(float f) - { - wasCalled = true; - Console.Out.WriteLine("TestCallbackFloat(float) was called."); - - if (f != 1.0f) - { - throw new Exception("Unit test failure - wrong value on float argument"); - } - } - - - - } -} \ No newline at end of file diff --git a/Assets/Scripts/Misc/Messaging/MessengerUnitTest.cs.meta b/Assets/Scripts/Misc/Messaging/MessengerUnitTest.cs.meta deleted file mode 100644 index 8f9e168..0000000 --- a/Assets/Scripts/Misc/Messaging/MessengerUnitTest.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 1c5fc54965e707f408810d9d0d2df2eb -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Scripts/Misc/Messaging/README.md.meta b/Assets/Scripts/Misc/Messaging/README.md.meta deleted file mode 100644 index e4c8693..0000000 --- a/Assets/Scripts/Misc/Messaging/README.md.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 20e4e9786c8ffd140982a4cc0be76dfb -timeCreated: 1500793397 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Misc/MeteorRing.cs b/Assets/Scripts/Misc/MeteorRing.cs deleted file mode 100644 index 763747f..0000000 --- a/Assets/Scripts/Misc/MeteorRing.cs +++ /dev/null @@ -1,32 +0,0 @@ -using UnityEngine; -using System.Collections; - -// Usage: Attach to gameobject (enable gizmos to see Debug.DrawRay()) -// reference: http://forum.unity3d.com/threads/procedural-generation-in-a-specific-shape-question.421659/ -namespace UnityLibrary -{ - public class MeteorRing : MonoBehaviour - { - public int totalCount = 5000; - public float ringRadius = 10; - public float ringHeight = 1; - - void Start() - { - for (int i = 0; i < totalCount; i++) - { - // outer ring - float angle = i * (Mathf.PI * 2) / totalCount; - var x = Mathf.Sin(angle) * ringRadius; - var y = Mathf.Cos(angle) * ringRadius; - var pos = new Vector3(x, 0, y); - - // spread within outer ring - pos += Random.insideUnitSphere * ringHeight; - - // draw - Debug.DrawRay(pos, Vector3.up * 0.05f, Color.yellow, 100); - } - } - } -} diff --git a/Assets/Scripts/Misc/MeteorRing.cs.meta b/Assets/Scripts/Misc/MeteorRing.cs.meta deleted file mode 100644 index bcfab7b..0000000 --- a/Assets/Scripts/Misc/MeteorRing.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 3f41ba8b090d5494b9cd0abb0d73b17e -timeCreated: 1500793401 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Misc/TexturePixels2Quads.cs b/Assets/Scripts/Misc/TexturePixels2Quads.cs deleted file mode 100644 index c1ffe69..0000000 --- a/Assets/Scripts/Misc/TexturePixels2Quads.cs +++ /dev/null @@ -1,28 +0,0 @@ -using UnityEngine; -using System.Collections; - -// Usage: -// - assign texture (that has [x] read/write enabled in inspector -// - assign Quad mesh (prefab) to planePrefab. You can assign Unlit/Color material to the quad prefab first. -namespace UnityLibrary -{ - public class TexturePixels2Quads : MonoBehaviour - { - public Texture2D tex; - public Renderer planePrefab; - - void Start() - { - for (int x = 0; x < tex.width; x++) - { - for (int y = 0; y < tex.height; y++) - { - var c = tex.GetPixel(x, y); - var pos = new Vector3(x, y, 0); - var plane = Instantiate(planePrefab, pos, Quaternion.identity) as Renderer; - plane.material.color = c; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Misc/TexturePixels2Quads.cs.meta b/Assets/Scripts/Misc/TexturePixels2Quads.cs.meta deleted file mode 100644 index 2c5efc0..0000000 --- a/Assets/Scripts/Misc/TexturePixels2Quads.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 08b5cc9c62b05af448a31c6d2d020701 -timeCreated: 1500793399 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/README.md.meta b/Assets/Scripts/README.md.meta deleted file mode 100644 index 1ba400c..0000000 --- a/Assets/Scripts/README.md.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 3769a76ec6f190546995c89726eaf150 -timeCreated: 1500793394 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Serialization.meta b/Assets/Scripts/Serialization.meta deleted file mode 100644 index 04399dd..0000000 --- a/Assets/Scripts/Serialization.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 9f168be270e83ad41bcba642d638e64e -folderAsset: yes -timeCreated: 1501219232 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Serialization/Color32Serializable.cs b/Assets/Scripts/Serialization/Color32Serializable.cs deleted file mode 100644 index 4ca9832..0000000 --- a/Assets/Scripts/Serialization/Color32Serializable.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using UnityEngine; - -/// -/// Representation of RGBA colors in 32 bit format. -/// -namespace UnityLibrary -{ - [Serializable] - public struct Color32Serializable : ISerializable - { - - #region Parameters - - /// - /// Th Red. - /// - public byte r; - - /// - /// The Green. - /// - public byte g; - - /// - /// The Blue. - /// - public byte b; - - /// - /// The Alpha. - /// - public byte a; - - #endregion - - #region Constructors - - /// - /// Initializes a new instance of the struct. - /// - /// Color. - public Color32Serializable(Color32 color) : this(color.r, color.g, color.b, color.a) - { - } - - /// - /// Initializes a new instance of the struct. - /// - /// The red component. - /// The green component. - /// The blue component. - /// The alpha component. - public Color32Serializable(byte r, byte g, byte b, byte a) - { - this.r = r; - this.g = g; - this.b = b; - this.a = a; - } - - #endregion - - #region Operators Overload - - public static implicit operator Color32Serializable(Color32 color) - { - return new Color32Serializable(color); - } - - public static implicit operator Color32(Color32Serializable color) - { - return new Color32(color.r, color.g, color.b, color.a); - } - - #endregion - - #region ISerializable implementation - - public void GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue("r", this.r, typeof(byte)); - info.AddValue("g", this.g, typeof(byte)); - info.AddValue("b", this.b, typeof(byte)); - info.AddValue("a", this.a, typeof(byte)); - } - - #endregion - - } -} \ No newline at end of file diff --git a/Assets/Scripts/Serialization/Color32Serializable.cs.meta b/Assets/Scripts/Serialization/Color32Serializable.cs.meta deleted file mode 100644 index a552449..0000000 --- a/Assets/Scripts/Serialization/Color32Serializable.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 061cb47411476a94d8f5231532065360 -timeCreated: 1501219363 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Serialization/ColorSerializable.cs b/Assets/Scripts/Serialization/ColorSerializable.cs deleted file mode 100644 index 7a54589..0000000 --- a/Assets/Scripts/Serialization/ColorSerializable.cs +++ /dev/null @@ -1,104 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using UnityEngine; - -/// -/// Representation of RGBA colors. -/// -namespace UnityLibrary -{ - [Serializable] - public struct ColorSerializable : ISerializable - { - - #region Parameters - - /// - /// Th Red. - /// - public float r; - - /// - /// The Green. - /// - public float g; - - /// - /// The Blue. - /// - public float b; - - /// - /// The Alpha. - /// - public float a; - - #endregion - - #region Constructors - - /// - /// Initializes a new instance of the struct. - /// - /// The red component. - /// The green component. - /// The blue component. - public ColorSerializable(float r, float g, float b) : this(r, g, b, 1f) - { - } - - /// - /// Initializes a new instance of the struct. - /// - /// Color. - public ColorSerializable(Color color) : this(color.r, color.g, color.b, color.a) - { - } - - /// - /// Initializes a new instance of the struct. - /// - /// The red component. - /// The green component. - /// The blue component. - /// The alpha component. - public ColorSerializable(float r, float g, float b, float a) - { - this.r = r; - this.g = g; - this.b = b; - this.a = a; - } - - #endregion - - #region Operators Overload - - public static implicit operator ColorSerializable(Color color) - { - return new ColorSerializable(color); - } - - public static implicit operator Color(ColorSerializable color) - { - return new Color(color.r, color.g, color.b, color.a); - } - - #endregion - - #region ISerializable implementation - - public void GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue("r", this.r, typeof(float)); - info.AddValue("g", this.g, typeof(float)); - info.AddValue("b", this.b, typeof(float)); - info.AddValue("a", this.a, typeof(float)); - } - - #endregion - - } -} \ No newline at end of file diff --git a/Assets/Scripts/Serialization/ColorSerializable.cs.meta b/Assets/Scripts/Serialization/ColorSerializable.cs.meta deleted file mode 100644 index 523b387..0000000 --- a/Assets/Scripts/Serialization/ColorSerializable.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 3b3f6bf5ffa85a94a844cd82e24937d5 -timeCreated: 1501219355 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Serialization/MeshSerializable.cs b/Assets/Scripts/Serialization/MeshSerializable.cs deleted file mode 100644 index 62a99e3..0000000 --- a/Assets/Scripts/Serialization/MeshSerializable.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using UnityEngine; - -/// -/// A class that allows creating and modifying meshes from scripts. -/// -namespace UnityLibrary -{ - [Serializable] - public sealed class MeshSerializable : UnityEngine.Object, ISerializable - { - - #region Parameters - - public Vector3[] vertices; - public int[] triangles; - public Vector3[] normals; - public Color[] colors; - public Vector4[] tangents; - public Color32[] colors32; - public Vector2[] uv; - public Vector2[] uv2; - public Vector2[] uv3; - public Vector2[] uv4; - - #endregion - - #region Constructors - - /// - /// Initializes a new instance of the class. - /// - public MeshSerializable() : this(new Mesh()) - { - - } - - /// - /// Initializes a new instance of the class. - /// - /// Mesh. - public MeshSerializable(Mesh mesh) - { - this.vertices = mesh.vertices; - this.triangles = mesh.triangles; - this.normals = mesh.normals; - this.colors = mesh.colors; - this.tangents = mesh.tangents; - this.colors32 = mesh.colors32; - this.uv = mesh.uv; - this.uv2 = mesh.uv2; - this.uv3 = mesh.uv3; - this.uv4 = mesh.uv4; - } - - #endregion - - #region Operators Overload - - public static implicit operator MeshSerializable(Mesh mesh) - { - return new MeshSerializable(mesh); - } - - public static implicit operator Mesh(MeshSerializable mesh) - { - Mesh result = new Mesh(); - result.vertices = mesh.vertices; - result.triangles = mesh.triangles; - result.normals = mesh.normals; - result.colors = mesh.colors; - result.tangents = mesh.tangents; - result.colors32 = mesh.colors32; - result.uv = mesh.uv; - result.uv2 = mesh.uv2; - result.uv3 = mesh.uv3; - result.uv4 = mesh.uv4; - return result; - } - - #endregion - - #region ISerializable implementation - - public void GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue("vertices", this.vertices, typeof(Vector3[])); - info.AddValue("triangles", this.triangles, typeof(int[])); - info.AddValue("normals", this.normals, typeof(Vector3[])); - info.AddValue("colors", this.colors, typeof(Color[])); - info.AddValue("tangents", this.tangents, typeof(Vector4[])); - info.AddValue("colors32", this.colors32, typeof(Color32[])); - info.AddValue("uv", this.uv, typeof(Vector3[])); - info.AddValue("uv2", this.uv2, typeof(Vector3[])); - info.AddValue("uv3", this.uv3, typeof(Vector3[])); - info.AddValue("uv4", this.uv4, typeof(Vector3[])); - } - - #endregion - - } -} diff --git a/Assets/Scripts/Serialization/MeshSerializable.cs.meta b/Assets/Scripts/Serialization/MeshSerializable.cs.meta deleted file mode 100644 index 1b63ced..0000000 --- a/Assets/Scripts/Serialization/MeshSerializable.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: cefc979bdf83eee4f9f3bc6cae4700a8 -timeCreated: 1501219306 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Serialization/QuaternionSerializable.cs b/Assets/Scripts/Serialization/QuaternionSerializable.cs deleted file mode 100644 index 00dfbe6..0000000 --- a/Assets/Scripts/Serialization/QuaternionSerializable.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using UnityEngine; - -/// -/// Quaternions are used to represent rotations. -/// -[Serializable] -public struct QuaternionSerializable : ISerializable -{ - - #region Parameters - - /// - /// The x component. - /// - public float x; - - /// - /// The y component. - /// - public float y; - - /// - /// The z component. - /// - public float z; - - /// - /// The w component. - /// - public float w; - - #endregion - - #region Constructors - - /// - /// Initializes a new instance of the struct. - /// - /// Quaternion. - public QuaternionSerializable ( Quaternion quaternion ) : this ( quaternion.x, quaternion.y, quaternion.z, quaternion.w ) - { - } - - /// - /// Initializes a new instance of the struct. - /// - /// The x coordinate. - /// The y coordinate. - /// The z coordinate. - /// The width. - public QuaternionSerializable ( float x, float y, float z, float w ) - { - this.x = x; - this.y = y; - this.z = z; - this.w = w; - } - - #endregion - - #region Operators Overload - - public static implicit operator QuaternionSerializable ( Quaternion quaternion ) - { - return new QuaternionSerializable ( quaternion ); - } - - public static implicit operator Quaternion ( QuaternionSerializable quaternion ) - { - return new Quaternion ( quaternion.x, quaternion.y, quaternion.z, quaternion.w ); - } - - #endregion - - #region ISerializable implementation - - public void GetObjectData ( SerializationInfo info, StreamingContext context ) - { - info.AddValue ( "x", this.x, typeof ( float ) ); - info.AddValue ( "y", this.y, typeof ( float ) ); - info.AddValue ( "z", this.z, typeof ( float ) ); - info.AddValue ( "w", this.w, typeof ( float ) ); - } - - #endregion - -} diff --git a/Assets/Scripts/Serialization/QuaternionSerializable.cs.meta b/Assets/Scripts/Serialization/QuaternionSerializable.cs.meta deleted file mode 100644 index fc9242a..0000000 --- a/Assets/Scripts/Serialization/QuaternionSerializable.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 0478a8da07814774989772b1065d060b -timeCreated: 1501219344 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Serialization/Vector2Serializable.cs b/Assets/Scripts/Serialization/Vector2Serializable.cs deleted file mode 100644 index db8ab97..0000000 --- a/Assets/Scripts/Serialization/Vector2Serializable.cs +++ /dev/null @@ -1,158 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using UnityEngine; - -/// -/// Representation of 2D vectors and points. -/// -namespace UnityLibrary -{ - [Serializable] - public struct Vector2Serializable : ISerializable - { - - #region Parametres - - /// - /// X component of the vector. - /// - public float x; - - /// - /// Y component of the vector. - /// - public float y; - - #endregion - - #region Constructors - - /// - /// Initializes a new instance of the struct. - /// - /// Vector. - public Vector2Serializable(Vector2 vector) : this(vector.x, vector.y) - { - } - - /// - /// Initializes a new instance of the struct. - /// - /// Vector. - public Vector2Serializable(Vector3 vector) : this(vector.x, vector.y) - { - } - - /// - /// Initializes a new instance of the struct. - /// - /// Vector. - public Vector2Serializable(Vector4 vector) : this(vector.x, vector.y) - { - } - - /// - /// Initializes a new instance of the struct. - /// - /// The x coordinate. - /// The y coordinate. - public Vector2Serializable(float x, float y) - { - this.x = x; - this.y = y; - } - - #endregion - - #region Methods - - public override bool Equals(object obj) - { - if (obj is Vector2Serializable || obj is Vector2) - { - Vector2Serializable vector = (Vector2Serializable)obj; - return this.x == vector.x && this.y == vector.y; - } - return false; - } - - public override int GetHashCode() - { - return this.x.GetHashCode() ^ this.y.GetHashCode() << 2; - } - - public override string ToString() - { - return string.Format("({0}, {1})", this.x, this.y); - } - - #endregion - - #region Operators Overload - - public static implicit operator Vector2Serializable(Vector2 vector) - { - return new Vector2Serializable(vector); - } - - public static implicit operator Vector2(Vector2Serializable vector) - { - return new Vector2(vector.x, vector.y); - } - - public static implicit operator Vector2Serializable(Vector3 vector) - { - return new Vector2Serializable(vector); - } - - public static implicit operator Vector3(Vector2Serializable vector) - { - return new Vector3(vector.x, vector.y); - } - - public static implicit operator Vector2Serializable(Vector4 vector) - { - return new Vector2Serializable(vector); - } - - public static implicit operator Vector4(Vector2Serializable vector) - { - return new Vector4(vector.x, vector.y); - } - - public static implicit operator Vector2Serializable(Vector3Serializable vector) - { - return new Vector2Serializable((Vector2)vector); - } - - public static implicit operator Vector3Serializable(Vector2Serializable vector) - { - return new Vector3Serializable((Vector2)vector); - } - - public static implicit operator Vector2Serializable(Vector4Serializable vector) - { - return new Vector2Serializable((Vector2)vector); - } - - public static implicit operator Vector4Serializable(Vector2Serializable vector) - { - return new Vector4Serializable((Vector2)vector); - } - - #endregion - - #region ISerializable implementation - - public void GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue("x", this.x, typeof(float)); - info.AddValue("y", this.y, typeof(float)); - } - - #endregion - - } -} \ No newline at end of file diff --git a/Assets/Scripts/Serialization/Vector2Serializable.cs.meta b/Assets/Scripts/Serialization/Vector2Serializable.cs.meta deleted file mode 100644 index a9fc810..0000000 --- a/Assets/Scripts/Serialization/Vector2Serializable.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: fba189e2785c0d044acb994360e29d47 -timeCreated: 1501219297 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Serialization/Vector3Serializable.cs b/Assets/Scripts/Serialization/Vector3Serializable.cs deleted file mode 100644 index 053ace1..0000000 --- a/Assets/Scripts/Serialization/Vector3Serializable.cs +++ /dev/null @@ -1,175 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using UnityEngine; - -/// -/// Representation of 3D vectors and points. -/// -namespace UnityLibrary -{ - [Serializable] - public struct Vector3Serializable : ISerializable - { - - #region Parametres - - /// - /// X component of the vector. - /// - public float x; - - /// - /// Y component of the vector. - /// - public float y; - - /// - /// Z component of the vector. - /// - public float z; - - #endregion - - #region Constructors - - /// - /// Initializes a new instance of the struct. - /// - /// Vector. - public Vector3Serializable(Vector2 vector) : this(vector.x, vector.y) - { - } - - /// - /// Initializes a new instance of the struct. - /// - /// Vector. - public Vector3Serializable(Vector3 vector) : this(vector.x, vector.y, vector.z) - { - } - - /// - /// Initializes a new instance of the struct. - /// - /// Vector. - public Vector3Serializable(Vector4 vector) : this(vector.x, vector.y, vector.z) - { - } - - /// - /// Initializes a new instance of the struct. - /// - /// The x coordinate. - /// The y coordinate. - public Vector3Serializable(float x, float y) : this(x, y, 0f) - { - } - - /// - /// Initializes a new instance of the struct. - /// - /// The x coordinate. - /// The y coordinate. - /// The z coordinate. - public Vector3Serializable(float x, float y, float z) - { - this.x = x; - this.y = y; - this.z = z; - } - - #endregion - - #region Methods - - public override bool Equals(object obj) - { - if (obj is Vector3Serializable || obj is Vector3) - { - Vector3Serializable vector = (Vector3Serializable)obj; - return this.x == vector.x && this.y == vector.y && this.z == vector.z; - } - return false; - } - - public override int GetHashCode() - { - return this.x.GetHashCode() ^ this.y.GetHashCode() << 2 ^ this.z.GetHashCode() >> 2; - } - - public override string ToString() - { - return string.Format("({0}, {1}, {2})", this.x, this.y, this.z); - } - - #endregion - - #region Operators Overload - - public static implicit operator Vector3Serializable(Vector2 vector) - { - return new Vector3Serializable(vector); - } - - public static implicit operator Vector2(Vector3Serializable vector) - { - return new Vector2(vector.x, vector.y); - } - - public static implicit operator Vector3Serializable(Vector3 vector) - { - return new Vector3Serializable(vector); - } - - public static implicit operator Vector3(Vector3Serializable vector) - { - return new Vector3(vector.x, vector.y, vector.z); - } - - public static implicit operator Vector3Serializable(Vector4 vector) - { - return new Vector3Serializable(vector); - } - - public static implicit operator Vector4(Vector3Serializable vector) - { - return new Vector4(vector.x, vector.y, vector.z); - } - - public static implicit operator Vector3Serializable(Vector2Serializable vector) - { - return new Vector3Serializable((Vector3)vector); - } - - public static implicit operator Vector2Serializable(Vector3Serializable vector) - { - return new Vector2Serializable((Vector3)vector); - } - - public static implicit operator Vector3Serializable(Vector4Serializable vector) - { - return new Vector3Serializable((Vector3)vector); - } - - public static implicit operator Vector4Serializable(Vector3Serializable vector) - { - return new Vector4Serializable((Vector3)vector); - } - - #endregion - - #region ISerializable implementation - - public void GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue("x", this.x, typeof(float)); - info.AddValue("y", this.y, typeof(float)); - info.AddValue("z", this.z, typeof(float)); - } - - #endregion - - } -} diff --git a/Assets/Scripts/Serialization/Vector3Serializable.cs.meta b/Assets/Scripts/Serialization/Vector3Serializable.cs.meta deleted file mode 100644 index c43c852..0000000 --- a/Assets/Scripts/Serialization/Vector3Serializable.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 6c5e14b336560c043bf6176b01621604 -timeCreated: 1501219289 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Serialization/Vector4Serializable.cs b/Assets/Scripts/Serialization/Vector4Serializable.cs deleted file mode 100644 index 2f85748..0000000 --- a/Assets/Scripts/Serialization/Vector4Serializable.cs +++ /dev/null @@ -1,193 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using UnityEngine; - -/// -/// Representation of four-dimensional vectors. -/// -namespace UnityLibrary -{ - [Serializable] - public struct Vector4Serializable : ISerializable - { - - #region Parametres - - /// - /// X component of the vector. - /// - public float x; - - /// - /// Y component of the vector. - /// - public float y; - - /// - /// Z component of the vector. - /// - public float z; - - /// - /// W component of the vector. - /// - public float w; - - #endregion - - #region Constructors - - /// - /// Initializes a new instance of the struct. - /// - /// Vector. - public Vector4Serializable(Vector2 vector) : this(vector.x, vector.y) - { - } - - /// - /// Initializes a new instance of the struct. - /// - /// Vector. - public Vector4Serializable(Vector3 vector) : this(vector.x, vector.y, vector.z) - { - } - - /// - /// Initializes a new instance of the struct. - /// - /// Vector. - public Vector4Serializable(Vector4 vector) : this(vector.x, vector.y, vector.z, vector.w) - { - } - - /// - /// Initializes a new instance of the struct. - /// - /// The x coordinate. - /// The y coordinate. - public Vector4Serializable(float x, float y) : this(x, y, 0f) - { - } - - /// - /// Initializes a new instance of the struct. - /// - /// The x coordinate. - /// The y coordinate. - /// The z coordinate. - public Vector4Serializable(float x, float y, float z) : this(x, y, z, 0f) - { - } - - /// - /// Initializes a new instance of the struct. - /// - /// The x coordinate. - /// The y coordinate. - /// The z coordinate. - /// The width. - public Vector4Serializable(float x, float y, float z, float w) - { - this.x = x; - this.y = y; - this.z = z; - this.w = w; - } - - #endregion - - #region Methods - - public override bool Equals(object obj) - { - if (obj is Vector4Serializable || obj is Vector4) - { - Vector4Serializable vector = (Vector4Serializable)obj; - return this.x == vector.x && this.y == vector.y && this.z == vector.z && this.w == vector.w; - } - return false; - } - - public override int GetHashCode() - { - return this.x.GetHashCode() ^ this.y.GetHashCode() << 2 ^ this.z.GetHashCode() >> 2 ^ this.w.GetHashCode() >> 1; - } - - public override string ToString() - { - return string.Format("({0}, {1}, {2}, {3})", this.x, this.y, this.z, this.w); - } - - #endregion - - #region Operators Overload - - public static implicit operator Vector4Serializable(Vector2 vector) - { - return new Vector4Serializable(vector); - } - - public static implicit operator Vector2(Vector4Serializable vector) - { - return new Vector2(vector.x, vector.y); - } - - public static implicit operator Vector4Serializable(Vector3 vector) - { - return new Vector4Serializable(vector); - } - - public static implicit operator Vector3(Vector4Serializable vector) - { - return new Vector3(vector.x, vector.y, vector.z); - } - - public static implicit operator Vector4Serializable(Vector4 vector) - { - return new Vector4Serializable(vector); - } - - public static implicit operator Vector4(Vector4Serializable vector) - { - return new Vector4(vector.x, vector.y, vector.z, vector.w); - } - - public static implicit operator Vector4Serializable(Vector2Serializable vector) - { - return new Vector4Serializable((Vector4)vector); - } - - public static implicit operator Vector2Serializable(Vector4Serializable vector) - { - return new Vector2Serializable((Vector4)vector); - } - - public static implicit operator Vector4Serializable(Vector3Serializable vector) - { - return new Vector4Serializable((Vector4)vector); - } - - public static implicit operator Vector3Serializable(Vector4Serializable vector) - { - return new Vector3Serializable((Vector4)vector); - } - - #endregion - - #region ISerializable implementation - - public void GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue("x", this.x, typeof(float)); - info.AddValue("y", this.y, typeof(float)); - info.AddValue("z", this.w, typeof(float)); - info.AddValue("w", this.w, typeof(float)); - } - - #endregion - - } -} diff --git a/Assets/Scripts/Serialization/Vector4Serializable.cs.meta b/Assets/Scripts/Serialization/Vector4Serializable.cs.meta deleted file mode 100644 index c887273..0000000 --- a/Assets/Scripts/Serialization/Vector4Serializable.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: fb0c350f61853c243946e31479fabb1e -timeCreated: 1501219243 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/StandardAssets.meta b/Assets/Scripts/StandardAssets.meta deleted file mode 100644 index 943a56a..0000000 --- a/Assets/Scripts/StandardAssets.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 68d0fff757765464085386ad8f2ba1a3 -folderAsset: yes -timeCreated: 1500793395 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/StandardAssets/Effects.meta b/Assets/Scripts/StandardAssets/Effects.meta deleted file mode 100644 index ddd6aed..0000000 --- a/Assets/Scripts/StandardAssets/Effects.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: e4f90274a4ad23c45acb3f913c13ede9 -folderAsset: yes -timeCreated: 1500793397 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/StandardAssets/Effects/ImageEffects.meta b/Assets/Scripts/StandardAssets/Effects/ImageEffects.meta deleted file mode 100644 index 892ed59..0000000 --- a/Assets/Scripts/StandardAssets/Effects/ImageEffects.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 2260bfb777ab88a499b7f61f535056b9 -folderAsset: yes -timeCreated: 1500793397 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/StandardAssets/Effects/ImageEffects/Scripts.meta b/Assets/Scripts/StandardAssets/Effects/ImageEffects/Scripts.meta deleted file mode 100644 index 11d902b..0000000 --- a/Assets/Scripts/StandardAssets/Effects/ImageEffects/Scripts.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 33b3dd2e4d992da4695f9520dbb410bc -folderAsset: yes -timeCreated: 1500793398 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/StandardAssets/Effects/ImageEffects/Scripts/ColorCorrectionCurvesLayers.cs b/Assets/Scripts/StandardAssets/Effects/ImageEffects/Scripts/ColorCorrectionCurvesLayers.cs deleted file mode 100644 index f97eeda..0000000 --- a/Assets/Scripts/StandardAssets/Effects/ImageEffects/Scripts/ColorCorrectionCurvesLayers.cs +++ /dev/null @@ -1,235 +0,0 @@ -using System; -using UnityEngine; - -// Usage: Place this file into /Standard Assets/Effects/ImageEffects/Scripts/-folder -// Requires: https://github.com/UnityCommunity/UnityLibrary/blob/master/Scripts/Editor/ImageEffects/ColorCorrectionCurvesEditorLayers -// Deprecated for the post-processing stack - -#if !UNITY_5_3_OR_NEWER -namespace UnityStandardAssets.ImageEffects -{ - [ExecuteInEditMode] - [AddComponentMenu ("Image Effects/Color Adjustments/Color Correction (Curves, Saturation) Layers")] - public class ColorCorrectionCurvesLayers : PostEffectsBase - { - public enum ColorCorrectionMode - { - Simple = 0, - Advanced = 1 - } - - public AnimationCurve redChannel = new AnimationCurve(new Keyframe(0f,0f), new Keyframe(1f,1f)); - public AnimationCurve greenChannel = new AnimationCurve(new Keyframe(0f,0f), new Keyframe(1f,1f)); - public AnimationCurve blueChannel = new AnimationCurve(new Keyframe(0f,0f), new Keyframe(1f,1f)); - - public bool useDepthCorrection = false; - - public AnimationCurve zCurve = new AnimationCurve(new Keyframe(0f,0f), new Keyframe(1f,1f)); - public AnimationCurve depthRedChannel = new AnimationCurve(new Keyframe(0f,0f), new Keyframe(1f,1f)); - public AnimationCurve depthGreenChannel = new AnimationCurve(new Keyframe(0f,0f), new Keyframe(1f,1f)); - public AnimationCurve depthBlueChannel = new AnimationCurve(new Keyframe(0f,0f), new Keyframe(1f,1f)); - - private Material ccMaterial; - private Material ccDepthMaterial; - private Material selectiveCcMaterial; - - private Texture2D rgbChannelTex; - private Texture2D rgbDepthChannelTex; - private Texture2D zCurveTex; - - public float saturation = 1.0f; - - public bool selectiveCc = false; - - public Color selectiveFromColor = Color.white; - public Color selectiveToColor = Color.white; - - public ColorCorrectionMode mode; - - public bool updateTextures = true; - - public Shader colorCorrectionCurvesShader = null; - public Shader simpleColorCorrectionCurvesShader = null; - public Shader colorCorrectionSelectiveShader = null; - - private bool updateTexturesOnStartup = true; - - public LayerMask excludeLayers = 0; - - private GameObject tmpCam = null; - private Camera _camera; - - - void Start () - { - base.Start (); - updateTexturesOnStartup = true; - } - - void Awake () { } - - - public override bool CheckResources () - { - CheckSupport (mode == ColorCorrectionMode.Advanced); - - ccMaterial = CheckShaderAndCreateMaterial (simpleColorCorrectionCurvesShader, ccMaterial); - ccDepthMaterial = CheckShaderAndCreateMaterial (colorCorrectionCurvesShader, ccDepthMaterial); - selectiveCcMaterial = CheckShaderAndCreateMaterial (colorCorrectionSelectiveShader, selectiveCcMaterial); - - if (!rgbChannelTex) - rgbChannelTex = new Texture2D (256, 4, TextureFormat.ARGB32, false, true); - if (!rgbDepthChannelTex) - rgbDepthChannelTex = new Texture2D (256, 4, TextureFormat.ARGB32, false, true); - if (!zCurveTex) - zCurveTex = new Texture2D (256, 1, TextureFormat.ARGB32, false, true); - - rgbChannelTex.hideFlags = HideFlags.DontSave; - rgbDepthChannelTex.hideFlags = HideFlags.DontSave; - zCurveTex.hideFlags = HideFlags.DontSave; - - rgbChannelTex.wrapMode = TextureWrapMode.Clamp; - rgbDepthChannelTex.wrapMode = TextureWrapMode.Clamp; - zCurveTex.wrapMode = TextureWrapMode.Clamp; - - if (!isSupported) - ReportAutoDisable (); - return isSupported; - } - - public void UpdateParameters () - { - CheckResources(); // textures might not be created if we're tweaking UI while disabled - - if (redChannel != null && greenChannel != null && blueChannel != null) - { - for (float i = 0.0f; i <= 1.0f; i += 1.0f / 255.0f) - { - float rCh = Mathf.Clamp (redChannel.Evaluate(i), 0.0f, 1.0f); - float gCh = Mathf.Clamp (greenChannel.Evaluate(i), 0.0f, 1.0f); - float bCh = Mathf.Clamp (blueChannel.Evaluate(i), 0.0f, 1.0f); - - rgbChannelTex.SetPixel ((int) Mathf.Floor(i*255.0f), 0, new Color(rCh,rCh,rCh) ); - rgbChannelTex.SetPixel ((int) Mathf.Floor(i*255.0f), 1, new Color(gCh,gCh,gCh) ); - rgbChannelTex.SetPixel ((int) Mathf.Floor(i*255.0f), 2, new Color(bCh,bCh,bCh) ); - - float zC = Mathf.Clamp (zCurve.Evaluate(i), 0.0f,1.0f); - - zCurveTex.SetPixel ((int) Mathf.Floor(i*255.0f), 0, new Color(zC,zC,zC) ); - - rCh = Mathf.Clamp (depthRedChannel.Evaluate(i), 0.0f,1.0f); - gCh = Mathf.Clamp (depthGreenChannel.Evaluate(i), 0.0f,1.0f); - bCh = Mathf.Clamp (depthBlueChannel.Evaluate(i), 0.0f,1.0f); - - rgbDepthChannelTex.SetPixel ((int) Mathf.Floor(i*255.0f), 0, new Color(rCh,rCh,rCh) ); - rgbDepthChannelTex.SetPixel ((int) Mathf.Floor(i*255.0f), 1, new Color(gCh,gCh,gCh) ); - rgbDepthChannelTex.SetPixel ((int) Mathf.Floor(i*255.0f), 2, new Color(bCh,bCh,bCh) ); - } - - rgbChannelTex.Apply (); - rgbDepthChannelTex.Apply (); - zCurveTex.Apply (); - } - } - - void UpdateTextures () - { - UpdateParameters (); - } - - void OnRenderImage (RenderTexture source, RenderTexture destination) - { - if (CheckResources()==false) - { - Graphics.Blit (source, destination); - return; - } - - if (updateTexturesOnStartup) - { - UpdateParameters (); - updateTexturesOnStartup = false; - } - - if (useDepthCorrection) - GetComponent().depthTextureMode |= DepthTextureMode.Depth; - - RenderTexture renderTarget2Use = destination; - - if (selectiveCc) - { - renderTarget2Use = RenderTexture.GetTemporary (source.width, source.height); - } - - if (useDepthCorrection) - { - ccDepthMaterial.SetTexture ("_RgbTex", rgbChannelTex); - ccDepthMaterial.SetTexture ("_ZCurve", zCurveTex); - ccDepthMaterial.SetTexture ("_RgbDepthTex", rgbDepthChannelTex); - ccDepthMaterial.SetFloat ("_Saturation", saturation); - - Graphics.Blit (source, renderTarget2Use, ccDepthMaterial); - } - else - { - ccMaterial.SetTexture ("_RgbTex", rgbChannelTex); - ccMaterial.SetFloat ("_Saturation", saturation); - - Graphics.Blit (source, renderTarget2Use, ccMaterial); - } - - if (selectiveCc) - { - selectiveCcMaterial.SetColor ("selColor", selectiveFromColor); - selectiveCcMaterial.SetColor ("targetColor", selectiveToColor); - Graphics.Blit (renderTarget2Use, destination, selectiveCcMaterial); - - RenderTexture.ReleaseTemporary (renderTarget2Use); - } - - // exclude layers - Camera cam = null; - if (excludeLayers.value != 0) cam = GetTmpCam(); - - if (cam && excludeLayers.value != 0) - { - cam.targetTexture = destination; - cam.cullingMask = excludeLayers; - cam.Render(); - } - - } - - Camera GetTmpCam() - { - if (tmpCam == null) - { - if (_camera == null) _camera = GetComponent(); - - string name = "_" + _camera.name + "_ColorCorrectionTmpCam"; - GameObject go = GameObject.Find(name); - - if (null == go) // couldn't find, recreate - { - tmpCam = new GameObject(name, typeof(Camera)); - } else - { - tmpCam = go; - } - } - - tmpCam.hideFlags = HideFlags.DontSave; - tmpCam.transform.position = _camera.transform.position; - tmpCam.transform.rotation = _camera.transform.rotation; - tmpCam.transform.localScale = _camera.transform.localScale; - tmpCam.GetComponent().CopyFrom(_camera); - - tmpCam.GetComponent().enabled = false; - tmpCam.GetComponent().depthTextureMode = DepthTextureMode.None; - tmpCam.GetComponent().clearFlags = CameraClearFlags.Nothing; - - return tmpCam.GetComponent(); - } - } -} -#endif diff --git a/Assets/Scripts/StandardAssets/Effects/ImageEffects/Scripts/ColorCorrectionCurvesLayers.cs.meta b/Assets/Scripts/StandardAssets/Effects/ImageEffects/Scripts/ColorCorrectionCurvesLayers.cs.meta deleted file mode 100644 index 66a3390..0000000 --- a/Assets/Scripts/StandardAssets/Effects/ImageEffects/Scripts/ColorCorrectionCurvesLayers.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 2e50bcdf16588814ca6defae8b5d7dd4 -timeCreated: 1500793401 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Texture/GradientTextureMaker.cs b/Assets/Scripts/Texture/GradientTextureMaker.cs deleted file mode 100644 index 2db2887..0000000 --- a/Assets/Scripts/Texture/GradientTextureMaker.cs +++ /dev/null @@ -1,61 +0,0 @@ -// returns gradient Texture2D (size=256x1) - -using UnityEngine; - -namespace UnityLibrary -{ - public static class GradientTextureMaker - { - const int width = 256; - const int height = 1; - - public static Texture2D Create(Color[] colors, TextureWrapMode textureWrapMode = TextureWrapMode.Clamp, FilterMode filterMode = FilterMode.Point, bool isLinear = false, bool hasMipMap = false) - { - if (colors == null || colors.Length == 0) - { - Debug.LogError("No colors assigned"); - return null; - } - - int length = colors.Length; - if (colors.Length > 8) - { - Debug.LogWarning("Too many colors! maximum is 8, assigned: " + colors.Length); - length = 8; - } - - // build gradient from colors - var colorKeys = new GradientColorKey[length]; - var alphaKeys = new GradientAlphaKey[length]; - - float steps = length - 1f; - for (int i = 0; i < length; i++) - { - float step = i / steps; - colorKeys[i].color = colors[i]; - colorKeys[i].time = step; - alphaKeys[i].alpha = colors[i].a; - alphaKeys[i].time = step; - } - - // create gradient - Gradient gradient = new Gradient(); - gradient.SetKeys(colorKeys, alphaKeys); - - // create texture - Texture2D outputTex = new Texture2D(width, height, TextureFormat.ARGB32, false, isLinear); - outputTex.wrapMode = textureWrapMode; - outputTex.filterMode = filterMode; - - // draw texture - for (int i = 0; i < width; i++) - { - outputTex.SetPixel(i, 0, gradient.Evaluate((float)i / (float)width)); - } - outputTex.Apply(false); - - return outputTex; - } // BuildGradientTexture - - } // class -} // namespcae diff --git a/Assets/Scripts/Threading.meta b/Assets/Scripts/Threading.meta deleted file mode 100644 index 97add67..0000000 --- a/Assets/Scripts/Threading.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 0b51762ded3cb9b4da62090d1c50dc40 -folderAsset: yes -timeCreated: 1500793393 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Threading/ThreadPoolTest.cs b/Assets/Scripts/Threading/ThreadPoolTest.cs deleted file mode 100644 index 67c55e7..0000000 --- a/Assets/Scripts/Threading/ThreadPoolTest.cs +++ /dev/null @@ -1,87 +0,0 @@ -using UnityEngine; -using System.Collections; -using System.Threading; - -// Reference: http://www.dotnetperls.com/threadpool -// Usage: Attach this script to gameobject in scene, press play, hit 1 key to queue new threads, see console for progress - -// we pass thread parameters as object -namespace UnityLibrary -{ - class ThreadInfo - { - public int threadIndex; - public Vector3 myVector; - } - - - public class ThreadPoolTest : MonoBehaviour - { - int maxThreads = 2; // set your max threads here - - static readonly object _countLock = new object(); - static int _threadCount = 0; - static bool closingApp = false; - - int clickCounter = 0; - - void Update() - { - // press 1 to spawn thread(s) - if (Input.GetKeyDown(KeyCode.Alpha1)) - { - // Pass these values to the thread. - ThreadInfo threadData = new ThreadInfo(); - threadData.myVector = Random.insideUnitSphere * 10; // get some random vector3 value - threadData.threadIndex = ++clickCounter; - print("Queue new thread #" + threadData.threadIndex); - ThreadPool.QueueUserWorkItem(new WaitCallback(MyWorkerThread), threadData); - } - } - - private void MyWorkerThread(System.Object a) - { - // Constrain the number of worker threads, loop here until less than maxthreads are running - while (!closingApp) - { - // Prevent other threads from changing this under us - lock (_countLock) - { - if (_threadCount < maxThreads && !closingApp) - { - // Start processing - _threadCount++; - break; - } - } - Thread.Sleep(50); - } - - if (closingApp) return; - - // we are ready to work now, prepare object that contains necessary info for the thread - ThreadInfo threadInfo = a as ThreadInfo; - Vector3 myVector = threadInfo.myVector; - int myIndex = threadInfo.threadIndex; - print("---From thread #" + myIndex + " processing myVector " + myVector); - - // for testing we just sleep here (you could do your heavy calculations here) - Thread.Sleep(5000); - - // add this to your heavy work loop, so the thread quits if scene is closed - //if (closingApp) return; - - print("---Finished thread #" + myIndex); - - // decrease thread counter, so other threads can start - _threadCount--; - } - - // set bool to close threads on exit - void OnDestroy() - { - closingApp = true; - } - - } -} diff --git a/Assets/Scripts/Threading/ThreadPoolTest.cs.meta b/Assets/Scripts/Threading/ThreadPoolTest.cs.meta deleted file mode 100644 index 6f5c1fa..0000000 --- a/Assets/Scripts/Threading/ThreadPoolTest.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 2d665831a9a905f4ca438b12feeb15c4 -timeCreated: 1500793401 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Tools/TerrainTreeReplacer.cs b/Assets/Scripts/Tools/TerrainTreeReplacer.cs deleted file mode 100644 index dc0b3a2..0000000 --- a/Assets/Scripts/Tools/TerrainTreeReplacer.cs +++ /dev/null @@ -1,101 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System.Collections; -using System.Collections.Generic; - -public class TerrainTreeReplacer : EditorWindow -{ - private const string RootObjectName = "TREES_CONVERTED"; - - [MenuItem("Window/Tools/Terrain Tree Replacer")] - public static void ShowWindow() - { - EditorWindow.GetWindow(typeof(TerrainTreeReplacer)); - } - - private Terrain terrain; - - private bool disableDrawTreesAndFoliage = false; - private int treeDivisions = 0; - - private bool DivideTreesIntoGroups { get { return treeDivisions > 0; } } - - void OnGUI() - { - GUILayout.Label("Replace Terrain Trees with Objects", EditorStyles.boldLabel); - - terrain = EditorGUILayout.ObjectField("Terrain:", terrain, typeof(Terrain), true) as Terrain; - disableDrawTreesAndFoliage = EditorGUILayout.ToggleLeft("Disable Drawing Trees and Foliage", disableDrawTreesAndFoliage); - - GUILayout.Label("Tree Division groups: " + treeDivisions); - treeDivisions = (int)GUILayout.HorizontalSlider(treeDivisions, 0, 10); - - if (GUILayout.Button("Replace Terrain trees to Objects!")) Replace(); - if (GUILayout.Button("Clear generated trees!")) Clear(); - } - - public void Replace() - { - if (terrain == null) - { - Debug.LogError("Please Assign Terrain"); - return; - } - - Clear(); - - GameObject treeParent = new GameObject(RootObjectName); - - List> treegroups = new List>(); - - if (DivideTreesIntoGroups) - { - for (int i = 0; i < treeDivisions; i++) - { - treegroups.Add(new List()); - for (int j = 0; j < treeDivisions; j++) - { - GameObject treeGroup = new GameObject("TreeGroup_" + i + "_" + j); - treeGroup.transform.parent = treeParent.transform; - treegroups[i].Add(treeGroup.transform); - } - } - } - - TerrainData terrainData = terrain.terrainData; - - float xDiv = terrainData.size.x / (float)treeDivisions; - float zDiv = terrainData.size.z / (float)treeDivisions; - - foreach (TreeInstance tree in terrainData.treeInstances) - { - GameObject treePrefab = terrainData.treePrototypes[tree.prototypeIndex].prefab; - - Vector3 position = Vector3.Scale(tree.position, terrainData.size); - int xGroup = (int)(position.x / xDiv); - int zGroup = (int)(position.z / zDiv); - - position += terrain.transform.position; - - Vector2 lookRotationVector = new Vector2(Mathf.Cos(tree.rotation - Mathf.PI), Mathf.Sin(tree.rotation - Mathf.PI)); - Quaternion rotation = Quaternion.LookRotation(new Vector3(lookRotationVector.x, 0, lookRotationVector.y), Vector3.up); - - Vector3 scale = new Vector3(tree.widthScale, tree.heightScale, tree.widthScale); - - GameObject spawnedTree = Instantiate(treePrefab, position, rotation) as GameObject; - spawnedTree.name = treePrefab.name; - - spawnedTree.transform.localScale = scale; - - if (DivideTreesIntoGroups) spawnedTree.transform.SetParent(treegroups[xGroup][zGroup]); - else spawnedTree.transform.SetParent(treeParent.transform); - } - - if (disableDrawTreesAndFoliage) terrain.drawTreesAndFoliage = false; - } - - public void Clear() - { - DestroyImmediate(GameObject.Find(RootObjectName)); - } -} \ No newline at end of file diff --git a/Assets/Scripts/UI.meta b/Assets/Scripts/UI.meta deleted file mode 100644 index 068da7c..0000000 --- a/Assets/Scripts/UI.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 57b254d4ae25bfb42a2a6d85c3e1b3b2 -folderAsset: yes -timeCreated: 1501227572 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/UI/SetSelected.cs b/Assets/Scripts/UI/SetSelected.cs deleted file mode 100644 index 398ee90..0000000 --- a/Assets/Scripts/UI/SetSelected.cs +++ /dev/null @@ -1,24 +0,0 @@ -// sets UI element selected -// usage: attach to gameobject with UI selectable component (inputfield, button, dropdown. toggle..) - -using UnityEngine; -using UnityEngine.UI; - -namespace UnityLibrary -{ - public class SetSelected : MonoBehaviour - { - void Start() - { - var element = GetComponent(); - - if (element != null && element.interactable == true) - { - element.Select(); - } else - { - Debug.LogWarning("Nothing to set selected..", gameObject); - } - } - } -} diff --git a/Assets/Scripts/UI/SetSelected.cs.meta b/Assets/Scripts/UI/SetSelected.cs.meta deleted file mode 100644 index a734ddc..0000000 --- a/Assets/Scripts/UI/SetSelected.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: e262bedb4c989c241a0fe7a4764cabb1 -timeCreated: 1501227572 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Utilities.meta b/Assets/Scripts/Utilities.meta deleted file mode 100644 index 5e5533c..0000000 --- a/Assets/Scripts/Utilities.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 19c151059837e8743b47a51a8f572228 -folderAsset: yes -timeCreated: 1511611013 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Utilities/Singleton.cs b/Assets/Scripts/Utilities/Singleton.cs deleted file mode 100644 index 0a6d2b1..0000000 --- a/Assets/Scripts/Utilities/Singleton.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public abstract class Singleton : MonoBehaviour where T : Component -{ - - #region Fields - - /// - /// The instance. - /// - private static T instance; - - #endregion - - #region Properties - - /// - /// Gets the instance. - /// - /// The instance. - public static T Instance - { - get - { - if ( instance == null ) - { - instance = FindObjectOfType (); - if ( instance == null ) - { - GameObject obj = new GameObject (); - obj.name = typeof ( T ).Name; - instance = obj.AddComponent (); - } - } - return instance; - } - } - - #endregion - - #region Methods - - /// - /// Use this for initialization. - /// - protected virtual void Awake () - { - if ( instance == null ) - { - instance = this as T; - DontDestroyOnLoad ( gameObject ); - } - else - { - Destroy ( gameObject ); - } - } - - #endregion - -} diff --git a/Assets/Scripts/Utilities/Singleton.cs.meta b/Assets/Scripts/Utilities/Singleton.cs.meta deleted file mode 100644 index 4c9728c..0000000 --- a/Assets/Scripts/Utilities/Singleton.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 95550a6b3e0eebd49a11850ed416e9d9 -timeCreated: 1511611021 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders.meta b/Assets/Shaders.meta deleted file mode 100644 index 7ceb4a8..0000000 --- a/Assets/Shaders.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 0341514ed0c04a14eb37ae0d2aa774d4 -folderAsset: yes -timeCreated: 1500793393 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/2D.meta b/Assets/Shaders/2D.meta deleted file mode 100644 index f3b970e..0000000 --- a/Assets/Shaders/2D.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 99d7fe7c82d52b245bb4ff8844118c1f -folderAsset: yes -timeCreated: 1511612925 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/2D/Debug/HSVDebugger.shader b/Assets/Shaders/2D/Debug/HSVDebugger.shader deleted file mode 100644 index 63f3e20..0000000 --- a/Assets/Shaders/2D/Debug/HSVDebugger.shader +++ /dev/null @@ -1,135 +0,0 @@ -// HSV Debugger Shader by UnityCoder.com - https://unitycoder.com/blog/2018/10/19/hsv-debugging-shader/ - -Shader "UnityLibrary/Debug/HSVDebugger" -{ - Properties - { - _MainTex ("Texture", 2D) = "white" {} - _TargetColor ("Target Color", Color) = (1, 0, 0, 1) - _HueThreshold ("Hue Threshold", Float) = 0.1 - _SatThreshold ("Saturation Threshold", Float) = 0.1 - _ValThreshold ("Value Threshold", Float) = 0.1 - [KeywordEnum(None, Hue, Saturation, Value, HueDistance, SaturationDistance, ValueDistance, ColorMatch, RemapHue)] _Mode ("Draw Mode",float) = 1 - _HueTex ("Hue Gradient Texture", 2D) = "white" {} - } - - SubShader - { - Tags { "RenderType"="Opaque" } - LOD 100 - - Pass - { - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - #pragma multi_compile _MODE_NONE _MODE_HUE _MODE_SATURATION _MODE_VALUE _MODE_HUEDISTANCE _MODE_SATURATIONDISTANCE _MODE_VALUEDISTANCE _MODE_COLORMATCH _MODE_REMAPHUE - - #include "UnityCG.cginc" - - struct appdata - { - float4 vertex : POSITION; - float2 uv : TEXCOORD0; - }; - - struct v2f - { - float2 uv : TEXCOORD0; - float4 vertex : SV_POSITION; - }; - - sampler2D _MainTex; - sampler2D _HueTex; - - float4 _MainTex_ST; - float _HueThreshold; - float _SatThreshold; - float _ValThreshold; - float4 _TargetColor; - - // http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl - float3 rgb2hsv(float3 c) - { - float4 K = float4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); - float4 p = lerp(float4(c.bg, K.wz), float4(c.gb, K.xy), step(c.b, c.g)); - float4 q = lerp(float4(p.xyw, c.r), float4(c.r, p.yzx), step(p.x, c.r)); - float d = q.x - min(q.w, q.y); - float e = 1.0e-10; - return float3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); - } - - v2f vert (appdata v) - { - v2f o; - o.vertex = UnityObjectToClipPos(v.vertex); - o.uv = TRANSFORM_TEX(v.uv, _MainTex); - return o; - } - - fixed4 frag (v2f i) : SV_Target - { - // read main texture - fixed4 tex = tex2D(_MainTex, i.uv); - - // convert colors - float3 sourceHSV = rgb2hsv(tex.rgb); - float3 targetHSV = rgb2hsv(_TargetColor.rbg); - - // get distances to our target color - float hueDist = abs(sourceHSV.x - (1-targetHSV.x)); // why -1? - float satDist = abs(sourceHSV.y - targetHSV.y); - float valDist = abs(sourceHSV.z - targetHSV.z); - - float4 results = tex; - - // select results, based on enum dropdowm - #ifdef _MODE_HUE - results.rgb = sourceHSV.x; - #endif - - #ifdef _MODE_SATURATION - results.rgb = sourceHSV.y; - #endif - - #ifdef _MODE_VALUE - results.rgb = sourceHSV.z; - #endif - - #ifdef _MODE_HUEDISTANCE - results.rgb = hueDist; - #endif - - #ifdef _MODE_SATURATIONDISTANCE - results.rgb = satDist; - #endif - - #ifdef _MODE_VALUEDISTANCE - results.rgb = valDist; - #endif - - #ifdef _MODE_REMAPHUE - results.rgb = tex2D(_HueTex, float2(sourceHSV.x,0.5)).rgb; - #endif - - #ifdef _MODE_COLORMATCH - if (hueDist < _HueThreshold) - { - if (satDist < _SatThreshold) - { - if (valDist < _ValThreshold) - { - // display inverted color for matching area - results.rgb = 1-results.rgb; - } - } - } - #endif - - // draw - return results; - } - ENDCG - } // pass - } // subshader -} // shader diff --git a/Assets/Shaders/2D/Effects.meta b/Assets/Shaders/2D/Effects.meta deleted file mode 100644 index c0a412b..0000000 --- a/Assets/Shaders/2D/Effects.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 4f49c823d2cc1c84eb8af77dcc706003 -folderAsset: yes -timeCreated: 1500793395 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/2D/Effects/Glow.shader b/Assets/Shaders/2D/Effects/Glow.shader deleted file mode 100644 index 775b7d2..0000000 --- a/Assets/Shaders/2D/Effects/Glow.shader +++ /dev/null @@ -1,117 +0,0 @@ -Shader "Custom/Glow" { - - - - Properties { - - - - _Color ("Color", Color) = (1,1,1,1) - - - - } - - - - SubShader { - - - - Tags { "RenderType"="Transparent" } - - - - LOD 200 - - - - ZTest Always - - - - Cull Off - - - - - - - - - - - - CGPROGRAM - - - - #pragma surface surf Lambert decal:add - - - - - - - - float4 _Color; - - - - - - - - struct Input { - - - - float3 viewDir; - - - - float3 worldNormal; - - - - }; - - - - - - - - void surf (Input IN, inout SurfaceOutput o) { - - - - o.Alpha = _Color.a * pow(abs(dot(normalize(IN.viewDir), - - - - normalize(IN.worldNormal))),4.0); - - - - o.Emission = _Color.rgb * o.Alpha; - - - - } - - - - ENDCG - - - - } - - - - FallBack "Diffuse" - - - -} diff --git a/Assets/Shaders/2D/Effects/Glow.shader.meta b/Assets/Shaders/2D/Effects/Glow.shader.meta deleted file mode 100644 index 6f04600..0000000 --- a/Assets/Shaders/2D/Effects/Glow.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: feb86f7525c215b4c803d7ce16a4aedc -timeCreated: 1500793480 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/2D/Effects/Highlight.shader b/Assets/Shaders/2D/Effects/Highlight.shader deleted file mode 100644 index cbc20a7..0000000 --- a/Assets/Shaders/2D/Effects/Highlight.shader +++ /dev/null @@ -1,13 +0,0 @@ -Shader "Custom/Highlight" { -Properties { - _Color ("Main Color", Color) = (1,1,1,1) -} -SubShader { - Pass { - ZWrite Off - Offset -1, -1 - Blend SrcAlpha OneMinusSrcAlpha - Color [_Color] - } -} -} diff --git a/Assets/Shaders/2D/Effects/Highlight.shader.meta b/Assets/Shaders/2D/Effects/Highlight.shader.meta deleted file mode 100644 index 07b07e9..0000000 --- a/Assets/Shaders/2D/Effects/Highlight.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 23fc256da1af2dd44bb8cf5fe363aed3 -timeCreated: 1500793448 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/2D/Effects/ToonIce.shader b/Assets/Shaders/2D/Effects/ToonIce.shader deleted file mode 100644 index 2345639..0000000 --- a/Assets/Shaders/2D/Effects/ToonIce.shader +++ /dev/null @@ -1,63 +0,0 @@ -Shader "Toon/Ice" { - Properties { - _Color ("Main Color", Color) = (0.5,0.5,0.5,1) - _Ramp ("Toon Ramp (RGB)", 2D) = "gray" {} - _BottomColor("Bottom Color", Color) = (0.23,0,0.95,1) - _RimBrightness("Rim Brightness", Range(3,4)) = 3.5 - _Alpha("Transparency", Range(0,1)) = 0.5 - } - - SubShader { - - Tags{ "Queue" = "Transparent" "RenderType" = "Transparent" } - LOD 200 - Blend SrcAlpha OneMinusSrcAlpha -CGPROGRAM -//#pragma surface surf ToonRamp -#pragma surface surf Lambert alpha - -sampler2D _Ramp; - -// custom lighting function that uses a texture ramp based -// on angle between light direction and normal -#pragma lighting ToonRamp exclude_path:prepass -inline half4 LightingToonRamp (SurfaceOutput s, half3 lightDir, half atten) -{ - #ifndef USING_DIRECTIONAL_LIGHT - lightDir = normalize(lightDir); - #endif - - half d = dot (s.Normal, lightDir)*0.5 + 0.5; - half3 ramp = tex2D (_Ramp, float2(d,d)).rgb; - - half4 c; - c.rgb = s.Albedo * _LightColor0.rgb * ramp * (atten * 2); - c.a = 0; - return c; -} - - -float4 _Color; -float4 _BottomColor; -float _RimBrightness; -float _Alpha; -struct Input { - float3 worldPos; - float3 viewDir; -}; - -void surf (Input IN, inout SurfaceOutput o) { - float3 localPos = saturate(IN.worldPos - mul(unity_ObjectToWorld, float4(0, 0, 0, 1)).xyz); - float softRim = 1.0 - saturate(dot(normalize(IN.viewDir), o.Normal)); - float hardRim = round(softRim); - o.Emission = _Color* lerp(hardRim, softRim, localPos.y) * (_RimBrightness*localPos.y); - float InnerRim = 1.5 + saturate(dot(normalize(IN.viewDir), o.Normal)); - o.Albedo = _Color*pow(InnerRim, 0.7) * lerp(_BottomColor, _Color, localPos.y); - o.Alpha = _Alpha; -} -ENDCG - - } - - Fallback "Diffuse" -} diff --git a/Assets/Shaders/2D/Effects/ToonIce.shader.meta b/Assets/Shaders/2D/Effects/ToonIce.shader.meta deleted file mode 100644 index d4366bf..0000000 --- a/Assets/Shaders/2D/Effects/ToonIce.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: af52aa2c61ae85c47a09120b25d5f0eb -timeCreated: 1500793463 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/2D/Effects/WireFrame.shader b/Assets/Shaders/2D/Effects/WireFrame.shader deleted file mode 100644 index 1bc55df..0000000 --- a/Assets/Shaders/2D/Effects/WireFrame.shader +++ /dev/null @@ -1,124 +0,0 @@ -// modified version of "VR/SpatialMapping/Wireframe.shader" from Unity 5.5f2 -// added colors, discard option, removed stereo support and color by distance - -Shader "UnityLibrary/Effects/Wireframe" -{ - Properties - { - _LineColor ("LineColor", Color) = (1,1,1,1) - _FillColor ("FillColor", Color) = (0,0,0,0) - _WireThickness ("Wire Thickness", RANGE(0, 800)) = 100 - [MaterialToggle] UseDiscard("Discard Fill", Float) = 1 - } - - SubShader - { - Tags { "RenderType"="Opaque" } - - - Pass - { - // Wireframe shader based on the the following - // http://developer.download.nvidia.com/SDK/10/direct3d/Source/SolidWireframe/Doc/SolidWireframe.pdf - - CGPROGRAM - #pragma vertex vert - #pragma geometry geom - #pragma fragment frag - #pragma multi_compile _ USEDISCARD_ON - #include "UnityCG.cginc" - - float _WireThickness; - - struct appdata - { - float4 vertex : POSITION; - }; - - struct v2g - { - float4 projectionSpaceVertex : SV_POSITION; - float4 worldSpacePosition : TEXCOORD1; - }; - - struct g2f - { - float4 projectionSpaceVertex : SV_POSITION; - float4 worldSpacePosition : TEXCOORD0; - float4 dist : TEXCOORD1; - }; - - - v2g vert (appdata v) - { - v2g o; -// UNITY_SETUP_INSTANCE_ID(v); -// UNITY_INITIALIZE_OUTPUT(v2g, o); - o.projectionSpaceVertex = UnityObjectToClipPos(v.vertex); - o.worldSpacePosition = mul(unity_ObjectToWorld, v.vertex); - return o; - } - - [maxvertexcount(3)] - void geom(triangle v2g i[3], inout TriangleStream triangleStream) - { - float2 p0 = i[0].projectionSpaceVertex.xy / i[0].projectionSpaceVertex.w; - float2 p1 = i[1].projectionSpaceVertex.xy / i[1].projectionSpaceVertex.w; - float2 p2 = i[2].projectionSpaceVertex.xy / i[2].projectionSpaceVertex.w; - - float2 edge0 = p2 - p1; - float2 edge1 = p2 - p0; - float2 edge2 = p1 - p0; - - // To find the distance to the opposite edge, we take the - // formula for finding the area of a triangle Area = Base/2 * Height, - // and solve for the Height = (Area * 2)/Base. - // We can get the area of a triangle by taking its cross product - // divided by 2. However we can avoid dividing our area/base by 2 - // since our cross product will already be double our area. - float area = abs(edge1.x * edge2.y - edge1.y * edge2.x); - float wireThickness = 800 - _WireThickness; - - g2f o; - o.worldSpacePosition = i[0].worldSpacePosition; - o.projectionSpaceVertex = i[0].projectionSpaceVertex; - o.dist.xyz = float3( (area / length(edge0)), 0.0, 0.0) * o.projectionSpaceVertex.w * wireThickness; - o.dist.w = 1.0 / o.projectionSpaceVertex.w; - triangleStream.Append(o); - - o.worldSpacePosition = i[1].worldSpacePosition; - o.projectionSpaceVertex = i[1].projectionSpaceVertex; - o.dist.xyz = float3(0.0, (area / length(edge1)), 0.0) * o.projectionSpaceVertex.w * wireThickness; - o.dist.w = 1.0 / o.projectionSpaceVertex.w; - triangleStream.Append(o); - - o.worldSpacePosition = i[2].worldSpacePosition; - o.projectionSpaceVertex = i[2].projectionSpaceVertex; - o.dist.xyz = float3(0.0, 0.0, (area / length(edge2))) * o.projectionSpaceVertex.w * wireThickness; - o.dist.w = 1.0 / o.projectionSpaceVertex.w; - triangleStream.Append(o); - } - - uniform fixed4 _LineColor; - uniform fixed4 _FillColor; - - fixed4 frag (g2f i) : SV_Target - { - float minDistanceToEdge = min(i.dist[0], min(i.dist[1], i.dist[2])) * i.dist[3]; - - // Early out if we know we are not on a line segment. - if(minDistanceToEdge > 0.9) - { - #ifdef USEDISCARD_ON - discard; - #else - return _FillColor; - #endif - } - - return _LineColor; - } - ENDCG - } - } -} diff --git a/Assets/Shaders/2D/Effects/WireFrame.shader.meta b/Assets/Shaders/2D/Effects/WireFrame.shader.meta deleted file mode 100644 index 91d5739..0000000 --- a/Assets/Shaders/2D/Effects/WireFrame.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 31fc58e629e444741ba82377c6234196 -timeCreated: 1500793449 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/2D/LineRenderer.meta b/Assets/Shaders/2D/LineRenderer.meta deleted file mode 100644 index 7b5f36f..0000000 --- a/Assets/Shaders/2D/LineRenderer.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: e87bf823cfbab8445867a12addd65cd7 -folderAsset: yes -timeCreated: 1511611014 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/2D/LineRenderer/Additive-ScrollingUV.shader b/Assets/Shaders/2D/LineRenderer/Additive-ScrollingUV.shader deleted file mode 100644 index d64a66b..0000000 --- a/Assets/Shaders/2D/LineRenderer/Additive-ScrollingUV.shader +++ /dev/null @@ -1,89 +0,0 @@ -// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license - -Shader "UnityLibrary/Particles/Additive Scrolling UV" { -Properties { - _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5) - _MainTex ("Particle Texture", 2D) = "white" {} - _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0 - _ScrollingSpeed("Scrolling Speed",float) = 2 -} - -Category { - Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" } - Blend SrcAlpha One - ColorMask RGB - Cull Off Lighting Off ZWrite Off - - SubShader { - Pass { - - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - #pragma target 2.0 - #pragma multi_compile_particles - #pragma multi_compile_fog - - #include "UnityCG.cginc" - - sampler2D _MainTex; - fixed4 _TintColor; - float _ScrollingSpeed; - - struct appdata_t { - float4 vertex : POSITION; - fixed4 color : COLOR; - float2 texcoord : TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct v2f { - float4 vertex : SV_POSITION; - fixed4 color : COLOR; - float2 texcoord : TEXCOORD0; - UNITY_FOG_COORDS(1) - #ifdef SOFTPARTICLES_ON - float4 projPos : TEXCOORD2; - #endif - UNITY_VERTEX_OUTPUT_STEREO - }; - - float4 _MainTex_ST; - - v2f vert (appdata_t v) - { - v2f o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - o.vertex = UnityObjectToClipPos(v.vertex); - #ifdef SOFTPARTICLES_ON - o.projPos = ComputeScreenPos (o.vertex); - COMPUTE_EYEDEPTH(o.projPos.z); - #endif - o.color = v.color; - o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); - UNITY_TRANSFER_FOG(o,o.vertex); - return o; - } - - UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); - float _InvFade; - - fixed4 frag (v2f i) : SV_Target - { - #ifdef SOFTPARTICLES_ON - float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos))); - float partZ = i.projPos.z; - float fade = saturate (_InvFade * (sceneZ-partZ)); - i.color.a *= fade; - #endif - - fixed4 col = 2.0f * i.color * _TintColor * tex2D(_MainTex, float2(i.texcoord.x+_Time.x*_ScrollingSpeed,i.texcoord.y)); - UNITY_APPLY_FOG_COLOR(i.fogCoord, col, fixed4(0,0,0,0)); // fog towards black due to our blend mode - return col; - } - ENDCG - } - } -} -} diff --git a/Assets/Shaders/2D/LineRenderer/Additive-ScrollingUV.shader.meta b/Assets/Shaders/2D/LineRenderer/Additive-ScrollingUV.shader.meta deleted file mode 100644 index 30e7147..0000000 --- a/Assets/Shaders/2D/LineRenderer/Additive-ScrollingUV.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 15701903e7dd975478b34a9e5bd4979b -timeCreated: 1511611033 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/2D/Sprites.meta b/Assets/Shaders/2D/Sprites.meta deleted file mode 100644 index a4ad01c..0000000 --- a/Assets/Shaders/2D/Sprites.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: d514920e40d9a2c4bb098b6dd37c765b -folderAsset: yes -timeCreated: 1500793395 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/2D/Sprites/Chromakey.shader b/Assets/Shaders/2D/Sprites/Chromakey.shader deleted file mode 100644 index f986582..0000000 --- a/Assets/Shaders/2D/Sprites/Chromakey.shader +++ /dev/null @@ -1,75 +0,0 @@ -Shader "UnityCommunity/ChromakeyTransparent" { -Properties -{ -_MainTex ("Base (RGB)", 2D) = "white" {} -_MaskCol ("Mask Color", Color) = (1.0, 0.0, 0.0, 1.0) -_Sensitivity ("Threshold Sensitivity", Range(0,1)) = 0.5 -_Smooth ("Smoothing", Range(0,1)) = 0.5 -} - -SubShader -{ -Tags {"Queue"="Transparent" "IgnoreProjector"="true" "RenderType"="Transparent"} - Blend SrcAlpha OneMinusSrcAlpha Cull Off - -Pass -{ - -CGPROGRAM -#pragma vertex vert -#pragma fragment frag -#pragma fragmentoption ARB_precision_hint_fastest -#include "UnityCG.cginc" - -struct appdata_t -{ -float4 vertex : POSITION; -float2 texcoord : TEXCOORD0; -}; - -struct v2f -{ -half2 texcoord : TEXCOORD0; -float4 vertex : SV_POSITION; -}; - -sampler2D _MainTex; -fixed4 _Color; -float _Speed; - -float4 _MaskCol; -float _Sensitivity; -float _Smooth; - - -v2f vert(appdata_t IN) -{ -v2f OUT; -OUT.vertex = UnityObjectToClipPos(IN.vertex); -OUT.texcoord = IN.texcoord; -return OUT; -} - -float4 frag (v2f i) : COLOR -{ - -float2 uv = i.texcoord.xy; -float4 c = tex2D(_MainTex, uv); - -float maskY = 0.2989 * _MaskCol.r + 0.5866 * _MaskCol.g + 0.1145 * _MaskCol.b; -float maskCr = 0.7132 * (_MaskCol.r - maskY); -float maskCb = 0.5647 * (_MaskCol.b - maskY); - -float Y = 0.2989 * c.r + 0.5866 * c.g + 0.1145 * c.b; -float Cr = 0.7132 * (c.r - Y); -float Cb = 0.5647 * (c.b - Y); - -float blendValue = smoothstep(_Sensitivity, _Sensitivity + _Smooth, distance(float2(Cr, Cb), float2(maskCr, maskCb))); - -return float4(c.rgb,c.a*blendValue); -} -ENDCG -} -} -Fallback "Sprites/Default" -} \ No newline at end of file diff --git a/Assets/Shaders/2D/Sprites/Chromakey.shader.meta b/Assets/Shaders/2D/Sprites/Chromakey.shader.meta deleted file mode 100644 index 8ad6280..0000000 --- a/Assets/Shaders/2D/Sprites/Chromakey.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: d519a4751a0aff74593843250496c08e -timeCreated: 1512025674 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/2D/Sprites/FlipBook.shader b/Assets/Shaders/2D/Sprites/FlipBook.shader deleted file mode 100644 index 90027e0..0000000 --- a/Assets/Shaders/2D/Sprites/FlipBook.shader +++ /dev/null @@ -1,94 +0,0 @@ -// https://unitycoder.com/blog/2018/11/30/sprite-sheet-flip-book-shader/ - -Shader "UnityLibrary/Sprites/FlipBook (Cutout)" -{ - Properties - { - [Header(Texture Sheet)] - _MainTex("Texture", 2D) = "white" {} - _Cutoff("Alpha Cutoff", Range(0,1)) = 0.15 - [Header(Settings)] - _ColumnsX("Columns (X)", int) = 1 - _RowsY("Rows (Y)", int) = 1 - _AnimationSpeed("Frames Per Seconds", float) = 10 - } - SubShader - { - Tags { - "Queue" = "AlphaTest" - "IgnoreProjector" = "True" - "PreviewType" = "Plane" - "RenderType" = "TransparentCutout" - "DisableBatching" = "True" - } - - LOD 100 - - Pass - { - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - #include "UnityCG.cginc" - - struct appdata - { - float4 vertex : POSITION; - float2 uv : TEXCOORD0; - }; - - struct v2f - { - float2 uv : TEXCOORD0; - float4 vertex : SV_POSITION; - }; - - float _Cutoff; - sampler2D _MainTex; - float4 _MainTex_ST; - uint _ColumnsX; - uint _RowsY; - float _AnimationSpeed; - - v2f vert(appdata v) - { - v2f o; - o.vertex = UnityObjectToClipPos(v.vertex); - - // get single sprite size - float2 size = float2(1.0f / _ColumnsX, 1.0f / _RowsY); - uint totalFrames = _ColumnsX * _RowsY; - - // use timer to increment index - uint index = _Time.y*_AnimationSpeed; - - // wrap x and y indexes - uint indexX = index % _ColumnsX; - uint indexY = floor((index % totalFrames) / _ColumnsX); - - // get offsets to our sprite index - float2 offset = float2(size.x*indexX,-size.y*indexY); - - // get single sprite UV - float2 newUV = v.uv*size; - - // flip Y (to start 0 from top) - newUV.y = newUV.y + size.y*(_RowsY - 1); - - o.uv = newUV + offset; - return o; - } - - fixed4 frag(v2f i) : SV_Target - { - fixed4 col = tex2D(_MainTex, i.uv); - - // cutout - clip(col.a - _Cutoff); - - return col; - } - ENDCG - } - } -} diff --git a/Assets/Shaders/2D/Sprites/HSBC.shader b/Assets/Shaders/2D/Sprites/HSBC.shader deleted file mode 100644 index 7ecf0b9..0000000 --- a/Assets/Shaders/2D/Sprites/HSBC.shader +++ /dev/null @@ -1,90 +0,0 @@ -// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' - -Shader "Unlit/HSBC Effect" -{ - Properties - { - _MainTex ("Texture", 2D) = "white" {} - _Hue ("Hue", Range(0, 1.0)) = 0 - _Saturation ("Saturation", Range(0, 1.0)) = 0.5 - _Brightness ("Brightness", Range(0, 1.0)) = 0.5 - _Contrast ("Contrast", Range(0, 1.0)) = 0.5 - } - SubShader - { - Tags {"Queue"="Transparent" "IgnoreProjector"="true" "RenderType"="Transparent"} - Blend SrcAlpha OneMinusSrcAlpha Cull Off - Pass - { - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - - #include "UnityCG.cginc" - - - inline float3 applyHue(float3 aColor, float aHue) - { - float angle = radians(aHue); - float3 k = float3(0.57735, 0.57735, 0.57735); - float cosAngle = cos(angle); - - return aColor * cosAngle + cross(k, aColor) * sin(angle) + k * dot(k, aColor) * (1 - cosAngle); - } - - inline float4 applyHSBCEffect(float4 startColor, fixed4 hsbc) - { - float hue = 360 * hsbc.r; - float saturation = hsbc.g * 2; - float brightness = hsbc.b * 2 - 1; - float contrast = hsbc.a * 2; - - float4 outputColor = startColor; - outputColor.rgb = applyHue(outputColor.rgb, hue); - outputColor.rgb = (outputColor.rgb - 0.5f) * contrast + 0.5f; - outputColor.rgb = outputColor.rgb + brightness; - float3 intensity = dot(outputColor.rgb, float3(0.39, 0.59, 0.11)); - outputColor.rgb = lerp(intensity, outputColor.rgb, saturation); - - return outputColor; - } - - struct appdata - { - float4 vertex : POSITION; - float2 uv : TEXCOORD0; - fixed4 color : COLOR; - }; - - struct v2f - { - float4 vertex : SV_POSITION; - float2 uv : TEXCOORD0; - fixed4 hsbc : COLOR; - }; - - sampler2D _MainTex; - float4 _MainTex_ST; - fixed _Hue, _Saturation, _Brightness, _Contrast; - - v2f vert (appdata v) - { - v2f o; - o.vertex = UnityObjectToClipPos(v.vertex); - o.uv = TRANSFORM_TEX(v.uv, _MainTex); - o.hsbc = fixed4(_Hue, _Saturation, _Brightness, _Contrast); - - return o; - } - - fixed4 frag (v2f i) : COLOR - { - fixed4 startColor = tex2D(_MainTex, i.uv); - float4 hsbcColor = applyHSBCEffect(startColor, i.hsbc); - - return hsbcColor*startColor.a; - } - ENDCG - } - } -} \ No newline at end of file diff --git a/Assets/Shaders/2D/Sprites/HSBC.shader.meta b/Assets/Shaders/2D/Sprites/HSBC.shader.meta deleted file mode 100644 index 76b8057..0000000 --- a/Assets/Shaders/2D/Sprites/HSBC.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 1c3c166a85bfe60428455775befe0f3b -timeCreated: 1512025650 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/2D/Sprites/Outline2D.shader b/Assets/Shaders/2D/Sprites/Outline2D.shader deleted file mode 100644 index d449661..0000000 --- a/Assets/Shaders/2D/Sprites/Outline2D.shader +++ /dev/null @@ -1,77 +0,0 @@ - -Shader "UnityCommunity/Sprites/Outline" -{ -Properties -{ -_MainTex ("Base (RGB)", 2D) = "white" {} -_OutLineSpread ("Outline Spread", Range(0,0.01)) = 0.007 -_Color ("Tint", Color) = (1,1,1,1) -_ColorX ("Tint", Color) = (1,1,1,1) -_Alpha ("Alpha", Range (0,1)) = 1.0 -} - -SubShader -{ -Tags {"Queue"="Transparent" "IgnoreProjector"="true" "RenderType"="Transparent"} -ZWrite Off Blend SrcAlpha OneMinusSrcAlpha Cull Off - -Pass -{ - -CGPROGRAM -#pragma vertex vert -#pragma fragment frag -#pragma fragmentoption ARB_precision_hint_fastest -#include "UnityCG.cginc" - -struct appdata_t -{ -float4 vertex : POSITION; -float4 color : COLOR; -float2 texcoord : TEXCOORD0; -}; - -struct v2f -{ -half2 texcoord : TEXCOORD0; -float4 vertex : SV_POSITION; -fixed4 color : COLOR; -}; - -sampler2D _MainTex; -float _OutLineSpread; -fixed4 _Color; -fixed4 _ColorX; - -v2f vert(appdata_t IN) -{ -v2f OUT; -OUT.vertex = UnityObjectToClipPos(IN.vertex); -OUT.texcoord = IN.texcoord; -OUT.color = IN.color; -return OUT; -} - -float4 frag (v2f i) : COLOR -{ - -fixed4 mainColor = (tex2D(_MainTex, i.texcoord+float2(-_OutLineSpread,_OutLineSpread)) -+ tex2D(_MainTex, i.texcoord+float2(_OutLineSpread,-_OutLineSpread)) -+ tex2D(_MainTex, i.texcoord+float2(_OutLineSpread,_OutLineSpread)) -+ tex2D(_MainTex, i.texcoord-float2(_OutLineSpread,_OutLineSpread))); - -mainColor.rgb = _ColorX.rgb; - -fixed4 addcolor = tex2D(_MainTex, i.texcoord)*i.color; - -if (mainColor.a > 0.40) { mainColor = _ColorX; } -if (addcolor.a > 0.40) { mainColor = addcolor; mainColor.a = addcolor.a; } - -return mainColor*i.color.a; -} -ENDCG -} -} -Fallback "Sprites/Default" - -} diff --git a/Assets/Shaders/2D/Sprites/Outline2D.shader.meta b/Assets/Shaders/2D/Sprites/Outline2D.shader.meta deleted file mode 100644 index 00d6173..0000000 --- a/Assets/Shaders/2D/Sprites/Outline2D.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 88e77b0dcd3a1a247b7ad32561fefcd8 -timeCreated: 1511613854 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/2D/Sprites/Photoshop Blends.meta b/Assets/Shaders/2D/Sprites/Photoshop Blends.meta deleted file mode 100644 index 912fada..0000000 --- a/Assets/Shaders/2D/Sprites/Photoshop Blends.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 37f060ed25d19ec49801a3bbf06bdea1 -folderAsset: yes -timeCreated: 1512025751 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/2D/Sprites/Photoshop Blends/Photoshop_Blends.cs b/Assets/Shaders/2D/Sprites/Photoshop Blends/Photoshop_Blends.cs deleted file mode 100644 index 85bb43c..0000000 --- a/Assets/Shaders/2D/Sprites/Photoshop Blends/Photoshop_Blends.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -[ExecuteInEditMode] -public class Photoshop_Blends : MonoBehaviour { - public enum BlendModes{darken,multiply,colorBurn,linearBurn,darkerColor,lighten,screen,colorDodge,linearDodge,lighterColor,overlay,softLight,hardLight,vividLight,linearLight,pinLight,hardlerp,difference,exclusion,subtract,divide,hue,color,saturation,luminosity} - public BlendModes blendmodes; - private Material Mat; - - void Awake () { - Material material = new Material (Shader.Find("UnityCommunity/Sprites/PhotoshopBlends")); - GetComponent ().sharedMaterial = material; - } - - void Update () { - - GetComponent ().sharedMaterial.SetInt ("number", blendmodes.GetHashCode ()); - } -} diff --git a/Assets/Shaders/2D/Sprites/Photoshop Blends/Photoshop_Blends.cs.meta b/Assets/Shaders/2D/Sprites/Photoshop Blends/Photoshop_Blends.cs.meta deleted file mode 100644 index 36b62d4..0000000 --- a/Assets/Shaders/2D/Sprites/Photoshop Blends/Photoshop_Blends.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: ead4927f89bb6d243a3d67b0fbfef19d -timeCreated: 1512025691 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/2D/Sprites/Photoshop Blends/photoshop_blends.shader b/Assets/Shaders/2D/Sprites/Photoshop Blends/photoshop_blends.shader deleted file mode 100644 index e265405..0000000 --- a/Assets/Shaders/2D/Sprites/Photoshop Blends/photoshop_blends.shader +++ /dev/null @@ -1,285 +0,0 @@ -//useful links: -//https://www.shadertoy.com/view/XdS3RW -//see also: https://docs.gimp.org/en/gimp-concepts-layer-modes.html - -Shader "UnityCommunity/Sprites/PhotoshopBlends" -{ - Properties - { - _source ("Upper Layer", 2D) = "white" {} - _destination ("Lower Layer", 2D) = "white" {} - number("Mode 0-24", Int) = 0 - } - - Subshader - { - Pass - { - CGPROGRAM - #pragma vertex vertex_shader - #pragma fragment pixel_shader - #pragma target 3.0 - - struct custom_type - { - float4 vertex : SV_POSITION; - float2 uv : TEXCOORD0; - }; - - sampler2D _destination,_source; - int number; - - float3 darken( float3 s, float3 d ) - { - return min(s,d); - } - - float3 multiply( float3 s, float3 d ) - { - return s*d; - } - - float3 colorBurn( float3 s, float3 d ) - { - return 1.0 - (1.0 - d) / s; - } - - float3 linearBurn( float3 s, float3 d ) - { - return s + d - 1.0; - } - - float3 darkerColor( float3 s, float3 d ) - { - return (s.x + s.y + s.z < d.x + d.y + d.z) ? s : d; - } - - float3 lighten( float3 s, float3 d ) - { - return max(s,d); - } - - float3 screen( float3 s, float3 d ) - { - return s + d - s * d; - } - - float3 colorDodge( float3 s, float3 d ) - { - return d / (1.0 - s); - } - - float3 linearDodge( float3 s, float3 d ) - { - return s + d; - } - - float3 lighterColor( float3 s, float3 d ) - { - return (s.x + s.y + s.z > d.x + d.y + d.z) ? s : d; - } - - float overlay( float s, float d ) - { - return (d < 0.5) ? 2.0 * s * d : 1.0 - 2.0 * (1.0 - s) * (1.0 - d); - } - - float3 overlay( float3 s, float3 d ) - { - float3 c; - c.x = overlay(s.x,d.x); - c.y = overlay(s.y,d.y); - c.z = overlay(s.z,d.z); - return c; - } - - float softLight( float s, float d ) - { - return (s < 0.5) ? d - (1.0 - 2.0 * s) * d * (1.0 - d) - : (d < 0.25) ? d + (2.0 * s - 1.0) * d * ((16.0 * d - 12.0) * d + 3.0) - : d + (2.0 * s - 1.0) * (sqrt(d) - d); - } - - float3 softLight( float3 s, float3 d ) - { - float3 c; - c.x = softLight(s.x,d.x); - c.y = softLight(s.y,d.y); - c.z = softLight(s.z,d.z); - return c; - } - - float hardLight( float s, float d ) - { - return (s < 0.5) ? 2.0 * s * d : 1.0 - 2.0 * (1.0 - s) * (1.0 - d); - } - - float3 hardLight( float3 s, float3 d ) - { - float3 c; - c.x = hardLight(s.x,d.x); - c.y = hardLight(s.y,d.y); - c.z = hardLight(s.z,d.z); - return c; - } - - float vividLight( float s, float d ) - { - return (s < 0.5) ? 1.0 - (1.0 - d) / (2.0 * s) : d / (2.0 * (1.0 - s)); - } - - float3 vividLight( float3 s, float3 d ) - { - float3 c; - c.x = vividLight(s.x,d.x); - c.y = vividLight(s.y,d.y); - c.z = vividLight(s.z,d.z); - return c; - } - - float3 linearLight( float3 s, float3 d ) - { - return 2.0 * s + d - 1.0; - } - - float pinLight( float s, float d ) - { - return (2.0 * s - 1.0 > d) ? 2.0 * s - 1.0 : (s < 0.5 * d) ? 2.0 * s : d; - } - - float3 pinLight( float3 s, float3 d ) - { - float3 c; - c.x = pinLight(s.x,d.x); - c.y = pinLight(s.y,d.y); - c.z = pinLight(s.z,d.z); - return c; - } - - float3 hardlerp( float3 s, float3 d ) - { - return floor(s + d); - } - - float3 difference( float3 s, float3 d ) - { - return abs(d - s); - } - - float3 exclusion( float3 s, float3 d ) - { - return s + d - 2.0 * s * d; - } - - float3 subtract( float3 s, float3 d ) - { - return s - d; - } - - float3 divide( float3 s, float3 d ) - { - return s / d; - } - - float3 rgb2hsv(float3 c) - { - float4 K = float4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); - float4 p = lerp(float4(c.bg, K.wz), float4(c.gb, K.xy), step(c.b, c.g)); - float4 q = lerp(float4(p.xyw, c.r), float4(c.r, p.yzx), step(p.x, c.r)); - float d = q.x - min(q.w, q.y); - float e = 1.0e-10; - return float3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); - } - - float3 hsv2rgb(float3 c) - { - float4 K = float4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); - float3 p = abs(frac(c.xxx + K.xyz) * 6.0 - K.www); - return c.z * lerp(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); - } - - float3 hue( float3 s, float3 d ) - { - d = rgb2hsv(d); - d.x = rgb2hsv(s).x; - return hsv2rgb(d); - } - - float3 color( float3 s, float3 d ) - { - s = rgb2hsv(s); - s.z = rgb2hsv(d).z; - return hsv2rgb(s); - } - - float3 saturation( float3 s, float3 d ) - { - d = rgb2hsv(d); - d.y = rgb2hsv(s).y; - return hsv2rgb(d); - } - - float3 luminosity( float3 s, float3 d ) - { - float dLum = dot(d, float3(0.3, 0.59, 0.11)); - float sLum = dot(s, float3(0.3, 0.59, 0.11)); - float lum = sLum - dLum; - float3 c = d + lum; - float minC = min(min(c.x, c.y), c.z); - float maxC = max(max(c.x, c.y), c.z); - if(minC < 0.0) return sLum + ((c - sLum) * sLum) / (sLum - minC); - else if(maxC > 1.0) return sLum + ((c - sLum) * (1.0 - sLum)) / (maxC - sLum); - else return c; - } - - float3 blend( float3 s, float3 d, int id ) - { - if(id==0) return darken(s,d); - if(id==1) return multiply(s,d); - if(id==2) return colorBurn(s,d); - if(id==3) return linearBurn(s,d); - if(id==4) return darkerColor(s,d); - if(id==5) return lighten(s,d); - if(id==6) return screen(s,d); - if(id==7) return colorDodge(s,d); - if(id==8) return linearDodge(s,d); - if(id==9) return lighterColor(s,d); - if(id==10) return overlay(s,d); - if(id==11) return softLight(s,d); - if(id==12) return hardLight(s,d); - if(id==13) return vividLight(s,d); - if(id==14) return linearLight(s,d); - if(id==15) return pinLight(s,d); - if(id==16) return hardlerp(s,d); - if(id==17) return difference(s,d); - if(id==18) return exclusion(s,d); - if(id==19) return subtract(s,d); - if(id==20) return divide(s,d); - if(id==21) return hue(s,d); - if(id==22) return color(s,d); - if(id==23) return saturation(s,d); - if(id==24) return luminosity(s,d); - return float3(0,0,0); - } - - custom_type vertex_shader (float4 vertex:POSITION, float2 uv:TEXCOORD0) - { - custom_type vs; - vs.vertex = UnityObjectToClipPos(vertex); - vs.uv = uv; - return vs; - } - - float4 pixel_shader (custom_type ps) : SV_TARGET - { - float2 uv = ps.uv.xy; - int id =number; - float3 s = tex2D(_source, uv).xyz; - float3 d = tex2D(_destination, uv).xyz; - float3 c = blend(s,d,id); - return float4(c,1.0); - } - ENDCG - } - } -} \ No newline at end of file diff --git a/Assets/Shaders/2D/Sprites/Photoshop Blends/photoshop_blends.shader.meta b/Assets/Shaders/2D/Sprites/Photoshop Blends/photoshop_blends.shader.meta deleted file mode 100644 index 9359641..0000000 --- a/Assets/Shaders/2D/Sprites/Photoshop Blends/photoshop_blends.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 773b7ccd460934140a59c74848880b4d -timeCreated: 1512025692 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/2D/Sprites/Pixelation.shader b/Assets/Shaders/2D/Sprites/Pixelation.shader deleted file mode 100644 index 7c77ae7..0000000 --- a/Assets/Shaders/2D/Sprites/Pixelation.shader +++ /dev/null @@ -1,44 +0,0 @@ -Shader "UnityCommunity/Sprites/Pixelation" -{ - Properties - { - _MainTex ("Texture", 2D) = "white" {} - size ("Pixel size",Range(1.0,1000.0)) = 100.0 - } - Subshader - { - Tags {"Queue"="Transparent" "IgnoreProjector"="true" "RenderType"="Transparent"} - ZWrite Off Blend SrcAlpha OneMinusSrcAlpha Cull Off - - Pass - { - CGPROGRAM - #pragma vertex vertex_shader - #pragma fragment pixel_shader - #pragma target 2.0 - - sampler2D _MainTex; - float size; - - struct custom_type - { - float4 vertex : SV_POSITION; - float2 uv : TEXCOORD0; - }; - - custom_type vertex_shader (float4 vertex:POSITION, float2 uv:TEXCOORD0) - { - custom_type vs; - vs.vertex = UnityObjectToClipPos (vertex); - vs.uv = uv; - return vs; - } - - float4 pixel_shader (custom_type ps) : COLOR - { - return tex2D(_MainTex,ceil(ps.uv.xy*size)/size); - } - ENDCG - } - } -} \ No newline at end of file diff --git a/Assets/Shaders/2D/Sprites/Pixelation.shader.meta b/Assets/Shaders/2D/Sprites/Pixelation.shader.meta deleted file mode 100644 index 7a751bc..0000000 --- a/Assets/Shaders/2D/Sprites/Pixelation.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 329439a225731b7449c7ac9a8cedb612 -timeCreated: 1512026085 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/2D/Sprites/SpriteDropShadow.shader b/Assets/Shaders/2D/Sprites/SpriteDropShadow.shader deleted file mode 100644 index a1287e0..0000000 --- a/Assets/Shaders/2D/Sprites/SpriteDropShadow.shader +++ /dev/null @@ -1,157 +0,0 @@ -Shader "UnityCommunity/Sprites/SpriteDropShadow" -{ - Properties - { - [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} - _Color ("Tint", Color) = (1,1,1,1) - [MaterialToggle] PixelSnap ("Pixel snap", Float) = 0 - _ShadowColor ("Shadow", Color) = (0,0,0,1) - _ShadowOffset ("ShadowOffset", Vector) = (0,-0.1,0,0) - } - - SubShader - { - Tags - { - "Queue"="Transparent" - "IgnoreProjector"="True" - "RenderType"="Transparent" - "PreviewType"="Plane" - "CanUseSpriteAtlas"="True" - } - - Cull Off - Lighting Off - ZWrite Off - Blend One OneMinusSrcAlpha - - // draw shadow - Pass - { - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - #pragma multi_compile _ PIXELSNAP_ON - #include "UnityCG.cginc" - - struct appdata_t - { - float4 vertex : POSITION; - float4 color : COLOR; - float2 texcoord : TEXCOORD0; - }; - - struct v2f - { - float4 vertex : SV_POSITION; - fixed4 color : COLOR; - float2 texcoord : TEXCOORD0; - }; - - fixed4 _Color; - fixed4 _ShadowColor; - float4 _ShadowOffset; - - v2f vert(appdata_t IN) - { - v2f OUT; - OUT.vertex = UnityObjectToClipPos(IN.vertex+_ShadowOffset); - OUT.texcoord = IN.texcoord; - OUT.color = IN.color *_ShadowColor; - #ifdef PIXELSNAP_ON - OUT.vertex = UnityPixelSnap (OUT.vertex); - #endif - - return OUT; - } - - sampler2D _MainTex; - sampler2D _AlphaTex; - float _AlphaSplitEnabled; - - fixed4 SampleSpriteTexture (float2 uv) - { - fixed4 color = tex2D (_MainTex, uv); - color.rgb = _ShadowColor.rgb; - - #if UNITY_TEXTURE_ALPHASPLIT_ALLOWED - if (_AlphaSplitEnabled) - color.a = tex2D (_AlphaTex, uv).r; - #endif //UNITY_TEXTURE_ALPHASPLIT_ALLOWED - - return color; - } - - fixed4 frag(v2f IN) : SV_Target - { - fixed4 c = SampleSpriteTexture (IN.texcoord) * IN.color; - c.rgb *= c.a; - return c; - } - ENDCG - } - - // draw real sprite - Pass - { - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - #pragma multi_compile _ PIXELSNAP_ON - #include "UnityCG.cginc" - - struct appdata_t - { - float4 vertex : POSITION; - float4 color : COLOR; - float2 texcoord : TEXCOORD0; - }; - - struct v2f - { - float4 vertex : SV_POSITION; - fixed4 color : COLOR; - float2 texcoord : TEXCOORD0; - }; - - fixed4 _Color; - - v2f vert(appdata_t IN) - { - v2f OUT; - OUT.vertex = UnityObjectToClipPos(IN.vertex); - OUT.texcoord = IN.texcoord; - OUT.color = IN.color * _Color; - #ifdef PIXELSNAP_ON - OUT.vertex = UnityPixelSnap (OUT.vertex); - #endif - - return OUT; - } - - sampler2D _MainTex; - sampler2D _AlphaTex; - float _AlphaSplitEnabled; - - fixed4 SampleSpriteTexture (float2 uv) - { - fixed4 color = tex2D (_MainTex, uv); - - #if UNITY_TEXTURE_ALPHASPLIT_ALLOWED - if (_AlphaSplitEnabled) - color.a = tex2D (_AlphaTex, uv).r; - #endif //UNITY_TEXTURE_ALPHASPLIT_ALLOWED - - return color; - } - - fixed4 frag(v2f IN) : SV_Target - { - fixed4 c = SampleSpriteTexture (IN.texcoord) * IN.color; - c.rgb *= c.a; - return c; - } - ENDCG - } - } -} diff --git a/Assets/Shaders/2D/Sprites/SpriteDropShadow.shader.meta b/Assets/Shaders/2D/Sprites/SpriteDropShadow.shader.meta deleted file mode 100644 index f956e11..0000000 --- a/Assets/Shaders/2D/Sprites/SpriteDropShadow.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: f6b01e7d917479745ac109d566b805f4 -timeCreated: 1500793478 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/2D/Sprites/SpriteHDRBloom.shader b/Assets/Shaders/2D/Sprites/SpriteHDRBloom.shader deleted file mode 100644 index b397f54..0000000 --- a/Assets/Shaders/2D/Sprites/SpriteHDRBloom.shader +++ /dev/null @@ -1,102 +0,0 @@ -// Instructions: -// Camera enable [x] HDR -// Add Bloom cinematic image effect to Camera, with Threshold 1.1 (so only values over 1.1 will get bloomy) - -Shader "UnityCommunity/Sprites/HDRBloom" -{ - Properties - { - [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} - _Color ("Tint", Color) = (1,1,1,1) - [MaterialToggle] PixelSnap ("Pixel snap", Float) = 0 - _BloomThreshold ("BloomThreshold", Float) = 2.5 - } - - SubShader - { - Tags - { - "Queue"="Transparent" - "IgnoreProjector"="True" - "RenderType"="Transparent" - "PreviewType"="Plane" - "CanUseSpriteAtlas"="True" - } - - Cull Off - Lighting Off - ZWrite Off - Blend One OneMinusSrcAlpha - - Pass - { - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - #pragma target 2.0 - #pragma multi_compile _ PIXELSNAP_ON - #pragma multi_compile _ ETC1_EXTERNAL_ALPHA - #include "UnityCG.cginc" - - struct appdata_t - { - float4 vertex : POSITION; - float4 color : COLOR; - float2 texcoord : TEXCOORD0; - }; - - struct v2f - { - float4 vertex : SV_POSITION; - fixed4 color : COLOR; - float2 texcoord : TEXCOORD0; - }; - - fixed4 _Color; - fixed _BloomThreshold; - - v2f vert(appdata_t IN) - { - v2f OUT; - OUT.vertex = UnityObjectToClipPos(IN.vertex); - OUT.texcoord = IN.texcoord; - OUT.color = IN.color * _Color; - #ifdef PIXELSNAP_ON - OUT.vertex = UnityPixelSnap (OUT.vertex); - #endif - - return OUT; - } - - sampler2D _MainTex; - sampler2D _AlphaTex; - - // http://theorangeduck.com/page/avoiding-shader-conditionals - fixed when_gt(fixed x, fixed y) { - return max(sign(x - y), 0.0); - } - - fixed4 SampleSpriteTexture (float2 uv) - { - fixed4 color = tex2D (_MainTex, uv); - -#if ETC1_EXTERNAL_ALPHA - // get the color from an external texture (usecase: Alpha support for ETC1 on android) - color.a = tex2D (_AlphaTex, uv).r; -#endif //ETC1_EXTERNAL_ALPHA - - return color; - } - - fixed4 frag(v2f IN) : SV_Target - { - fixed4 tex = SampleSpriteTexture (IN.texcoord); - fixed4 c = tex * IN.color; - c+=1.1*when_gt(tex.r+tex.g+tex.b,_BloomThreshold); // if r+g+b > threshold, then make this color brighter than 1 - c.rgb *= c.a; - return c; - } - ENDCG - } - } -} diff --git a/Assets/Shaders/2D/Sprites/SpriteHDRBloom.shader.meta b/Assets/Shaders/2D/Sprites/SpriteHDRBloom.shader.meta deleted file mode 100644 index da4a5c1..0000000 --- a/Assets/Shaders/2D/Sprites/SpriteHDRBloom.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: b9e666d252d7f5d418f6af0311d5f20c -timeCreated: 1500793465 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/2D/UI.meta b/Assets/Shaders/2D/UI.meta deleted file mode 100644 index 79c075b..0000000 --- a/Assets/Shaders/2D/UI.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 9f1773e3c18b8d44fa76cebdd910da0c -folderAsset: yes -timeCreated: 1500793395 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/2D/UI/UI_Always_On_Top.shader b/Assets/Shaders/2D/UI/UI_Always_On_Top.shader deleted file mode 100644 index 2a547fe..0000000 --- a/Assets/Shaders/2D/UI/UI_Always_On_Top.shader +++ /dev/null @@ -1,95 +0,0 @@ -// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) -// Modified from 5.6.0b3: Removed stencil, Disabled ZTest (to use with WorldSpace UI in VR) - -Shader "UI/AlwaysOnTop" -{ - Properties - { - [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} - _Color ("Tint", Color) = (1,1,1,1) - [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 - } - - SubShader - { - Tags - { - "Queue"="Transparent" - "IgnoreProjector"="True" - "RenderType"="Transparent" - "PreviewType"="Plane" - "CanUseSpriteAtlas"="True" - } - - Cull Off - Lighting Off - ZWrite Off - ZTest Off // was [unity_GUIZTestMode] - Blend SrcAlpha OneMinusSrcAlpha - - Pass - { - Name "Default" - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - #pragma target 2.0 - - #include "UnityCG.cginc" - #include "UnityUI.cginc" - - #pragma multi_compile __ UNITY_UI_ALPHACLIP - - struct appdata_t - { - float4 vertex : POSITION; - float4 color : COLOR; - float2 texcoord : TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct v2f - { - float4 vertex : SV_POSITION; - fixed4 color : COLOR; - float2 texcoord : TEXCOORD0; - float4 worldPosition : TEXCOORD1; - UNITY_VERTEX_OUTPUT_STEREO - }; - - fixed4 _Color; - fixed4 _TextureSampleAdd; - float4 _ClipRect; - - v2f vert(appdata_t IN) - { - v2f OUT; - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); - OUT.worldPosition = IN.vertex; - OUT.vertex = UnityObjectToClipPos(OUT.worldPosition); - - OUT.texcoord = IN.texcoord; - - OUT.color = IN.color * _Color; - return OUT; - } - - sampler2D _MainTex; - - fixed4 frag(v2f IN) : SV_Target - { - half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color; - - color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect); - - #ifdef UNITY_UI_ALPHACLIP - clip (color.a - 0.001); - #endif - - return color; - } - ENDCG - } - } -} diff --git a/Assets/Shaders/2D/UI/UI_Always_On_Top.shader.meta b/Assets/Shaders/2D/UI/UI_Always_On_Top.shader.meta deleted file mode 100644 index a98b00a..0000000 --- a/Assets/Shaders/2D/UI/UI_Always_On_Top.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: f93ce66ceeb7f8742bcf09caa64f1fb6 -timeCreated: 1500793478 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D.meta b/Assets/Shaders/3D.meta deleted file mode 100644 index 6902021..0000000 --- a/Assets/Shaders/3D.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 4e16b4c226149b5498e758bba415028e -folderAsset: yes -timeCreated: 1511611817 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/Debug.meta b/Assets/Shaders/3D/Debug.meta deleted file mode 100644 index aefc2c2..0000000 --- a/Assets/Shaders/3D/Debug.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 55b820388fd4d244398803fb14513b49 -folderAsset: yes -timeCreated: 1500793395 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/Debug/DebugNormalsTangents.shader b/Assets/Shaders/3D/Debug/DebugNormalsTangents.shader deleted file mode 100644 index 46ee47b..0000000 --- a/Assets/Shaders/3D/Debug/DebugNormalsTangents.shader +++ /dev/null @@ -1,91 +0,0 @@ -// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' - -// source: http://forum.unity3d.com/threads/tangent-space-normal-map-seams-problem-fixed.384063/#post-2496937 - -Shader "Custom/DebugNormalsTangents" { - Properties { - _MainTex ("Base (RGB)", 2D) = "white" {} - [NoScaleOffset] _BumpMap ("Normal Map", 2D) = "bump" {} - [KeywordEnum(None, Mesh Normals, Mesh Tangents, Tangent Normals, World Normals)] _Display ("Debug Display", Float) = 0 - } - -SubShader { - Tags { "RenderType"="Opaque" } - LOD 100 - - Pass { - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - #pragma multi_compile _ _DISPLAY_MESH_NORMALS _DISPLAY_MESH_TANGENTS _DISPLAY_TANGENT_NORMALS _DISPLAY_WORLD_NORMALS - - #include "UnityCG.cginc" - - struct v2f { - float4 vertex : SV_POSITION; - half2 texcoord : TEXCOORD0; - half3 tspace0 : TEXCOORD1; // tangent.x, bitangent.x, normal.x - half3 tspace1 : TEXCOORD2; // tangent.y, bitangent.y, normal.y - half3 tspace2 : TEXCOORD3; // tangent.z, bitangent.z, normal.z - }; - - sampler2D _MainTex; - sampler2D _BumpMap; - - fixed4 _LightColor0; - - v2f vert (appdata_tan v) - { - v2f o; - o.vertex = UnityObjectToClipPos(v.vertex); - o.texcoord = v.texcoord; - - half3 wNormal = UnityObjectToWorldNormal(v.normal); - half3 wTangent = UnityObjectToWorldDir(v.tangent.xyz); - // compute bitangent from cross product of normal and tangent - half tangentSign = v.tangent.w * unity_WorldTransformParams.w; - half3 wBitangent = cross(wNormal, wTangent) * tangentSign; - // output the tangent space matrix - o.tspace0 = half3(wTangent.x, wBitangent.x, wNormal.x); - o.tspace1 = half3(wTangent.y, wBitangent.y, wNormal.y); - o.tspace2 = half3(wTangent.z, wBitangent.z, wNormal.z); - return o; - } - - fixed4 frag (v2f i) : SV_Target - { - #ifdef _DISPLAY_MESH_NORMALS - return fixed4(fixed3(i.tspace0.z, i.tspace1.z, i.tspace2.z) * 0.5 + 0.5, 1); - #endif - - #ifdef _DISPLAY_MESH_TANGENTS - return fixed4(fixed3(i.tspace0.x, i.tspace1.x, i.tspace2.x) * 0.5 + 0.5, 1); - #endif - - half3 tnormal = UnpackNormal(tex2D(_BumpMap, i.texcoord)); - - #ifdef _DISPLAY_TANGENT_NORMALS - return fixed4(tnormal * 0.5 + 0.5, 1); - #endif - - half3 worldNormal; - worldNormal.x = dot(i.tspace0, tnormal); - worldNormal.y = dot(i.tspace1, tnormal); - worldNormal.z = dot(i.tspace2, tnormal); - - #ifdef _DISPLAY_WORLD_NORMALS - return fixed4(worldNormal * 0.5 + 0.5, 1); - #endif - - fixed4 col = tex2D(_MainTex, i.texcoord); - half ndotl = dot(worldNormal, -_WorldSpaceLightPos0.xyz); - col.rgb *= (ndotl * 0.5 + 0.5) * _LightColor0.rgb; - - return col; - } - ENDCG - } -} - -} - diff --git a/Assets/Shaders/3D/Debug/DebugNormalsTangents.shader.meta b/Assets/Shaders/3D/Debug/DebugNormalsTangents.shader.meta deleted file mode 100644 index 5d7f422..0000000 --- a/Assets/Shaders/3D/Debug/DebugNormalsTangents.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 4c021e765a244dd4cb0307376032fa0a -timeCreated: 1500793449 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/Debug/LerpColorNearToFarPlane.shader b/Assets/Shaders/3D/Debug/LerpColorNearToFarPlane.shader deleted file mode 100644 index ac97b8b..0000000 --- a/Assets/Shaders/3D/Debug/LerpColorNearToFarPlane.shader +++ /dev/null @@ -1,54 +0,0 @@ -// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' - -// source: https://forum.unity3d.com/threads/depth-shader-invert-it.12692/#post-89430 -// lerp 2 colors between camera NearClipPlane to FarClipPlane - -Shader "UnityCommunity/Debug/LerpColorNearToFarPlane" -{ - Properties { - _ColorNear ("Color Near", Color) = (1,0,0,1) - _ColorFar ("Color Far", Color) = (0,1,0,1) - } - SubShader - { - Pass - { - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - #include "UnityCG.cginc" - - struct appdata - { - float4 vertex : POSITION; - }; - - struct v2f - { - float4 pos : SV_POSITION; - float4 color : COLOR; - }; - - uniform float4 _ColorNear; - uniform float4 _ColorFar; - - v2f vert(appdata v) - { - v2f o; - o.pos = UnityObjectToClipPos(v.vertex); - float depth; - COMPUTE_EYEDEPTH(depth); - float factor = depth * _ProjectionParams.w; - o.color = lerp(_ColorNear, _ColorFar, factor); - return o; - } - - fixed4 frag (v2f i) : SV_Target - { - return i.color; - } - - ENDCG - } - } -} diff --git a/Assets/Shaders/3D/Debug/LerpColorNearToFarPlane.shader.meta b/Assets/Shaders/3D/Debug/LerpColorNearToFarPlane.shader.meta deleted file mode 100644 index 3dfdd91..0000000 --- a/Assets/Shaders/3D/Debug/LerpColorNearToFarPlane.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 91f2627c2dd513245bf7515fdb7796f2 -timeCreated: 1500793459 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/Reflection.meta b/Assets/Shaders/3D/Reflection.meta deleted file mode 100644 index 13e210f..0000000 --- a/Assets/Shaders/3D/Reflection.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 4dcfe792bff0b3e4c9f909a023219231 -folderAsset: yes -timeCreated: 1511614225 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/Reflection/Reflective.meta b/Assets/Shaders/3D/Reflection/Reflective.meta deleted file mode 100644 index 4f5aace..0000000 --- a/Assets/Shaders/3D/Reflection/Reflective.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 0cc84c491ff495544be1e326393b1615 -folderAsset: yes -timeCreated: 1500793394 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/Reflection/Reflective/BumpedSpecularFresnel.shader b/Assets/Shaders/3D/Reflection/Reflective/BumpedSpecularFresnel.shader deleted file mode 100644 index 9071071..0000000 --- a/Assets/Shaders/3D/Reflection/Reflective/BumpedSpecularFresnel.shader +++ /dev/null @@ -1,83 +0,0 @@ -// source: http://forum.unity3d.com/threads/surface-shader-fresnel-reflective-bumped-specular.63250/ - -Shader "Reflective/Bumped Specular Fresnel" -{ - Properties - { - _Color ("Main Color", Color) = (1,1,1,1) - _SpecColor ("Specular Color", Color) = (0.5,0.5,0.5,1) - _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 - _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5) - _MainTex ("Base (RGB) RefStrGloss (A)", 2D) = "white" {} - _Cube ("Reflection Cubemap", Cube) = "" {} - _BumpMap ("Normalmap", 2D) = "bump" {} - _Fresnel("Fresnel Coef.", Range (0.01, 0.7)) = 0.35 - } - - SubShader - { - Tags { "RenderType"="Opaque" } - LOD 400 - CGPROGRAM - #pragma surface surf BlinnPhong - #pragma target 3.0 - - sampler2D _MainTex; - sampler2D _BumpMap; - samplerCUBE _Cube; - - float4 _Color; - float4 _ReflectColor; - float _Shininess; - float _Fresnel; - - struct Input { - float2 uv_MainTex; - float2 uv_BumpMap; - //float3 normal; - float3 viewDir; - float3 worldRefl; - INTERNAL_DATA - }; - - //taken from somewhere in internet - float fresnel(float VdotN, float eta) - { - float sqr_eta = eta * eta; // square of IOR - float etaCos = eta * VdotN; // η·cos(Θ) - float sqr_etaCos = etaCos*etaCos; // squared - float one_minSqrEta = 1.0 - sqr_eta; // 1 – η2 - float value = etaCos - sqrt(one_minSqrEta + sqr_etaCos); - value *= value / one_minSqrEta; // square and divide by 1 – η2 - return min(1.0, value * value); // square again - } - - //float fFresnel = fresnel(dot(vViewNormal, vNormalWS), indexOfRefraction); - - void surf (Input IN, inout SurfaceOutput o) - { - half4 tex = tex2D(_MainTex, IN.uv_MainTex); - half4 c = tex * _Color; - o.Albedo = c.rgb; - - o.Gloss = tex.a; - o.Specular = _Shininess; - - o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); - - float3 worldRefl = WorldReflectionVector (IN, o.Normal); - - half4 reflcol = texCUBE (_Cube, worldRefl); - reflcol *= tex.a; - - //reflcol = lerp(c, reflcol, fresnel(worldRefl, _Fresnel)); - reflcol = lerp(c, reflcol, fresnel(dot(normalize(IN.viewDir),o.Normal), _Fresnel)); - - o.Emission = reflcol.rgb * _ReflectColor.rgb; - o.Alpha = reflcol.a * _ReflectColor.a; - } - ENDCG - } - - FallBack "Reflective/Bumped Diffuse" -} diff --git a/Assets/Shaders/3D/Reflection/Reflective/BumpedSpecularFresnel.shader.meta b/Assets/Shaders/3D/Reflection/Reflective/BumpedSpecularFresnel.shader.meta deleted file mode 100644 index c0fc01c..0000000 --- a/Assets/Shaders/3D/Reflection/Reflective/BumpedSpecularFresnel.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 0079b74170cd5fc4aa82cfb9d7e1ff20 -timeCreated: 1500793447 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/Reflection/ReliefMapping.meta b/Assets/Shaders/3D/Reflection/ReliefMapping.meta deleted file mode 100644 index c81b796..0000000 --- a/Assets/Shaders/3D/Reflection/ReliefMapping.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: feb4f9880e6c6d54083cd1bcb109dc9f -folderAsset: yes -timeCreated: 1500793396 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/Reflection/ReliefMapping/ReliefMapping.shader b/Assets/Shaders/3D/Reflection/ReliefMapping/ReliefMapping.shader deleted file mode 100644 index e6b4319..0000000 --- a/Assets/Shaders/3D/Reflection/ReliefMapping/ReliefMapping.shader +++ /dev/null @@ -1,122 +0,0 @@ -// source: http://forum.unity3d.com/threads/fabio-policarpo-relief-mapping-with-correct-silhouettes.32451/page-2#post-518105 - -Shader "UnityLibrary/ReliefMapping" -{ - Properties - { - _Color ("Main Color", Color) = (1,1,1,1) - _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) - _Height ("Height", Float) = -0.05 - _Tile ("Tile Factor", Float) = 1 - _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 - _useAlpha ("Use Alpha", Range(0,1)) = 1 - _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 - _MainTex ("Base (RGB), Spec (A)", 2D) = "white" {} - _NormalMap ("Normalmap", 2D) = "bump" {} - _HeightMap ("Height (A)", 2D) = "bump" {} - } - - SubShader - { - Tags {"IgnoreProjector"="True" "RenderType"="TransparentCutout"} - LOD 300 - - CGPROGRAM - #pragma surface surf BlinnPhong alphatest:_Cutoff - #pragma target 3.0 - - sampler2D _MainTex; - sampler2D _NormalMap; - sampler2D _HeightMap; - float4 _Color; - float _Height; - float _Tile; - float _Shininess; - float _useAlpha; - - struct Input { // vertex input - - float2 uv_MainTex; - float2 uv_NormalMap; - float2 uv_HeightMap; - float3 viewDir; - - }; - - void surf (Input IN, inout SurfaceOutput o) { - - IN.uv_MainTex *= _Tile; - IN.viewDir = normalize(IN.viewDir); - - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - //setup the view ray - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - float3 p = float3(IN.uv_MainTex,0); - float3 v = normalize(IN.viewDir*-1); - v.z = abs(v.z); - - //depth bias - float depthBias = 1.0 - v.z; - depthBias *= depthBias; - depthBias *= depthBias; - depthBias = 1.0 - depthBias * depthBias; - - v.xy *= depthBias; - v.xy *= _Height; - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - //ray intersection - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - const int linearSearchSteps = 20; - const int binarySearchSteps = 10; - - v /= v.z * linearSearchSteps; - - int i; - for( i=0;i _Tile) alpha = 0; - if (p.y > _Tile) alpha = 0; - - o.Alpha = alpha; - } - - o.Gloss = tex.a; - o.Specular = _Shininess; - o.Albedo = tex.rgb * _Color.rgb; - - } // surf - - ENDCG - } - FallBack "Bumped Specular" -} diff --git a/Assets/Shaders/3D/Reflection/ReliefMapping/ReliefMapping.shader.meta b/Assets/Shaders/3D/Reflection/ReliefMapping/ReliefMapping.shader.meta deleted file mode 100644 index b4e9620..0000000 --- a/Assets/Shaders/3D/Reflection/ReliefMapping/ReliefMapping.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 6323b67979f9b2f41b3a63b382daf156 -timeCreated: 1500793453 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/SkyBox.meta b/Assets/Shaders/3D/SkyBox.meta deleted file mode 100644 index 6f472aa..0000000 --- a/Assets/Shaders/3D/SkyBox.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 733527ee659d25b4e9971e1b58935d11 -folderAsset: yes -timeCreated: 1500793395 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/SkyBox/Cubemap-Simple.shader b/Assets/Shaders/3D/SkyBox/Cubemap-Simple.shader deleted file mode 100644 index 5da0211..0000000 --- a/Assets/Shaders/3D/SkyBox/Cubemap-Simple.shader +++ /dev/null @@ -1,48 +0,0 @@ -// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' - -// simplified skybox shader (unity 5.3.x) -// removed tint, rotation, exposure, HDR calculation - -Shader "UnityLibrary/Skybox/Cubemap-Simple" -{ - Properties { - [NoScaleOffset] _Tex ("Cubemap (HDR)", Cube) = "grey" {} - } - - SubShader { - Tags { "Queue"="Background" "RenderType"="Background" "PreviewType"="Skybox" } - Cull Off ZWrite Off - - Pass { - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - - samplerCUBE _Tex; - - struct appdata_t { - float4 vertex : POSITION; - }; - - struct v2f { - float4 vertex : SV_POSITION; - float3 texcoord : TEXCOORD0; - }; - - v2f vert (appdata_t v) - { - v2f o; - o.vertex = UnityObjectToClipPos(v.vertex); - o.texcoord = v.vertex.xyz; - return o; - } - - fixed4 frag (v2f i) : SV_Target - { - return half4(texCUBE(_Tex, i.texcoord).rgb,1); - } - ENDCG - } - } - Fallback Off -} diff --git a/Assets/Shaders/3D/SkyBox/Cubemap-Simple.shader.meta b/Assets/Shaders/3D/SkyBox/Cubemap-Simple.shader.meta deleted file mode 100644 index 816b562..0000000 --- a/Assets/Shaders/3D/SkyBox/Cubemap-Simple.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 2a8b2b13e1fbf4d4683fc8ab5cbefd08 -timeCreated: 1500793448 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/Terrain.meta b/Assets/Shaders/3D/Terrain.meta deleted file mode 100644 index 84e8708..0000000 --- a/Assets/Shaders/3D/Terrain.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: a19e0b2644eb95746a254fe12c1e1f20 -folderAsset: yes -timeCreated: 1500793395 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/Terrain/Splatmask4Textures.shader b/Assets/Shaders/3D/Terrain/Splatmask4Textures.shader deleted file mode 100644 index 6166d53..0000000 --- a/Assets/Shaders/3D/Terrain/Splatmask4Textures.shader +++ /dev/null @@ -1,68 +0,0 @@ -// Splatmap shader for mesh terrain (not for unity terrain) -Shader "UnityLibrary/Terrain/Splatmask4Textures" { - Properties { - _MainTex1 ("Texture1", 2D) = "white" {} - _MainTex1Normal ("Normal1", 2D) = "bump" {} - _MainTex2 ("Texture2", 2D) = "white" {} - _MainTex2Normal ("Normal2", 2D) = "bump" {} - _MainTex3 ("Texture3", 2D) = "white" {} - _MainTex3Normal ("Normal3", 2D) = "bump" {} - _MainTex4 ("Texture4", 2D) = "white" {} - _MainTex4Normal ("Normal4", 2D) = "bump" {} - _Mask ("SplatMask (RGBA)", 2D) = "white" {} - } - SubShader { - Tags { "RenderType"="Opaque" } - LOD 200 - - CGPROGRAM - #pragma surface surf Lambert - #pragma target 3.0 - - sampler2D _MainTex1; - sampler2D _MainTex2; - sampler2D _MainTex3; - sampler2D _MainTex4; - sampler2D _MainTex1Normal; - sampler2D _MainTex2Normal; - sampler2D _MainTex3Normal; - sampler2D _MainTex4Normal; - sampler2D _Mask; - - struct Input { - float2 uv_MainTex1; - float2 uv_Mask; - }; - - void surf (Input i, inout SurfaceOutput o) - { - // mix colors using mask - fixed3 color1 = tex2D( _MainTex1, i.uv_MainTex1.xy ).rgb; - fixed3 color2 = tex2D( _MainTex2, i.uv_MainTex1.xy ).rgb; - fixed3 color3 = tex2D( _MainTex3, i.uv_MainTex1.xy ).rgb; - fixed3 color4 = tex2D( _MainTex4, i.uv_MainTex1.xy ).rgb; - - fixed4 mask = tex2D( _Mask, i.uv_Mask.xy ); - - fixed3 c = color1 * mask.r + color2 * mask.g + color3 * mask.b; - c = lerp(c,color4,mask.a); - - // normals - fixed3 normal1 = UnpackNormal(tex2D (_MainTex1Normal, i.uv_MainTex1.xy)); - fixed3 normal2 = UnpackNormal(tex2D (_MainTex2Normal, i.uv_MainTex1.xy)); - fixed3 normal3 = UnpackNormal(tex2D (_MainTex3Normal, i.uv_MainTex1.xy)); - fixed3 normal4 = UnpackNormal(tex2D (_MainTex4Normal, i.uv_MainTex1.xy)); - - fixed3 n = normal1 * mask.r + normal2 * mask.g + normal3 * mask.b; - n = lerp(n,normal4,mask.a); - - - // output - o.Albedo = c; - o.Normal = n; - o.Alpha = 1; - } - ENDCG - } - FallBack "Diffuse" -} diff --git a/Assets/Shaders/3D/Terrain/Splatmask4Textures.shader.meta b/Assets/Shaders/3D/Terrain/Splatmask4Textures.shader.meta deleted file mode 100644 index dd748c6..0000000 --- a/Assets/Shaders/3D/Terrain/Splatmask4Textures.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: dc4198c03554ea242b092eac310315d8 -timeCreated: 1500793475 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/Terrain/Trees.meta b/Assets/Shaders/3D/Terrain/Trees.meta deleted file mode 100644 index 5d7f38c..0000000 --- a/Assets/Shaders/3D/Terrain/Trees.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 3d8c59865c792554a9da41def0d54a26 -folderAsset: yes -timeCreated: 1500793396 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/Terrain/Trees/Unity-BillboardTree.shader b/Assets/Shaders/3D/Terrain/Trees/Unity-BillboardTree.shader deleted file mode 100644 index c121772..0000000 --- a/Assets/Shaders/3D/Terrain/Trees/Unity-BillboardTree.shader +++ /dev/null @@ -1,59 +0,0 @@ -// Unity Tree Billboard (not speedtree) replacement shader that works with Legacy Global Fog -// topic: https://forum.unity3d.com/threads/global-fog-doesnt-affect-billboard-trees.473300/ - -Shader "Hidden/TerrainEngine/BillboardTree" { - Properties { - _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} - _Cutoff("Cutoff", float) = 0.33 // adjust this value here in shader code - } - - SubShader { - Tags { "Queue" = "AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout" } - - Pass { - ColorMask rgb - ZWrite Off Cull Off - - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - #pragma multi_compile_fog - #include "UnityCG.cginc" - #include "TerrainEngine.cginc" - - struct v2f { - float4 pos : SV_POSITION; - fixed4 color : COLOR0; - float2 uv : TEXCOORD0; - UNITY_FOG_COORDS(1) - UNITY_VERTEX_OUTPUT_STEREO - }; - - v2f vert (appdata_tree_billboard v) { - v2f o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - TerrainBillboardTree(v.vertex, v.texcoord1.xy, v.texcoord.y); - o.pos = UnityObjectToClipPos(v.vertex); - o.uv.x = v.texcoord.x; - o.uv.y = v.texcoord.y > 0; - o.color = v.color; - UNITY_TRANSFER_FOG(o,o.pos); - return o; - } - - fixed _Cutoff; - sampler2D _MainTex; - fixed4 frag(v2f input) : SV_Target - { - fixed4 col = tex2D( _MainTex, input.uv); - col.rgb *= input.color.rgb; - clip(col.a-_Cutoff); - UNITY_APPLY_FOG(input.fogCoord, col); - return col; - } - ENDCG - } - } - Fallback Off -} diff --git a/Assets/Shaders/3D/Terrain/Trees/Unity-BillboardTree.shader.meta b/Assets/Shaders/3D/Terrain/Trees/Unity-BillboardTree.shader.meta deleted file mode 100644 index 80d7db6..0000000 --- a/Assets/Shaders/3D/Terrain/Trees/Unity-BillboardTree.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: e00c8f3696b8b4c4dbcbefe37a28cdfa -timeCreated: 1500793476 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/TextureMapping.meta b/Assets/Shaders/3D/TextureMapping.meta deleted file mode 100644 index e267916..0000000 --- a/Assets/Shaders/3D/TextureMapping.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: ff1160a8c4b5696449c6df6e4a05909d -folderAsset: yes -timeCreated: 1500793396 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/TextureMapping/Equirectangular.shader b/Assets/Shaders/3D/TextureMapping/Equirectangular.shader deleted file mode 100644 index 5f0ee7a..0000000 --- a/Assets/Shaders/3D/TextureMapping/Equirectangular.shader +++ /dev/null @@ -1,73 +0,0 @@ -// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' - -//from https://forum.unity3d.com/threads/what-is-wrong-with-unitys-spherical-mapping-how-to-fix-it.321205/ - -/* -* Equirectangular mapping for use with textures such as the ones found here: -* https://www.flickr.com/groups/equirectangular/ -* -* No need for a pre-textured sphere, but is not very efficient -*/ - -Shader "Custom/Equirectangular" { - Properties { - _Color ("Main Color", Color) = (1,1,1,1) - _MainTex ("Diffuse (RGB) Alpha (A)", 2D) = "gray" {} - } - - SubShader{ - Cull Off //allows seeing a standard unity sphere from inside and outside - Pass { - Tags {"LightMode" = "Always"} - - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - #pragma fragmentoption ARB_precision_hint_fastest - #pragma glsl - #pragma target 3.0 - - #include "UnityCG.cginc" - - struct appdata { - float4 vertex : POSITION; - float3 normal : NORMAL; - }; - - struct v2f - { - float4 pos : SV_POSITION; - float3 normal : TEXCOORD0; - }; - - v2f vert (appdata v) - { - v2f o; - o.pos = UnityObjectToClipPos(v.vertex); - o.normal = v.normal; - return o; - } - - sampler2D _MainTex; - - #define PI 3.141592653589793 - - inline float2 RadialCoords(float3 a_coords) - { - float3 a_coords_n = normalize(a_coords); - float lon = atan2(a_coords_n.z, a_coords_n.x); - float lat = acos(a_coords_n.y); - float2 sphereCoords = float2(lon, lat) * (1.0 / PI); - return float2(sphereCoords.x * 0.5 + 0.5, 1 - sphereCoords.y); - } - - float4 frag(v2f IN) : COLOR - { - float2 equiUV = RadialCoords(IN.normal); - return tex2D(_MainTex, equiUV); - } - ENDCG - } - } - FallBack "VertexLit" -} diff --git a/Assets/Shaders/3D/TextureMapping/Equirectangular.shader.meta b/Assets/Shaders/3D/TextureMapping/Equirectangular.shader.meta deleted file mode 100644 index 4fcb143..0000000 --- a/Assets/Shaders/3D/TextureMapping/Equirectangular.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: c2a51d57daeec064195176107a64ec19 -timeCreated: 1500793468 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/Unlit.meta b/Assets/Shaders/3D/Unlit.meta deleted file mode 100644 index 6731a47..0000000 --- a/Assets/Shaders/3D/Unlit.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 1e441a495fdca78418458cb3dba06fd9 -folderAsset: yes -timeCreated: 1500793394 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/Unlit/UnlitDoubleSided.shader b/Assets/Shaders/3D/Unlit/UnlitDoubleSided.shader deleted file mode 100644 index 4baf055..0000000 --- a/Assets/Shaders/3D/Unlit/UnlitDoubleSided.shader +++ /dev/null @@ -1,44 +0,0 @@ -Shader "UnityCommunity/Unlit/Double Sided" -{ - Properties - { - _MainTex ("Texture", 2D) = "white" {} - } - Subshader - { - Tags {"Queue"="Transparent" "IgnoreProjector"="true" "RenderType"="Transparent"} - ZWrite Off Blend SrcAlpha OneMinusSrcAlpha Cull Off - - Pass - { - Cull Off - CGPROGRAM - #pragma vertex vertex_shader - #pragma fragment pixel_shader - #pragma target 3.0 - - sampler2D _MainTex; - - struct custom_type - { - float4 clip_space_vertex : SV_POSITION; - float2 uv : TEXCOORD0; - }; - - custom_type vertex_shader (float4 object_space_vertex : POSITION, float2 uv : TEXCOORD0) - { - custom_type vs; - vs.clip_space_vertex = UnityObjectToClipPos (object_space_vertex); - vs.uv=uv; - return vs; - } - - float4 pixel_shader (custom_type ps) : SV_TARGET - { - return tex2D (_MainTex,ps.uv.xy); - } - - ENDCG - } - } -} \ No newline at end of file diff --git a/Assets/Shaders/3D/Unlit/UnlitDoubleSided.shader.meta b/Assets/Shaders/3D/Unlit/UnlitDoubleSided.shader.meta deleted file mode 100644 index 3525df8..0000000 --- a/Assets/Shaders/3D/Unlit/UnlitDoubleSided.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 82111366e9d1d0c4fb0aee75e08ca0c3 -timeCreated: 1512149105 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/Unlit/UnlitTransparentColor.shader b/Assets/Shaders/3D/Unlit/UnlitTransparentColor.shader deleted file mode 100644 index 8ba11af..0000000 --- a/Assets/Shaders/3D/Unlit/UnlitTransparentColor.shader +++ /dev/null @@ -1,52 +0,0 @@ -Shader "Custom/Unlit/Transparent Color" { - Properties{ - _Color("Color Tint", Color) = (1,1,1,1) - _MainTex("Base (RGB) Trans (A)", 2D) = "white" {} - } - - SubShader{ - Tags{ "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" } - LOD 100 - - ZWrite Off - Blend SrcAlpha OneMinusSrcAlpha - - Pass{ - CGPROGRAM -#pragma vertex vert -#pragma fragment frag - -#include "UnityCG.cginc" - - struct appdata_t { - float4 vertex : POSITION; - float2 texcoord : TEXCOORD0; - }; - - struct v2f { - float4 vertex : SV_POSITION; - half2 texcoord : TEXCOORD0; - }; - - sampler2D _MainTex; - float4 _MainTex_ST; - fixed4 _Color; - - v2f vert(appdata_t v) - { - v2f o; - o.vertex = UnityObjectToClipPos(v.vertex); - o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); - return o; - } - - fixed4 frag(v2f i) : SV_Target - { - fixed4 col = tex2D(_MainTex, i.texcoord) * _Color; - return col; - } - ENDCG - } - } - -} \ No newline at end of file diff --git a/Assets/Shaders/3D/Unlit/UnlitTransparentColor.shader.meta b/Assets/Shaders/3D/Unlit/UnlitTransparentColor.shader.meta deleted file mode 100644 index 9e7dc15..0000000 --- a/Assets/Shaders/3D/Unlit/UnlitTransparentColor.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 067b62334bad98c499c8751f5755581c -timeCreated: 1500793447 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/Unlit/UnlitTransparentColorGradient.shader b/Assets/Shaders/3D/Unlit/UnlitTransparentColorGradient.shader deleted file mode 100644 index e3df762..0000000 --- a/Assets/Shaders/3D/Unlit/UnlitTransparentColorGradient.shader +++ /dev/null @@ -1,95 +0,0 @@ -Shader "Custom/Unlit/Transparent Color Gradient" { - Properties{ - _MainTex("Base (RGB) Trans (A)", 2D) = "white" { } - _Color("Color1", Color) = (1.000000,1.000000,1.000000,1.000000) - _Color2("Color2", Color) = (1.000000,1.000000,1.000000,1.000000) - } - - SubShader{ - LOD 100 - Tags{ "QUEUE" = "Transparent" "IGNOREPROJECTOR" = "true" "RenderType" = "Transparent" } - Pass{ - Tags{ "QUEUE" = "Transparent" "IGNOREPROJECTOR" = "true" "RenderType" = "Transparent" } - Blend SrcAlpha OneMinusSrcAlpha - - CGPROGRAM -#pragma vertex vert -#pragma fragment frag -#pragma target 2.0 -#include "UnityCG.cginc" -#pragma multi_compile_fog -#define USING_FOG (defined(FOG_LINEAR) || defined(FOG_EXP) || defined(FOG_EXP2)) - - // uniforms - float4 _MainTex_ST; - - // vertex shader input data - struct appdata { - float3 pos : POSITION; - float3 uv0 : TEXCOORD0; - }; - - // vertex-to-fragment interpolators - struct v2f { - fixed4 color : COLOR0; - float2 uv0 : TEXCOORD0; -#if USING_FOG - fixed fog : TEXCOORD1; -#endif - float4 pos : SV_POSITION; - float4 screenPos: TEXCOORD2; - }; - - // vertex shader - v2f vert(appdata IN) { - v2f o; - half4 color = half4(0,0,0,1.1); - float3 eyePos = mul(UNITY_MATRIX_MV, float4(IN.pos,1)).xyz; - half3 viewDir = 0.0; - o.color = saturate(color); - // compute texture coordinates - o.uv0 = IN.uv0.xy * _MainTex_ST.xy + _MainTex_ST.zw; - // fog -#if USING_FOG - float fogCoord = length(eyePos.xyz); // radial fog distance - UNITY_CALC_FOG_FACTOR(fogCoord); - o.fog = saturate(unityFogFactor); -#endif - // transform position - o.pos = UnityObjectToClipPos(IN.pos); - o.screenPos = ComputeScreenPos(o.pos); - return o; - } - - // textures - sampler2D _MainTex; - fixed4 _Color; - fixed4 _Color2; - - // fragment shader - fixed4 frag(v2f IN) : SV_Target{ - fixed4 col; - fixed4 tex, tmp0, tmp1, tmp2; - // SetTexture #0 - tex = tex2D(_MainTex, IN.uv0.xy); - - float2 screenPosition = (IN.screenPos.xy / IN.screenPos.w); - - //float2 screenUV = IN.screenPos.xy / IN.screenPos.w; - fixed4 color = lerp(_Color, _Color2, screenPosition.x); - - col.rgb = tex * color; - col.a = tex.a * color.a; - // fog -#if USING_FOG - col.rgb = lerp(unity_FogColor.rgb, col.rgb, IN.fog); -#endif - return col; - } - - // texenvs - //! TexEnv0: 01010102 01050106 [_MainTex] [_Color] - ENDCG - } - } -} \ No newline at end of file diff --git a/Assets/Shaders/3D/Unlit/UnlitTransparentColorGradient.shader.meta b/Assets/Shaders/3D/Unlit/UnlitTransparentColorGradient.shader.meta deleted file mode 100644 index a7d1ad6..0000000 --- a/Assets/Shaders/3D/Unlit/UnlitTransparentColorGradient.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 1e18fd258e063d84a83cb144e7708884 -timeCreated: 1500793448 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/Vertex.meta b/Assets/Shaders/3D/Vertex.meta deleted file mode 100644 index e9dc11b..0000000 --- a/Assets/Shaders/3D/Vertex.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 2a44a518ad7aa66468721a90103ab81e -folderAsset: yes -timeCreated: 1500793394 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/3D/Vertex/VertexColorMesh.shader b/Assets/Shaders/3D/Vertex/VertexColorMesh.shader deleted file mode 100644 index e1790ef..0000000 --- a/Assets/Shaders/3D/Vertex/VertexColorMesh.shader +++ /dev/null @@ -1,47 +0,0 @@ -// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' - -// vertex colors shader for mesh - -Shader "UnityCommunity/Vertex/VertexColorMesh" -{ - SubShader - { - Tags { "Queue"="Geometry"} -// Lighting Off - Fog { Mode Off } - - Pass - { - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - #pragma fragmentoption ARB_precision_hint_fastest - - struct appdata - { - float4 vertex : POSITION; - fixed4 color : COLOR; - }; - - struct v2f - { - float4 pos : SV_POSITION; - fixed4 color : COLOR; - }; - - v2f vert (appdata v) - { - v2f o; - o.pos = UnityObjectToClipPos(v.vertex); - o.color = v.color; - return o; - } - - half4 frag(v2f i) : COLOR - { - return i.color; - } - ENDCG - } - } -} diff --git a/Assets/Shaders/3D/Vertex/VertexColorMesh.shader.meta b/Assets/Shaders/3D/Vertex/VertexColorMesh.shader.meta deleted file mode 100644 index a4b599e..0000000 --- a/Assets/Shaders/3D/Vertex/VertexColorMesh.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: e0d6ecfd2bff856419569d3aaca8fdc1 -timeCreated: 1500793477 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/README.md b/Assets/Shaders/README.md deleted file mode 100644 index 73e20d1..0000000 --- a/Assets/Shaders/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Shaders -The one of most important things in game development is the visual experience. - -Here is a complete set of useful shaders that everyone will need. - -## License -[MIT](https://github.com/UnityCommunity/UnityLibrary/blob/master/LICENSE.md) @ [Unity Community](https://github.com/UnityCommunity/) - -Made with :heart: by [Unity Community](https://github.com/UnityCommunity/) diff --git a/Assets/Shaders/README.md.meta b/Assets/Shaders/README.md.meta deleted file mode 100644 index e2703b1..0000000 --- a/Assets/Shaders/README.md.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 3da44f7f0d7760d4e8b776ae1673fbe1 -timeCreated: 1500793395 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Changelog/README.md b/Changelog/README.md new file mode 100644 index 0000000..e1d193c --- /dev/null +++ b/Changelog/README.md @@ -0,0 +1,9 @@ +--- +layout: default +title: Changelog +nav_order: 6 +--- + +# Changelog + +Here is the list of changes of our library. diff --git a/Assets/Scripts/Docs/README.md b/Contents/Docs/README.md similarity index 62% rename from Assets/Scripts/Docs/README.md rename to Contents/Docs/README.md index 45f96a5..1dda686 100644 --- a/Assets/Scripts/Docs/README.md +++ b/Contents/Docs/README.md @@ -1,9 +1,12 @@ +--- +layout: default +title: Docs +nav_order: 1 +parent: Contents +--- + # Docs Sometimes we see some missing, outdated or broken documentations and examples at Unity official documentation Manual or Scripting API, so we have collected some of them and made a good examples and documentations about them. Do you found a missing documentation or example? [File it here and let us add it](https://github.com/UnityCommunity/UnityLibrary/issues) -## License -[MIT](https://github.com/UnityCommunity/UnityLibrary/blob/master/LICENSE.md) @ [Unity Community](https://github.com/UnityCommunity/) - -Made with :heart: by [Unity Community](https://github.com/UnityCommunity/) diff --git a/Contents/Editor/README.md b/Contents/Editor/README.md new file mode 100644 index 0000000..8dcd3fe --- /dev/null +++ b/Contents/Editor/README.md @@ -0,0 +1,12 @@ +--- +layout: default +title: Editor scripts +nav_order: 2 +parent: Contents +--- + +# Editor Scripts +Extend the Unity Editor with the power of Community. + +Experiencing errors and problems, no worry, [File them, and let us fix them](https://github.com/UnityCommunity/UnityLibrary/issues) + diff --git a/Contents/External/README.md b/Contents/External/README.md new file mode 100644 index 0000000..96f8cd1 --- /dev/null +++ b/Contents/External/README.md @@ -0,0 +1,10 @@ +--- +layout: default +title: External +nav_order: 3 +parent: Contents +--- + +# External +External libraries, scripts and utitlities that are related to unity. + diff --git a/Assets/Scripts/Misc/Messaging/README.md b/Contents/Misc/Messaging/README.md similarity index 80% rename from Assets/Scripts/Misc/Messaging/README.md rename to Contents/Misc/Messaging/README.md index a652e8b..446213d 100644 --- a/Assets/Scripts/Misc/Messaging/README.md +++ b/Contents/Misc/Messaging/README.md @@ -1,3 +1,10 @@ +--- +layout: default +title: Messaging +nav_order: 6 +parent: Contents +--- + * SendMessage substitute for global messaging without object references; * To subscribe to event, one must AddListener to event string and provide a callback method (f.e. OnEnable ); * To unsubscribe to event, one must RemoveListener to event string and provide a callback method (f.e. OnDisable ); diff --git a/ScriptTemplates/README.md b/Contents/ScriptTemplates/README.md similarity index 84% rename from ScriptTemplates/README.md rename to Contents/ScriptTemplates/README.md index f1b84ee..1804ce0 100644 --- a/ScriptTemplates/README.md +++ b/Contents/ScriptTemplates/README.md @@ -1,3 +1,10 @@ +--- +layout: default +title: Script Templates +nav_order: 4 +parent: Contents +--- + # Script Templates Script templates are plain text documents that contains a simple script functionally that let's you get started with script faster. @@ -25,8 +32,3 @@ Also the content of the file contains a simple script that replaces it's class n you can find it in the file by **#SCRIPTNAME#** tag. [**More information**](https://support.unity3d.com/hc/en-us/articles/210223733-How-to-customize-Unity-script-templates) - -## License -[MIT](https://github.com/UnityCommunity/UnityLibrary/blob/master/LICENSE.md) @ [Unity Community](https://github.com/UnityCommunity/) - -Made with :heart: by [Unity Community](https://github.com/UnityCommunity/) diff --git a/Assets/Scripts/README.md b/Contents/Scripts/README.md similarity index 63% rename from Assets/Scripts/README.md rename to Contents/Scripts/README.md index 7da190e..7c9a11a 100644 --- a/Assets/Scripts/README.md +++ b/Contents/Scripts/README.md @@ -1,3 +1,10 @@ +--- +layout: default +title: Scripts +nav_order: 5 +parent: Contents +--- + # Scripts The game logic. the most important part of game development. @@ -6,8 +13,3 @@ Do you want to make a car? do you try to invent the Wheel from the beginning? no So we have gathered pre made ready-to-use scripts here just for you. If you have experienced any errors or problems, [send it to us](https://github.com/UnityCommunity/UnityLibrary/issues), we are here to help. - -## License -[MIT](https://github.com/UnityCommunity/UnityLibrary/blob/master/LICENSE.md) @ [Unity Community](https://github.com/UnityCommunity/) - -Made with :heart: by [Unity Community](https://github.com/UnityCommunity/) diff --git a/Contents/contents.md b/Contents/contents.md new file mode 100644 index 0000000..198c78c --- /dev/null +++ b/Contents/contents.md @@ -0,0 +1,17 @@ +--- +layout: default +title: Contents +nav_order: 3 +has_children: true +--- + +# Contents + +In this section you can find the different modules our library is made of: + +- [Assets/Scripts/Docs/](https://github.com/UnityCommunity/UnityLibrary/tree/master/Assets/Scripts/Docs) : "Missing" examples from Unity Docs. +- [Assets/Scripts/](https://github.com/UnityCommunity/UnityLibrary/tree/master/Assets/Scripts) : Complete set of Unity scripts. +- [Assets/Scripts/Editor/](https://github.com/UnityCommunity/UnityLibrary/tree/master/Assets/Scripts/Editor) : Editor related scripts. +- [Assets/Shaders/](https://github.com/UnityCommunity/UnityLibrary/tree/master/Assets/Shaders) : Ready-to-use shaders. +- [ScriptTemplates/](https://github.com/UnityCommunity/UnityLibrary/tree/master/ScriptTemplates) : Contains ready-to-use script templates. +- [External/](https://github.com/UnityCommunity/UnityLibrary/tree/master/External) : External libaries, scripts and utilities that are related to unity. diff --git a/Contribute/README.md b/Contribute/README.md new file mode 100644 index 0000000..34e6de5 --- /dev/null +++ b/Contribute/README.md @@ -0,0 +1,44 @@ +--- +layout: default +title: Contribute +nav_order: 5 +--- + +## Contribution + +Any contribution to this repository is welcome. + +Also you can [join as a member](#join-the-community) to do more stuff such as creating new repositories for more awesome open source works. + +[Read our Contribution Guidelines](https://github.com/UnityCommunity/UnityLibrary/blob/master/CONTRIBUTING.md) to find a way to help. + +## Join the Community + +Send your GitHub id to one of the below ways: + +- [Unity Forums](https://forum.unity3d.com/conversations/add?to=mgear) *Private message +- Signup using [Google Forms](https://goo.gl/forms/DFspn3ByJBoLWEth2) *Can take few days until processed +- [hasanbayat1393@gmail.com](mailto:hasanbayat1393@gmail.com) + +Our communities: + +- [See](https://discordapp.com/channels/337579253866692608/337579253866692608) / [Join](https://discord.gg/cXT97hU) our Discord Channel (Main). +- [See](https://unitylibrary.slack.com/) / [Join](https://join.slack.com/t/unitylibrary/shared_invite/MjE1MDA2NzExNDEwLTE1MDA0OTE5NzktOGJmYTI0ZDlkNA) our Slack Channel. +- [See](https://gitter.im/UnityCommunity/Lobby) / [Join](https://gitter.im/UnityCommunity/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link) our Gitter Channel. +- [See](https://trello.com/b/1sOcvQzd) / [Join](https://trello.com/invite/unitycommunity/239a9f3cdaf3c54cf7efc2540c304279) our Trello Development Board. + +## Improvements / Ideas / Feedback + +Feel free to [post your ideas / comments / improvements / recommendations](https://github.com/UnityCommunity/UnityLibrary/issues) + +## Credits + +- [UnityCoder (mika)](https://github.com/unitycoder) (Owner) +- [EmpireWorld (Hasan Bayat)](https://github.com/EmpireWorld) (Owner) +- [Lootheo (Manuel Otheo)](https://github.com/Lootheo) (Member) +- [igorrafael (Igor Rafael de Sousa)](https://github.com/igorrafael) (Member) +- [nrlnd](https://github.com/nrlnd) (Member) +- [Sacristan (Ģirts Ķesteris)](https://github.com/Sacristan) (Member) +- [Agarcialeon (Álvaro García León)](https://github.com/agarcialeon) (Member) + +[Check out Unity Community People](https://github.com/orgs/UnityCommunity/people) diff --git a/External/Logging/LogcatNoActivity.bat b/External/Logging/LogcatNoActivity.bat deleted file mode 100644 index 1a5a1af..0000000 --- a/External/Logging/LogcatNoActivity.bat +++ /dev/null @@ -1,2 +0,0 @@ -REM run adb logcat without activity logging -adb logcat -s Unity dalvikvm DEBUG diff --git a/External/README.md b/External/README.md deleted file mode 100644 index dc15afb..0000000 --- a/External/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# External -External libraries, scripts and utitlities that are related to unity. - -## License -[MIT](https://github.com/UnityCommunity/UnityLibrary/blob/master/LICENSE.md) @ [Unity Community](https://github.com/UnityCommunity/) - -Made with :heart: by [Unity Community](https://github.com/UnityCommunity/) diff --git a/Getting-Started/Readme.md b/Getting-Started/Readme.md new file mode 100644 index 0000000..0a21636 --- /dev/null +++ b/Getting-Started/Readme.md @@ -0,0 +1,17 @@ +--- +layout: default +title: Getting Started +nav_order: 2 +--- + +## Getting Started + +This repository contains all kind of utilities for Unity from scripts to shaders. + +You can [browse this repository](https://github.com/UnityCommunity/UnityLibrary) and find your desired utility or you can [clone this repository](https://help.github.com/articles/cloning-a-repository/) and browse the files: + +```bash +git clone https://github.com/UnityCommunity/UnityLibrary.git +``` + +and then open the folder in Unity or you can find useful stuff by browsing awesome [resources](#resources) below. diff --git a/ProjectSettings/AudioManager.asset b/ProjectSettings/AudioManager.asset deleted file mode 100644 index da61125..0000000 --- a/ProjectSettings/AudioManager.asset +++ /dev/null @@ -1,17 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!11 &1 -AudioManager: - m_ObjectHideFlags: 0 - m_Volume: 1 - Rolloff Scale: 1 - Doppler Factor: 1 - Default Speaker Mode: 2 - m_SampleRate: 0 - m_DSPBufferSize: 0 - m_VirtualVoiceCount: 512 - m_RealVoiceCount: 32 - m_SpatializerPlugin: - m_AmbisonicDecoderPlugin: - m_DisableAudio: 0 - m_VirtualizeEffects: 1 diff --git a/ProjectSettings/ClusterInputManager.asset b/ProjectSettings/ClusterInputManager.asset deleted file mode 100644 index e7886b2..0000000 --- a/ProjectSettings/ClusterInputManager.asset +++ /dev/null @@ -1,6 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!236 &1 -ClusterInputManager: - m_ObjectHideFlags: 0 - m_Inputs: [] diff --git a/ProjectSettings/DynamicsManager.asset b/ProjectSettings/DynamicsManager.asset deleted file mode 100644 index 1931946..0000000 --- a/ProjectSettings/DynamicsManager.asset +++ /dev/null @@ -1,19 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!55 &1 -PhysicsManager: - m_ObjectHideFlags: 0 - serializedVersion: 3 - m_Gravity: {x: 0, y: -9.81, z: 0} - m_DefaultMaterial: {fileID: 0} - m_BounceThreshold: 2 - m_SleepThreshold: 0.005 - m_DefaultContactOffset: 0.01 - m_DefaultSolverIterations: 6 - m_DefaultSolverVelocityIterations: 1 - m_QueriesHitBackfaces: 0 - m_QueriesHitTriggers: 1 - m_EnableAdaptiveForce: 0 - m_EnablePCM: 1 - m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - m_AutoSimulation: 1 diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset deleted file mode 100644 index 6dc24f7..0000000 --- a/ProjectSettings/EditorBuildSettings.asset +++ /dev/null @@ -1,7 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1045 &1 -EditorBuildSettings: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Scenes: [] diff --git a/ProjectSettings/EditorSettings.asset b/ProjectSettings/EditorSettings.asset deleted file mode 100644 index f33b6fb..0000000 --- a/ProjectSettings/EditorSettings.asset +++ /dev/null @@ -1,16 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!159 &1 -EditorSettings: - m_ObjectHideFlags: 0 - serializedVersion: 4 - m_ExternalVersionControlSupport: Visible Meta Files - m_SerializationMode: 2 - m_DefaultBehaviorMode: 0 - m_SpritePackerMode: 0 - m_SpritePackerPaddingPower: 1 - m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd - m_ProjectGenerationRootNamespace: - m_UserGeneratedProjectSuffix: - m_CollabEditorSettings: - inProgressEnabled: 1 diff --git a/ProjectSettings/GraphicsSettings.asset b/ProjectSettings/GraphicsSettings.asset deleted file mode 100644 index 74d7b53..0000000 --- a/ProjectSettings/GraphicsSettings.asset +++ /dev/null @@ -1,61 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!30 &1 -GraphicsSettings: - m_ObjectHideFlags: 0 - serializedVersion: 12 - m_Deferred: - m_Mode: 1 - m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} - m_DeferredReflections: - m_Mode: 1 - m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} - m_ScreenSpaceShadows: - m_Mode: 1 - m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} - m_LegacyDeferred: - m_Mode: 1 - m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} - m_DepthNormals: - m_Mode: 1 - m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} - m_MotionVectors: - m_Mode: 1 - m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} - m_LightHalo: - m_Mode: 1 - m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} - m_LensFlare: - m_Mode: 1 - m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} - m_AlwaysIncludedShaders: - - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} - m_PreloadedShaders: [] - m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, - type: 0} - m_CustomRenderPipeline: {fileID: 0} - m_TransparencySortMode: 0 - m_TransparencySortAxis: {x: 0, y: 0, z: 1} - m_DefaultRenderingPath: 1 - m_DefaultMobileRenderingPath: 1 - m_TierSettings: [] - m_LightmapStripping: 0 - m_FogStripping: 0 - m_InstancingStripping: 0 - m_LightmapKeepPlain: 1 - m_LightmapKeepDirCombined: 1 - m_LightmapKeepDynamicPlain: 1 - m_LightmapKeepDynamicDirCombined: 1 - m_LightmapKeepShadowMask: 1 - m_LightmapKeepSubtractive: 1 - m_FogKeepLinear: 1 - m_FogKeepExp: 1 - m_FogKeepExp2: 1 - m_AlbedoSwatchInfos: [] - m_LightsUseLinearIntensity: 0 - m_LightsUseColorTemperature: 0 diff --git a/ProjectSettings/InputManager.asset b/ProjectSettings/InputManager.asset deleted file mode 100644 index 17c8f53..0000000 --- a/ProjectSettings/InputManager.asset +++ /dev/null @@ -1,295 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!13 &1 -InputManager: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Axes: - - serializedVersion: 3 - m_Name: Horizontal - descriptiveName: - descriptiveNegativeName: - negativeButton: left - positiveButton: right - altNegativeButton: a - altPositiveButton: d - gravity: 3 - dead: 0.001 - sensitivity: 3 - snap: 1 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Vertical - descriptiveName: - descriptiveNegativeName: - negativeButton: down - positiveButton: up - altNegativeButton: s - altPositiveButton: w - gravity: 3 - dead: 0.001 - sensitivity: 3 - snap: 1 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire1 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: left ctrl - altNegativeButton: - altPositiveButton: mouse 0 - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire2 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: left alt - altNegativeButton: - altPositiveButton: mouse 1 - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire3 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: left shift - altNegativeButton: - altPositiveButton: mouse 2 - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Jump - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: space - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Mouse X - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: - altNegativeButton: - altPositiveButton: - gravity: 0 - dead: 0 - sensitivity: 0.1 - snap: 0 - invert: 0 - type: 1 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Mouse Y - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: - altNegativeButton: - altPositiveButton: - gravity: 0 - dead: 0 - sensitivity: 0.1 - snap: 0 - invert: 0 - type: 1 - axis: 1 - joyNum: 0 - - serializedVersion: 3 - m_Name: Mouse ScrollWheel - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: - altNegativeButton: - altPositiveButton: - gravity: 0 - dead: 0 - sensitivity: 0.1 - snap: 0 - invert: 0 - type: 1 - axis: 2 - joyNum: 0 - - serializedVersion: 3 - m_Name: Horizontal - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: - altNegativeButton: - altPositiveButton: - gravity: 0 - dead: 0.19 - sensitivity: 1 - snap: 0 - invert: 0 - type: 2 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Vertical - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: - altNegativeButton: - altPositiveButton: - gravity: 0 - dead: 0.19 - sensitivity: 1 - snap: 0 - invert: 1 - type: 2 - axis: 1 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire1 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: joystick button 0 - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire2 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: joystick button 1 - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire3 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: joystick button 2 - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Jump - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: joystick button 3 - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Submit - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: return - altNegativeButton: - altPositiveButton: joystick button 0 - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Submit - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: enter - altNegativeButton: - altPositiveButton: space - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Cancel - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: escape - altNegativeButton: - altPositiveButton: joystick button 1 - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 diff --git a/ProjectSettings/NavMeshAreas.asset b/ProjectSettings/NavMeshAreas.asset deleted file mode 100644 index 6dd520f..0000000 --- a/ProjectSettings/NavMeshAreas.asset +++ /dev/null @@ -1,89 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!126 &1 -NavMeshProjectSettings: - m_ObjectHideFlags: 0 - serializedVersion: 2 - areas: - - name: Walkable - cost: 1 - - name: Not Walkable - cost: 1 - - name: Jump - cost: 2 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - m_LastAgentTypeID: -887442657 - m_Settings: - - serializedVersion: 2 - agentTypeID: 0 - agentRadius: 0.5 - agentHeight: 2 - agentSlope: 45 - agentClimb: 0.75 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - minRegionArea: 2 - manualCellSize: 0 - cellSize: 0.16666667 - manualTileSize: 0 - tileSize: 256 - accuratePlacement: 0 - m_SettingNames: - - Humanoid diff --git a/ProjectSettings/NetworkManager.asset b/ProjectSettings/NetworkManager.asset deleted file mode 100644 index 5dc6a83..0000000 --- a/ProjectSettings/NetworkManager.asset +++ /dev/null @@ -1,8 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!149 &1 -NetworkManager: - m_ObjectHideFlags: 0 - m_DebugLevel: 0 - m_Sendrate: 15 - m_AssetToPrefab: {} diff --git a/ProjectSettings/Physics2DSettings.asset b/ProjectSettings/Physics2DSettings.asset deleted file mode 100644 index e3b2d0b..0000000 --- a/ProjectSettings/Physics2DSettings.asset +++ /dev/null @@ -1,36 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!19 &1 -Physics2DSettings: - m_ObjectHideFlags: 0 - serializedVersion: 3 - m_Gravity: {x: 0, y: -9.81} - m_DefaultMaterial: {fileID: 0} - m_VelocityIterations: 8 - m_PositionIterations: 3 - m_VelocityThreshold: 1 - m_MaxLinearCorrection: 0.2 - m_MaxAngularCorrection: 8 - m_MaxTranslationSpeed: 100 - m_MaxRotationSpeed: 360 - m_BaumgarteScale: 0.2 - m_BaumgarteTimeOfImpactScale: 0.75 - m_TimeToSleep: 0.5 - m_LinearSleepTolerance: 0.01 - m_AngularSleepTolerance: 2 - m_DefaultContactOffset: 0.01 - m_AutoSimulation: 1 - m_QueriesHitTriggers: 1 - m_QueriesStartInColliders: 1 - m_ChangeStopsCallbacks: 0 - m_CallbacksOnDisable: 1 - m_AlwaysShowColliders: 0 - m_ShowColliderSleep: 1 - m_ShowColliderContacts: 0 - m_ShowColliderAABB: 0 - m_ContactArrowScale: 0.2 - m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} - m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} - m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} - m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} - m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset deleted file mode 100644 index c373cfb..0000000 --- a/ProjectSettings/ProjectSettings.asset +++ /dev/null @@ -1,595 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!129 &1 -PlayerSettings: - m_ObjectHideFlags: 0 - serializedVersion: 12 - productGUID: 36f97d821ecfac149ae5eae5c4496e56 - AndroidProfiler: 0 - defaultScreenOrientation: 4 - targetDevice: 2 - useOnDemandResources: 0 - accelerometerFrequency: 60 - companyName: DefaultCompany - productName: UnityLibrary - defaultCursor: {fileID: 0} - cursorHotspot: {x: 0, y: 0} - m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} - m_ShowUnitySplashScreen: 1 - m_ShowUnitySplashLogo: 1 - m_SplashScreenOverlayOpacity: 1 - m_SplashScreenAnimation: 1 - m_SplashScreenLogoStyle: 1 - m_SplashScreenDrawMode: 0 - m_SplashScreenBackgroundAnimationZoom: 1 - m_SplashScreenLogoAnimationZoom: 1 - m_SplashScreenBackgroundLandscapeAspect: 1 - m_SplashScreenBackgroundPortraitAspect: 1 - m_SplashScreenBackgroundLandscapeUvs: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - m_SplashScreenBackgroundPortraitUvs: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - m_SplashScreenLogos: [] - m_SplashScreenBackgroundLandscape: {fileID: 0} - m_SplashScreenBackgroundPortrait: {fileID: 0} - m_VirtualRealitySplashScreen: {fileID: 0} - m_HolographicTrackingLossScreen: {fileID: 0} - defaultScreenWidth: 1024 - defaultScreenHeight: 768 - defaultScreenWidthWeb: 960 - defaultScreenHeightWeb: 600 - m_StereoRenderingPath: 0 - m_ActiveColorSpace: 0 - m_MTRendering: 1 - m_MobileMTRendering: 0 - m_StackTraceTypes: 010000000100000001000000010000000100000001000000 - iosShowActivityIndicatorOnLoading: -1 - androidShowActivityIndicatorOnLoading: -1 - tizenShowActivityIndicatorOnLoading: -1 - iosAppInBackgroundBehavior: 0 - displayResolutionDialog: 1 - iosAllowHTTPDownload: 1 - allowedAutorotateToPortrait: 1 - allowedAutorotateToPortraitUpsideDown: 1 - allowedAutorotateToLandscapeRight: 1 - allowedAutorotateToLandscapeLeft: 1 - useOSAutorotation: 1 - use32BitDisplayBuffer: 1 - disableDepthAndStencilBuffers: 0 - defaultIsFullScreen: 1 - defaultIsNativeResolution: 1 - runInBackground: 0 - captureSingleScreen: 0 - muteOtherAudioSources: 0 - Prepare IOS For Recording: 0 - Force IOS Speakers When Recording: 0 - submitAnalytics: 1 - usePlayerLog: 1 - bakeCollisionMeshes: 0 - forceSingleInstance: 0 - resizableWindow: 0 - useMacAppStoreValidation: 0 - macAppStoreCategory: public.app-category.games - gpuSkinning: 0 - graphicsJobs: 0 - xboxPIXTextureCapture: 0 - xboxEnableAvatar: 0 - xboxEnableKinect: 0 - xboxEnableKinectAutoTracking: 0 - xboxEnableFitness: 0 - visibleInBackground: 1 - allowFullscreenSwitch: 1 - graphicsJobMode: 0 - macFullscreenMode: 2 - d3d9FullscreenMode: 1 - d3d11FullscreenMode: 1 - xboxSpeechDB: 0 - xboxEnableHeadOrientation: 0 - xboxEnableGuest: 0 - xboxEnablePIXSampling: 0 - n3dsDisableStereoscopicView: 0 - n3dsEnableSharedListOpt: 1 - n3dsEnableVSync: 0 - ignoreAlphaClear: 0 - xboxOneResolution: 0 - xboxOneMonoLoggingLevel: 0 - xboxOneLoggingLevel: 1 - xboxOneDisableEsram: 0 - videoMemoryForVertexBuffers: 0 - psp2PowerMode: 0 - psp2AcquireBGM: 1 - wiiUTVResolution: 0 - wiiUGamePadMSAA: 1 - wiiUSupportsNunchuk: 0 - wiiUSupportsClassicController: 0 - wiiUSupportsBalanceBoard: 0 - wiiUSupportsMotionPlus: 0 - wiiUSupportsProController: 0 - wiiUAllowScreenCapture: 1 - wiiUControllerCount: 0 - m_SupportedAspectRatios: - 4:3: 1 - 5:4: 1 - 16:10: 1 - 16:9: 1 - Others: 1 - bundleVersion: 1.0 - preloadedAssets: [] - metroInputSource: 0 - m_HolographicPauseOnTrackingLoss: 1 - xboxOneDisableKinectGpuReservation: 0 - xboxOneEnable7thCore: 0 - vrSettings: - cardboard: - depthFormat: 0 - enableTransitionView: 0 - daydream: - depthFormat: 0 - useSustainedPerformanceMode: 0 - hololens: - depthFormat: 1 - protectGraphicsMemory: 0 - useHDRDisplay: 0 - targetPixelDensity: 0 - resolutionScalingMode: 0 - applicationIdentifier: {} - buildNumber: {} - AndroidBundleVersionCode: 1 - AndroidMinSdkVersion: 16 - AndroidTargetSdkVersion: 0 - AndroidPreferredInstallLocation: 1 - aotOptions: - stripEngineCode: 1 - iPhoneStrippingLevel: 0 - iPhoneScriptCallOptimization: 0 - ForceInternetPermission: 0 - ForceSDCardPermission: 0 - CreateWallpaper: 0 - APKExpansionFiles: 0 - keepLoadedShadersAlive: 0 - StripUnusedMeshComponents: 0 - VertexChannelCompressionMask: - serializedVersion: 2 - m_Bits: 238 - iPhoneSdkVersion: 988 - iOSTargetOSVersionString: - tvOSSdkVersion: 0 - tvOSRequireExtendedGameController: 0 - tvOSTargetOSVersionString: - uIPrerenderedIcon: 0 - uIRequiresPersistentWiFi: 0 - uIRequiresFullScreen: 1 - uIStatusBarHidden: 1 - uIExitOnSuspend: 0 - uIStatusBarStyle: 0 - iPhoneSplashScreen: {fileID: 0} - iPhoneHighResSplashScreen: {fileID: 0} - iPhoneTallHighResSplashScreen: {fileID: 0} - iPhone47inSplashScreen: {fileID: 0} - iPhone55inPortraitSplashScreen: {fileID: 0} - iPhone55inLandscapeSplashScreen: {fileID: 0} - iPadPortraitSplashScreen: {fileID: 0} - iPadHighResPortraitSplashScreen: {fileID: 0} - iPadLandscapeSplashScreen: {fileID: 0} - iPadHighResLandscapeSplashScreen: {fileID: 0} - appleTVSplashScreen: {fileID: 0} - tvOSSmallIconLayers: [] - tvOSLargeIconLayers: [] - tvOSTopShelfImageLayers: [] - tvOSTopShelfImageWideLayers: [] - iOSLaunchScreenType: 0 - iOSLaunchScreenPortrait: {fileID: 0} - iOSLaunchScreenLandscape: {fileID: 0} - iOSLaunchScreenBackgroundColor: - serializedVersion: 2 - rgba: 0 - iOSLaunchScreenFillPct: 100 - iOSLaunchScreenSize: 100 - iOSLaunchScreenCustomXibPath: - iOSLaunchScreeniPadType: 0 - iOSLaunchScreeniPadImage: {fileID: 0} - iOSLaunchScreeniPadBackgroundColor: - serializedVersion: 2 - rgba: 0 - iOSLaunchScreeniPadFillPct: 100 - iOSLaunchScreeniPadSize: 100 - iOSLaunchScreeniPadCustomXibPath: - iOSDeviceRequirements: [] - iOSURLSchemes: [] - iOSBackgroundModes: 0 - iOSMetalForceHardShadows: 0 - metalEditorSupport: 1 - metalAPIValidation: 1 - iOSRenderExtraFrameOnPause: 0 - appleDeveloperTeamID: - iOSManualSigningProvisioningProfileID: - tvOSManualSigningProvisioningProfileID: - appleEnableAutomaticSigning: 0 - AndroidTargetDevice: 0 - AndroidSplashScreenScale: 0 - androidSplashScreen: {fileID: 0} - AndroidKeystoreName: - AndroidKeyaliasName: - AndroidTVCompatibility: 1 - AndroidIsGame: 1 - androidEnableBanner: 1 - m_AndroidBanners: - - width: 320 - height: 180 - banner: {fileID: 0} - androidGamepadSupportLevel: 0 - resolutionDialogBanner: {fileID: 0} - m_BuildTargetIcons: [] - m_BuildTargetBatching: [] - m_BuildTargetGraphicsAPIs: [] - m_BuildTargetVRSettings: [] - openGLRequireES31: 0 - openGLRequireES31AEP: 0 - webPlayerTemplate: APPLICATION:Default - m_TemplateCustomTags: {} - wiiUTitleID: 0005000011000000 - wiiUGroupID: 00010000 - wiiUCommonSaveSize: 4096 - wiiUAccountSaveSize: 2048 - wiiUOlvAccessKey: 0 - wiiUTinCode: 0 - wiiUJoinGameId: 0 - wiiUJoinGameModeMask: 0000000000000000 - wiiUCommonBossSize: 0 - wiiUAccountBossSize: 0 - wiiUAddOnUniqueIDs: [] - wiiUMainThreadStackSize: 3072 - wiiULoaderThreadStackSize: 1024 - wiiUSystemHeapSize: 128 - wiiUTVStartupScreen: {fileID: 0} - wiiUGamePadStartupScreen: {fileID: 0} - wiiUDrcBufferDisabled: 0 - wiiUProfilerLibPath: - playModeTestRunnerEnabled: 1 - actionOnDotNetUnhandledException: 1 - enableInternalProfiler: 0 - logObjCUncaughtExceptions: 1 - enableCrashReportAPI: 0 - cameraUsageDescription: - locationUsageDescription: - microphoneUsageDescription: - switchNetLibKey: - switchSocketMemoryPoolSize: 6144 - switchSocketAllocatorPoolSize: 128 - switchSocketConcurrencyLimit: 14 - switchScreenResolutionBehavior: 2 - switchUseCPUProfiler: 0 - switchApplicationID: 0x01004b9000490000 - switchNSODependencies: - switchTitleNames_0: - switchTitleNames_1: - switchTitleNames_2: - switchTitleNames_3: - switchTitleNames_4: - switchTitleNames_5: - switchTitleNames_6: - switchTitleNames_7: - switchTitleNames_8: - switchTitleNames_9: - switchTitleNames_10: - switchTitleNames_11: - switchPublisherNames_0: - switchPublisherNames_1: - switchPublisherNames_2: - switchPublisherNames_3: - switchPublisherNames_4: - switchPublisherNames_5: - switchPublisherNames_6: - switchPublisherNames_7: - switchPublisherNames_8: - switchPublisherNames_9: - switchPublisherNames_10: - switchPublisherNames_11: - switchIcons_0: {fileID: 0} - switchIcons_1: {fileID: 0} - switchIcons_2: {fileID: 0} - switchIcons_3: {fileID: 0} - switchIcons_4: {fileID: 0} - switchIcons_5: {fileID: 0} - switchIcons_6: {fileID: 0} - switchIcons_7: {fileID: 0} - switchIcons_8: {fileID: 0} - switchIcons_9: {fileID: 0} - switchIcons_10: {fileID: 0} - switchIcons_11: {fileID: 0} - switchSmallIcons_0: {fileID: 0} - switchSmallIcons_1: {fileID: 0} - switchSmallIcons_2: {fileID: 0} - switchSmallIcons_3: {fileID: 0} - switchSmallIcons_4: {fileID: 0} - switchSmallIcons_5: {fileID: 0} - switchSmallIcons_6: {fileID: 0} - switchSmallIcons_7: {fileID: 0} - switchSmallIcons_8: {fileID: 0} - switchSmallIcons_9: {fileID: 0} - switchSmallIcons_10: {fileID: 0} - switchSmallIcons_11: {fileID: 0} - switchManualHTML: - switchAccessibleURLs: - switchLegalInformation: - switchMainThreadStackSize: 1048576 - switchPresenceGroupId: 0x01004b9000490000 - switchLogoHandling: 0 - switchReleaseVersion: 0 - switchDisplayVersion: 1.0.0 - switchStartupUserAccount: 0 - switchTouchScreenUsage: 0 - switchSupportedLanguagesMask: 0 - switchLogoType: 0 - switchApplicationErrorCodeCategory: - switchUserAccountSaveDataSize: 0 - switchUserAccountSaveDataJournalSize: 0 - switchApplicationAttribute: 0 - switchCardSpecSize: 4 - switchCardSpecClock: 25 - switchRatingsMask: 0 - switchRatingsInt_0: 0 - switchRatingsInt_1: 0 - switchRatingsInt_2: 0 - switchRatingsInt_3: 0 - switchRatingsInt_4: 0 - switchRatingsInt_5: 0 - switchRatingsInt_6: 0 - switchRatingsInt_7: 0 - switchRatingsInt_8: 0 - switchRatingsInt_9: 0 - switchRatingsInt_10: 0 - switchRatingsInt_11: 0 - switchLocalCommunicationIds_0: 0x01004b9000490000 - switchLocalCommunicationIds_1: - switchLocalCommunicationIds_2: - switchLocalCommunicationIds_3: - switchLocalCommunicationIds_4: - switchLocalCommunicationIds_5: - switchLocalCommunicationIds_6: - switchLocalCommunicationIds_7: - switchParentalControl: 0 - switchAllowsScreenshot: 1 - switchDataLossConfirmation: 0 - switchSupportedNpadStyles: 3 - switchSocketConfigEnabled: 0 - switchTcpInitialSendBufferSize: 32 - switchTcpInitialReceiveBufferSize: 64 - switchTcpAutoSendBufferSizeMax: 256 - switchTcpAutoReceiveBufferSizeMax: 256 - switchUdpSendBufferSize: 9 - switchUdpReceiveBufferSize: 42 - switchSocketBufferEfficiency: 4 - ps4NPAgeRating: 12 - ps4NPTitleSecret: - ps4NPTrophyPackPath: - ps4ParentalLevel: 11 - ps4ContentID: ED1633-NPXX51362_00-0000000000000000 - ps4Category: 0 - ps4MasterVersion: 01.00 - ps4AppVersion: 01.00 - ps4AppType: 0 - ps4ParamSfxPath: - ps4VideoOutPixelFormat: 0 - ps4VideoOutInitialWidth: 1920 - ps4VideoOutBaseModeInitialWidth: 1920 - ps4VideoOutReprojectionRate: 120 - ps4PronunciationXMLPath: - ps4PronunciationSIGPath: - ps4BackgroundImagePath: - ps4StartupImagePath: - ps4SaveDataImagePath: - ps4SdkOverride: - ps4BGMPath: - ps4ShareFilePath: - ps4ShareOverlayImagePath: - ps4PrivacyGuardImagePath: - ps4NPtitleDatPath: - ps4RemotePlayKeyAssignment: -1 - ps4RemotePlayKeyMappingDir: - ps4PlayTogetherPlayerCount: 0 - ps4EnterButtonAssignment: 1 - ps4ApplicationParam1: 0 - ps4ApplicationParam2: 0 - ps4ApplicationParam3: 0 - ps4ApplicationParam4: 0 - ps4DownloadDataSize: 0 - ps4GarlicHeapSize: 2048 - ps4ProGarlicHeapSize: 2560 - ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ - ps4pnSessions: 1 - ps4pnPresence: 1 - ps4pnFriends: 1 - ps4pnGameCustomData: 1 - playerPrefsSupport: 0 - restrictedAudioUsageRights: 0 - ps4UseResolutionFallback: 0 - ps4ReprojectionSupport: 0 - ps4UseAudio3dBackend: 0 - ps4SocialScreenEnabled: 0 - ps4ScriptOptimizationLevel: 0 - ps4Audio3dVirtualSpeakerCount: 14 - ps4attribCpuUsage: 0 - ps4PatchPkgPath: - ps4PatchLatestPkgPath: - ps4PatchChangeinfoPath: - ps4PatchDayOne: 0 - ps4attribUserManagement: 0 - ps4attribMoveSupport: 0 - ps4attrib3DSupport: 0 - ps4attribShareSupport: 0 - ps4attribExclusiveVR: 0 - ps4disableAutoHideSplash: 0 - ps4videoRecordingFeaturesUsed: 0 - ps4contentSearchFeaturesUsed: 0 - ps4attribEyeToEyeDistanceSettingVR: 0 - ps4IncludedModules: [] - monoEnv: - psp2Splashimage: {fileID: 0} - psp2NPTrophyPackPath: - psp2NPSupportGBMorGJP: 0 - psp2NPAgeRating: 12 - psp2NPTitleDatPath: - psp2NPCommsID: - psp2NPCommunicationsID: - psp2NPCommsPassphrase: - psp2NPCommsSig: - psp2ParamSfxPath: - psp2ManualPath: - psp2LiveAreaGatePath: - psp2LiveAreaBackroundPath: - psp2LiveAreaPath: - psp2LiveAreaTrialPath: - psp2PatchChangeInfoPath: - psp2PatchOriginalPackage: - psp2PackagePassword: F69AzBlax3CF3EDNhm3soLBPh71Yexui - psp2KeystoneFile: - psp2MemoryExpansionMode: 0 - psp2DRMType: 0 - psp2StorageType: 0 - psp2MediaCapacity: 0 - psp2DLCConfigPath: - psp2ThumbnailPath: - psp2BackgroundPath: - psp2SoundPath: - psp2TrophyCommId: - psp2TrophyPackagePath: - psp2PackagedResourcesPath: - psp2SaveDataQuota: 10240 - psp2ParentalLevel: 1 - psp2ShortTitle: Not Set - psp2ContentID: IV0000-ABCD12345_00-0123456789ABCDEF - psp2Category: 0 - psp2MasterVersion: 01.00 - psp2AppVersion: 01.00 - psp2TVBootMode: 0 - psp2EnterButtonAssignment: 2 - psp2TVDisableEmu: 0 - psp2AllowTwitterDialog: 1 - psp2Upgradable: 0 - psp2HealthWarning: 0 - psp2UseLibLocation: 0 - psp2InfoBarOnStartup: 0 - psp2InfoBarColor: 0 - psp2ScriptOptimizationLevel: 0 - psmSplashimage: {fileID: 0} - splashScreenBackgroundSourceLandscape: {fileID: 0} - splashScreenBackgroundSourcePortrait: {fileID: 0} - spritePackerPolicy: - webGLMemorySize: 256 - webGLExceptionSupport: 1 - webGLNameFilesAsHashes: 0 - webGLDataCaching: 0 - webGLDebugSymbols: 0 - webGLEmscriptenArgs: - webGLModulesDirectory: - webGLTemplate: APPLICATION:Default - webGLAnalyzeBuildSize: 0 - webGLUseEmbeddedResources: 0 - webGLUseWasm: 0 - webGLCompressionFormat: 1 - scriptingDefineSymbols: - 1: MYCOMPANY;MYCOMPANY_MYPACKAGE - platformArchitecture: {} - scriptingBackend: {} - incrementalIl2cppBuild: {} - additionalIl2CppArgs: - scriptingRuntimeVersion: 0 - apiCompatibilityLevelPerPlatform: {} - m_RenderingPath: 1 - m_MobileRenderingPath: 1 - metroPackageName: UnityLibrary - metroPackageVersion: - metroCertificatePath: - metroCertificatePassword: - metroCertificateSubject: - metroCertificateIssuer: - metroCertificateNotAfter: 0000000000000000 - metroApplicationDescription: UnityLibrary - wsaImages: {} - metroTileShortName: - metroCommandLineArgsFile: - metroTileShowName: 0 - metroMediumTileShowName: 0 - metroLargeTileShowName: 0 - metroWideTileShowName: 0 - metroDefaultTileSize: 1 - metroTileForegroundText: 2 - metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} - metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, - a: 1} - metroSplashScreenUseBackgroundColor: 0 - platformCapabilities: {} - metroFTAName: - metroFTAFileTypes: [] - metroProtocolName: - metroCompilationOverrides: 1 - tizenProductDescription: - tizenProductURL: - tizenSigningProfileName: - tizenGPSPermissions: 0 - tizenMicrophonePermissions: 0 - tizenDeploymentTarget: - tizenDeploymentTargetType: -1 - tizenMinOSVersion: 1 - n3dsUseExtSaveData: 0 - n3dsCompressStaticMem: 1 - n3dsExtSaveDataNumber: 0x12345 - n3dsStackSize: 131072 - n3dsTargetPlatform: 2 - n3dsRegion: 7 - n3dsMediaSize: 0 - n3dsLogoStyle: 3 - n3dsTitle: GameName - n3dsProductCode: - n3dsApplicationId: 0xFF3FF - stvDeviceAddress: - stvProductDescription: - stvProductAuthor: - stvProductAuthorEmail: - stvProductLink: - stvProductCategory: 0 - XboxOneProductId: - XboxOneUpdateKey: - XboxOneSandboxId: - XboxOneContentId: - XboxOneTitleId: - XboxOneSCId: - XboxOneGameOsOverridePath: - XboxOnePackagingOverridePath: - XboxOneAppManifestOverridePath: - XboxOnePackageEncryption: 0 - XboxOnePackageUpdateGranularity: 2 - XboxOneDescription: - XboxOneLanguage: - - enus - XboxOneCapability: [] - XboxOneGameRating: {} - XboxOneIsContentPackage: 0 - XboxOneEnableGPUVariability: 0 - XboxOneSockets: {} - XboxOneSplashScreen: {fileID: 0} - XboxOneAllowedProductIds: [] - XboxOnePersistentLocalStorageSize: 0 - xboxOneScriptCompiler: 0 - vrEditorSettings: - daydream: - daydreamIconForeground: {fileID: 0} - daydreamIconBackground: {fileID: 0} - cloudServicesEnabled: {} - facebookSdkVersion: 7.9.4 - apiCompatibilityLevel: 2 - cloudProjectId: - projectName: - organizationId: - cloudEnabled: 0 - enableNativePlatformBackendsForNewInputSystem: 0 - disableOldInputManagerSupport: 0 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt deleted file mode 100644 index ca1aa05..0000000 --- a/ProjectSettings/ProjectVersion.txt +++ /dev/null @@ -1 +0,0 @@ -m_EditorVersion: 2017.1.0f3 diff --git a/ProjectSettings/QualitySettings.asset b/ProjectSettings/QualitySettings.asset deleted file mode 100644 index 86c047f..0000000 --- a/ProjectSettings/QualitySettings.asset +++ /dev/null @@ -1,193 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!47 &1 -QualitySettings: - m_ObjectHideFlags: 0 - serializedVersion: 5 - m_CurrentQuality: 5 - m_QualitySettings: - - serializedVersion: 2 - name: Very Low - pixelLightCount: 0 - shadows: 0 - shadowResolution: 0 - shadowProjection: 1 - shadowCascades: 1 - shadowDistance: 15 - shadowNearPlaneOffset: 3 - shadowCascade2Split: 0.33333334 - shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} - shadowmaskMode: 0 - blendWeights: 1 - textureQuality: 1 - anisotropicTextures: 0 - antiAliasing: 0 - softParticles: 0 - softVegetation: 0 - realtimeReflectionProbes: 0 - billboardsFaceCameraPosition: 0 - vSyncCount: 0 - lodBias: 0.3 - maximumLODLevel: 0 - particleRaycastBudget: 4 - asyncUploadTimeSlice: 2 - asyncUploadBufferSize: 4 - resolutionScalingFixedDPIFactor: 1 - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: Low - pixelLightCount: 0 - shadows: 0 - shadowResolution: 0 - shadowProjection: 1 - shadowCascades: 1 - shadowDistance: 20 - shadowNearPlaneOffset: 3 - shadowCascade2Split: 0.33333334 - shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} - shadowmaskMode: 0 - blendWeights: 2 - textureQuality: 0 - anisotropicTextures: 0 - antiAliasing: 0 - softParticles: 0 - softVegetation: 0 - realtimeReflectionProbes: 0 - billboardsFaceCameraPosition: 0 - vSyncCount: 0 - lodBias: 0.4 - maximumLODLevel: 0 - particleRaycastBudget: 16 - asyncUploadTimeSlice: 2 - asyncUploadBufferSize: 4 - resolutionScalingFixedDPIFactor: 1 - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: Medium - pixelLightCount: 1 - shadows: 1 - shadowResolution: 0 - shadowProjection: 1 - shadowCascades: 1 - shadowDistance: 20 - shadowNearPlaneOffset: 3 - shadowCascade2Split: 0.33333334 - shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} - shadowmaskMode: 0 - blendWeights: 2 - textureQuality: 0 - anisotropicTextures: 1 - antiAliasing: 0 - softParticles: 0 - softVegetation: 0 - realtimeReflectionProbes: 0 - billboardsFaceCameraPosition: 0 - vSyncCount: 1 - lodBias: 0.7 - maximumLODLevel: 0 - particleRaycastBudget: 64 - asyncUploadTimeSlice: 2 - asyncUploadBufferSize: 4 - resolutionScalingFixedDPIFactor: 1 - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: High - pixelLightCount: 2 - shadows: 2 - shadowResolution: 1 - shadowProjection: 1 - shadowCascades: 2 - shadowDistance: 40 - shadowNearPlaneOffset: 3 - shadowCascade2Split: 0.33333334 - shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} - shadowmaskMode: 1 - blendWeights: 2 - textureQuality: 0 - anisotropicTextures: 1 - antiAliasing: 0 - softParticles: 0 - softVegetation: 1 - realtimeReflectionProbes: 1 - billboardsFaceCameraPosition: 1 - vSyncCount: 1 - lodBias: 1 - maximumLODLevel: 0 - particleRaycastBudget: 256 - asyncUploadTimeSlice: 2 - asyncUploadBufferSize: 4 - resolutionScalingFixedDPIFactor: 1 - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: Very High - pixelLightCount: 3 - shadows: 2 - shadowResolution: 2 - shadowProjection: 1 - shadowCascades: 2 - shadowDistance: 70 - shadowNearPlaneOffset: 3 - shadowCascade2Split: 0.33333334 - shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} - shadowmaskMode: 1 - blendWeights: 4 - textureQuality: 0 - anisotropicTextures: 2 - antiAliasing: 2 - softParticles: 1 - softVegetation: 1 - realtimeReflectionProbes: 1 - billboardsFaceCameraPosition: 1 - vSyncCount: 1 - lodBias: 1.5 - maximumLODLevel: 0 - particleRaycastBudget: 1024 - asyncUploadTimeSlice: 2 - asyncUploadBufferSize: 4 - resolutionScalingFixedDPIFactor: 1 - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: Ultra - pixelLightCount: 4 - shadows: 2 - shadowResolution: 2 - shadowProjection: 1 - shadowCascades: 4 - shadowDistance: 150 - shadowNearPlaneOffset: 3 - shadowCascade2Split: 0.33333334 - shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} - shadowmaskMode: 1 - blendWeights: 4 - textureQuality: 0 - anisotropicTextures: 2 - antiAliasing: 2 - softParticles: 1 - softVegetation: 1 - realtimeReflectionProbes: 1 - billboardsFaceCameraPosition: 1 - vSyncCount: 1 - lodBias: 2 - maximumLODLevel: 0 - particleRaycastBudget: 4096 - asyncUploadTimeSlice: 2 - asyncUploadBufferSize: 4 - resolutionScalingFixedDPIFactor: 1 - excludedTargetPlatforms: [] - m_PerPlatformDefaultQuality: - Android: 2 - Nintendo 3DS: 5 - Nintendo Switch: 5 - PS4: 5 - PSM: 5 - PSP2: 2 - Samsung TV: 2 - Standalone: 5 - Tizen: 2 - Web: 5 - WebGL: 3 - WiiU: 5 - Windows Store Apps: 5 - XboxOne: 5 - iPhone: 2 - tvOS: 2 diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset deleted file mode 100644 index 1c92a78..0000000 --- a/ProjectSettings/TagManager.asset +++ /dev/null @@ -1,43 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!78 &1 -TagManager: - serializedVersion: 2 - tags: [] - layers: - - Default - - TransparentFX - - Ignore Raycast - - - - Water - - UI - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - m_SortingLayers: - - name: Default - uniqueID: 0 - locked: 0 diff --git a/ProjectSettings/TimeManager.asset b/ProjectSettings/TimeManager.asset deleted file mode 100644 index 558a017..0000000 --- a/ProjectSettings/TimeManager.asset +++ /dev/null @@ -1,9 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!5 &1 -TimeManager: - m_ObjectHideFlags: 0 - Fixed Timestep: 0.02 - Maximum Allowed Timestep: 0.33333334 - m_TimeScale: 1 - Maximum Particle Timestep: 0.03 diff --git a/ProjectSettings/UnityConnectSettings.asset b/ProjectSettings/UnityConnectSettings.asset deleted file mode 100644 index 1cc5485..0000000 --- a/ProjectSettings/UnityConnectSettings.asset +++ /dev/null @@ -1,34 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!310 &1 -UnityConnectSettings: - m_ObjectHideFlags: 0 - m_Enabled: 0 - m_TestMode: 0 - m_TestEventUrl: - m_TestConfigUrl: - m_TestInitMode: 0 - CrashReportingSettings: - m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes - m_Enabled: 0 - m_CaptureEditorExceptions: 1 - UnityPurchasingSettings: - m_Enabled: 0 - m_TestMode: 0 - UnityAnalyticsSettings: - m_Enabled: 0 - m_InitializeOnStartup: 1 - m_TestMode: 0 - m_TestEventUrl: - m_TestConfigUrl: - UnityAdsSettings: - m_Enabled: 0 - m_InitializeOnStartup: 1 - m_TestMode: 0 - m_EnabledPlatforms: 4294967295 - m_IosGameId: - m_AndroidGameId: - m_GameIds: {} - m_GameId: - PerformanceReportingSettings: - m_Enabled: 0 diff --git a/README.md b/README.md deleted file mode 100644 index e1add6a..0000000 --- a/README.md +++ /dev/null @@ -1,98 +0,0 @@ -# Unity Library - -
- -
-
-:tada: Welcome to Unity Library :tada: - -Useful scripts, snippets and shaders here it is gathered for free. - -We have collected most scripts from external sources like Unity Communities (Forums, Answers) and we made it ourselves a little. - -## Getting Started - -This repository contains all kind of utilities for Unity from scripts to shaders. - -You can [browse this repository](#content) and find your desired utility or you can [clone this repository](https://help.github.com/articles/cloning-a-repository/) and browse the files: - -```bash -git clone https://github.com/UnityCommunity/UnityLibrary.git -``` - -and then open the folder in unity or you can find useful stuff by [browsing awesome resources in the below](#resources). - -[:sparkles: Contribution is Welcome](#contribution) - -[:fire: Join the Community](#join-the-community) - -## Content - -- [Assets/Scripts/Docs/](https://github.com/UnityCommunity/UnityLibrary/tree/master/Assets/Scripts/Docs) : "Missing" examples from Unity Docs. -- [Assets/Scripts/](https://github.com/UnityCommunity/UnityLibrary/tree/master/Assets/Scripts) : Complete set of Unity scripts. -- [Assets/Scripts/Editor/](https://github.com/UnityCommunity/UnityLibrary/tree/master/Assets/Scripts/Editor) : Editor related scripts. -- [Assets/Shaders/](https://github.com/UnityCommunity/UnityLibrary/tree/master/Assets/Shaders) : Ready-to-use shaders. -- [ScriptTemplates/](https://github.com/UnityCommunity/UnityLibrary/tree/master/ScriptTemplates) : Contains ready-to-use script templates. -- [External/](https://github.com/UnityCommunity/UnityLibrary/tree/master/External) : External libaries, scripts and utilities that are related to unity. - -## Resources - -Awesome and Useful Unity Resources: - -[:sparkles: Awesome Unity](https://github.com/RyanNielson/awesome-unity) - -[:clipboard: Unity Script Collection](https://github.com/michidk/Unity-Script-Collection) - -[:book: Unity Design Patterns](https://github.com/Naphier/unity-design-patterns) - -[:scroll: GameDev Resources](https://github.com/Kavex/GameDev-Resources) - -[:video_game: Games On GitHub](https://github.com/leereilly/games/) - -[:star: Unity Singleton](https://github.com/UnityCommunity/UnitySingleton) - -## Contribution - -Any contribution to this repository are welcome. - -Also you [join as a member](#join-the-community) to do more stuff such as creating new repositories for more awesome open source works. - -[:closed_book: Read our Contribution Guidelines](https://github.com/UnityCommunity/UnityLibrary/blob/master/CONTRIBUTING.md) to find a way to help. - -## Join the Community - -Send your GitHub id to one of the below ways: - -- [:speech_balloon: Unity Forums](https://forum.unity3d.com/conversations/add?to=mgear) *Private message -- Signup using [Google Forms](https://goo.gl/forms/DFspn3ByJBoLWEth2) *Can take few days until processed -- [:e-mail: hasanbayat1393@gmail.com](mailto:hasanbayat1393@gmail.com) - -Our communities: - -- [See](https://discordapp.com/channels/337579253866692608/337579253866692608) | [Join](https://discord.gg/cXT97hU) our Discord Channel (Main) -- [See](https://unitylibrary.slack.com/) | [Join](https://join.slack.com/t/unitylibrary/shared_invite/MjE1MDA2NzExNDEwLTE1MDA0OTE5NzktOGJmYTI0ZDlkNA) our Slack Channel -- [See](https://gitter.im/UnityCommunity/Lobby) | [Join](https://gitter.im/UnityCommunity/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link) our Gitter Channel -- [See](https://trello.com/b/1sOcvQzd) | [Join](https://trello.com/invite/unitycommunity/239a9f3cdaf3c54cf7efc2540c304279) our Trello Development Board - -## Improvements/Ideas/Feedback - -Feel free to [:postbox: Post your ideas/comments/improvements/recommendations](https://github.com/UnityCommunity/UnityLibrary/issues) - -## Credits - -- [UnityCoder (mika)](https://github.com/unitycoder) (Owner) -- [EmpireWorld (Hasan Bayat)](https://github.com/EmpireWorld) (Owner) -- [Lootheo (Manuel Otheo)](https://github.com/Lootheo) (Member) -- [igorrafael (Igor Rafael de Sousa)](https://github.com/igorrafael) (Member) -- [nrlnd](https://github.com/nrlnd) (Member) -- [Sacristan (Ģirts Ķesteris)](https://github.com/Sacristan) (Member) -- [Agarcialeon (Álvaro García León)](https://github.com/agarcialeon) (Member) -- [:sparkles: Join the team](#join-the-community) - -[:mag: Check out Unity Community People](https://github.com/orgs/UnityCommunity/people) - -## License - -[MIT](https://github.com/UnityCommunity/UnityLibrary/blob/master/LICENSE.md) @ [Unity Community](https://github.com/UnityCommunity/) - -Made with :heart: by [Unity Community](https://github.com/UnityCommunity/) diff --git a/ScriptTemplates/81a-C# Editor Script-NewEditorScript.cs.txt b/ScriptTemplates/81a-C# Editor Script-NewEditorScript.cs.txt deleted file mode 100644 index 694024f..0000000 --- a/ScriptTemplates/81a-C# Editor Script-NewEditorScript.cs.txt +++ /dev/null @@ -1,19 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEditor; - -public class #SCRIPTNAME# : EditorWindow { - - // Use this for initialization - [MenuItem("Window/#SCRIPTNAME#")] - private static void Initialize () { - #NOTRIM# - } - - // Draw the Window GUI - void OnGUI () { - #NOTRIM# - } - -} diff --git a/ScriptTemplates/81b-C# Custom Editor Script-NewCustomEditorScript.cs.txt b/ScriptTemplates/81b-C# Custom Editor Script-NewCustomEditorScript.cs.txt deleted file mode 100644 index 71aee88..0000000 --- a/ScriptTemplates/81b-C# Custom Editor Script-NewCustomEditorScript.cs.txt +++ /dev/null @@ -1,20 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEditor; - -[CustomEditor(typeof (#SCRIPTNAME#))] -[CanEditMultipleObjects] -public class #SCRIPTNAME# : Editor { - - // Use this for initialization - void OnEnable () { - - } - - // Use this for drawing the GUI - public override void OnInspectorGUI () { - - } - -} diff --git a/ScriptTemplates/81c-C# Interface Script-NewInterfaceScript.cs.txt b/ScriptTemplates/81c-C# Interface Script-NewInterfaceScript.cs.txt deleted file mode 100644 index 47e8cbc..0000000 --- a/ScriptTemplates/81c-C# Interface Script-NewInterfaceScript.cs.txt +++ /dev/null @@ -1,9 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public interface #SCRIPTNAME# { - - void Sample (); - -} diff --git a/ScriptTemplates/81d-C# Property Drawer Script-NewPropertyDrawerScript.cs.txt b/ScriptTemplates/81d-C# Property Drawer Script-NewPropertyDrawerScript.cs.txt deleted file mode 100644 index 8877feb..0000000 --- a/ScriptTemplates/81d-C# Property Drawer Script-NewPropertyDrawerScript.cs.txt +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEditor; - -[CustomPropertyDrawer (typeof (#SCRIPTNAME#))] -public class #SCRIPTNAME# : PropertyDrawer { - - // Use this for drawing the GUI - void OnGUI (Rect position, SerializedProperty property, GUIContent label) { - - } - -} diff --git a/ScriptTemplates/82a-Javascript Editor Window-NewEditorScript.js.txt b/ScriptTemplates/82a-Javascript Editor Window-NewEditorScript.js.txt deleted file mode 100644 index a0fa1bf..0000000 --- a/ScriptTemplates/82a-Javascript Editor Window-NewEditorScript.js.txt +++ /dev/null @@ -1,14 +0,0 @@ -#pragma strict - -class #SCRIPTNAME# extends EditorWindow { - - @MenuItem ("Window/#SCRIPTNAME#") - static function Initialize () { - EditorWindow.GetWindow (#SCRIPTNAME#); - } - - function OnGUI () { - - } - -} diff --git a/ScriptTemplates/82b-Javascript Custom Editor-NewCustomEditorScript.js.txt b/ScriptTemplates/82b-Javascript Custom Editor-NewCustomEditorScript.js.txt deleted file mode 100644 index e7ec9bb..0000000 --- a/ScriptTemplates/82b-Javascript Custom Editor-NewCustomEditorScript.js.txt +++ /dev/null @@ -1,15 +0,0 @@ -#pragma strict - -@CustomEditor (#SCRIPTNAME#) -@CanEditMultipleObjects -class #SCRIPTNAME# extends Editor { - - function OnEnable () { - - } - - function OnInspectorGUI () { - - } - -} diff --git a/ScriptTemplates/82c-Javascript Property Drawer-NewPropertyDrawerScript.js.txt b/ScriptTemplates/82c-Javascript Property Drawer-NewPropertyDrawerScript.js.txt deleted file mode 100644 index 1a79b09..0000000 --- a/ScriptTemplates/82c-Javascript Property Drawer-NewPropertyDrawerScript.js.txt +++ /dev/null @@ -1,10 +0,0 @@ -#pragma strict - -@CustomPropertyDrawer (#SCRIPTNAME#) -class #SCRIPTNAME# extends PropertyDrawer { - - function OnGUI () { - - } - -} diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..c70255b --- /dev/null +++ b/_config.yml @@ -0,0 +1,33 @@ +# Theme +remote_theme: pmarsceill/just-the-docs + +# Color scheme: light or dark +color_scheme: light + +# Enable or disable the site search +# Supports true (default) or false +search_enabled: true + +aux_links: + "Awesome Unity Community": + - "https://unitycommunity.github.io/AwesomeUnityCommunity/#/" + "Blog": + - "https://unitycommunity.github.io/blog/" + "Wiki": + - "https://unitycommunity.github.io/wiki/" + +# Footer content (appears at the bottom of every page's main content) +# Note: The footer_content option is deprecated and will be removed in a future major release. Please use `_includes/footer_custom.html` for more robust markup / liquid-based content. +footer_content: "Copyright © 2021 Unity Community. Distributed by an MIT license." + +# Footer last edited timestamp +last_edit_timestamp: true # show or hide edit time - page must have `last_modified_date` defined in the frontmatter +last_edit_time_format: "%b %e %Y at %I:%M %p" # uses ruby's time format: https://ruby-doc.org/stdlib-2.7.0/libdoc/time/rdoc/Time.html + +# Footer "Edit this page on GitHub" link text +gh_edit_link: true # show or hide edit this page link +gh_edit_link_text: "Edit this page on GitHub." +gh_edit_repository: "https://github.com/UnityCommunity/UnityLibrary/" # the github URL for your repo +gh_edit_branch: "gh-pages" # the branch that your docs is served from +# gh_edit_source: docs # the source that your files originate from +gh_edit_view_mode: "tree" # "tree" or "edit" if you want the user to jump into the editor immediately diff --git a/index.md b/index.md new file mode 100644 index 0000000..8922df5 --- /dev/null +++ b/index.md @@ -0,0 +1,14 @@ +--- +layout: default +title: Home +nav_order: 1 +--- + +# Welcome to Unity Library! + +Useful scripts, snippets and shaders here it is gathered for free. + +We have collected most scripts from external sources like Unity Communities (Forums, Answers) and we made it ourselves a little. + +[Get Started](https://unitycommunity.github.io/UnityLibrary/Getting-Started/Readme.html){: .btn .btn-green } +[See contents](https://unitycommunity.github.io/UnityLibrary/Contents/contents.html){: .btn } diff --git a/resources.md b/resources.md new file mode 100644 index 0000000..49190e0 --- /dev/null +++ b/resources.md @@ -0,0 +1,16 @@ +--- +layout: default +title: Resources +nav_order: 4 +--- + +# Resources + +Here you have an awesome and useful Unity resources: + +- [Awesome Unity](https://github.com/RyanNielson/awesome-unity) +- [Unity Script Collection](https://github.com/michidk/Unity-Script-Collection) +- [Unity Design Patterns](https://github.com/Naphier/unity-design-patterns) +- [GameDev Resources](https://github.com/Kavex/GameDev-Resources) +- [Games On GitHub](https://github.com/leereilly/games/) +- [Unity Singleton](https://github.com/UnityCommunity/UnitySingleton)