├── .gitignore ├── Assets ├── CSVReader.cs ├── CSVReader.cs.meta ├── DataBall.prefab ├── DataBall.prefab.meta ├── DataPlotter.cs ├── DataPlotter.cs.meta ├── Resources.meta ├── Resources │ ├── iris.csv │ └── iris.csv.meta ├── Scatterplot_Scene.unity ├── Scatterplot_Scene.unity.meta ├── Standard Assets.meta └── Standard Assets │ ├── Characters.meta │ ├── Characters │ ├── FirstPersonCharacter.meta │ └── FirstPersonCharacter │ │ ├── Audio.meta │ │ ├── Audio │ │ ├── Footstep01.wav │ │ ├── Footstep01.wav.meta │ │ ├── Footstep02.wav │ │ ├── Footstep02.wav.meta │ │ ├── Footstep03.wav │ │ ├── Footstep03.wav.meta │ │ ├── Footstep04.wav │ │ ├── Footstep04.wav.meta │ │ ├── Jump.wav │ │ ├── Jump.wav.meta │ │ ├── Land.wav │ │ └── Land.wav.meta │ │ ├── FirstPersonCharacterGuidelines.txt │ │ ├── FirstPersonCharacterGuidelines.txt.meta │ │ ├── Prefabs.meta │ │ ├── Prefabs │ │ ├── FPSController.prefab │ │ ├── FPSController.prefab.meta │ │ ├── RigidBodyFPSController.prefab │ │ └── RigidBodyFPSController.prefab.meta │ │ ├── Scripts.meta │ │ └── Scripts │ │ ├── FirstPersonController.cs │ │ ├── FirstPersonController.cs.meta │ │ ├── HeadBob.cs │ │ ├── HeadBob.cs.meta │ │ ├── MouseLook.cs │ │ ├── MouseLook.cs.meta │ │ ├── RigidbodyFirstPersonController.cs │ │ └── RigidbodyFirstPersonController.cs.meta │ ├── CrossPlatformInput.meta │ ├── CrossPlatformInput │ ├── CrossPlatformInputGuidelines.txt │ ├── CrossPlatformInputGuidelines.txt.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── AxisTouchButton.cs │ │ ├── AxisTouchButton.cs.meta │ │ ├── ButtonHandler.cs │ │ ├── ButtonHandler.cs.meta │ │ ├── CrossPlatformInputManager.cs │ │ ├── CrossPlatformInputManager.cs.meta │ │ ├── InputAxisScrollbar.cs │ │ ├── InputAxisScrollbar.cs.meta │ │ ├── Joystick.cs │ │ ├── Joystick.cs.meta │ │ ├── MobileControlRig.cs │ │ ├── MobileControlRig.cs.meta │ │ ├── PlatformSpecific.meta │ │ ├── PlatformSpecific │ │ ├── MobileInput.cs │ │ ├── MobileInput.cs.meta │ │ ├── StandaloneInput.cs │ │ └── StandaloneInput.cs.meta │ │ ├── TiltInput.cs │ │ ├── TiltInput.cs.meta │ │ ├── TouchPad.cs │ │ ├── TouchPad.cs.meta │ │ ├── VirtualInput.cs │ │ └── VirtualInput.cs.meta │ ├── Prototyping.meta │ ├── Prototyping │ ├── Materials.meta │ ├── Materials │ │ ├── NavyGrid.mat │ │ ├── NavyGrid.mat.meta │ │ ├── NavySmooth.mat │ │ ├── NavySmooth.mat.meta │ │ ├── PinkGrid.mat │ │ ├── PinkGrid.mat.meta │ │ ├── PinkSmooth.mat │ │ ├── PinkSmooth.mat.meta │ │ ├── YellowGrid.mat │ │ ├── YellowGrid.mat.meta │ │ ├── YellowSmooth.mat │ │ └── YellowSmooth.mat.meta │ ├── Textures.meta │ └── Textures │ │ ├── GridEmissive.png │ │ ├── GridEmissive.png.meta │ │ ├── SwatchMauveAlbedo.png │ │ ├── SwatchMauveAlbedo.png.meta │ │ ├── SwatchNavyAlbedo.png │ │ ├── SwatchNavyAlbedo.png.meta │ │ ├── SwatchNavyDarkAlbedo.png │ │ ├── SwatchNavyDarkAlbedo.png.meta │ │ ├── SwatchOrangeAlbedo.png │ │ ├── SwatchOrangeAlbedo.png.meta │ │ ├── SwatchPinkDAlbedo.png │ │ ├── SwatchPinkDAlbedo.png.meta │ │ ├── SwatchTealAlbedo.png │ │ ├── SwatchTealAlbedo.png.meta │ │ ├── SwatchTurquoiseAlbedo.png │ │ ├── SwatchTurquoiseAlbedo.png.meta │ │ ├── SwatchWhiteAlbedo.png │ │ ├── SwatchWhiteAlbedo.png.meta │ │ ├── SwatchYellowAlbedo.png │ │ └── SwatchYellowAlbedo.png.meta │ ├── Utility.meta │ └── Utility │ ├── ActivateTrigger.cs │ ├── ActivateTrigger.cs.meta │ ├── AutoMobileShaderSwitch.cs │ ├── AutoMobileShaderSwitch.cs.meta │ ├── AutoMoveAndRotate.cs │ ├── AutoMoveAndRotate.cs.meta │ ├── CameraRefocus.cs │ ├── CameraRefocus.cs.meta │ ├── CurveControlledBob.cs │ ├── CurveControlledBob.cs.meta │ ├── DragRigidbody.cs │ ├── DragRigidbody.cs.meta │ ├── DynamicShadowSettings.cs │ ├── DynamicShadowSettings.cs.meta │ ├── EventSystemChecker.cs │ ├── EventSystemChecker.cs.meta │ ├── FOVKick.cs │ ├── FOVKick.cs.meta │ ├── FPSCounter.cs │ ├── FPSCounter.cs.meta │ ├── FollowTarget.cs │ ├── FollowTarget.cs.meta │ ├── ForcedReset.cs │ ├── ForcedReset.cs.meta │ ├── LerpControlledBob.cs │ ├── LerpControlledBob.cs.meta │ ├── ObjectResetter.cs │ ├── ObjectResetter.cs.meta │ ├── ParticleSystemDestroyer.cs │ ├── ParticleSystemDestroyer.cs.meta │ ├── PlatformSpecificContent.cs │ ├── PlatformSpecificContent.cs.meta │ ├── Prefabs.meta │ ├── Prefabs │ ├── FramerateCounter.prefab │ └── FramerateCounter.prefab.meta │ ├── SimpleActivatorMenu.cs │ ├── SimpleActivatorMenu.cs.meta │ ├── SimpleMouseRotator.cs │ ├── SimpleMouseRotator.cs.meta │ ├── SmoothFollow.cs │ ├── SmoothFollow.cs.meta │ ├── TimedObjectActivator.cs │ ├── TimedObjectActivator.cs.meta │ ├── TimedObjectDestructor.cs │ ├── TimedObjectDestructor.cs.meta │ ├── WaypointCircuit.cs │ ├── WaypointCircuit.cs.meta │ ├── WaypointProgressTracker.cs │ └── WaypointProgressTracker.cs.meta ├── LICENSE ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityAdsSettings.asset.meta └── UnityConnectSettings.asset └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Bb]uild/ 5 | /[Bb]uilds/ 6 | /Assets/AssetStoreTools* 7 | 8 | # Autogenerated VS/MD solution and project files 9 | ExportedObj/ 10 | *.csproj 11 | *.unityproj 12 | *.sln 13 | *.suo 14 | *.tmp 15 | *.user 16 | *.userprefs 17 | *.pidb 18 | *.booproj 19 | *.svd 20 | 21 | 22 | # Unity3D generated meta files 23 | *.pidb.meta 24 | 25 | # Unity3D Generated File On Crash Reports 26 | sysinfo.txt 27 | 28 | # Builds 29 | *.apk 30 | *.unitypackage 31 | -------------------------------------------------------------------------------- /Assets/CSVReader.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using System.Text.RegularExpressions; 6 | 7 | // Taken from here: https://bravenewmethod.com/2014/09/13/lightweight-csv-reader-for-unity/ 8 | // Comments 9 | 10 | // Code parses a CSV, converting values into ints or floats if able, and returning a List>. 11 | 12 | public class CSVReader 13 | { 14 | static string SPLIT_RE = @",(?=(?:[^""]*""[^""]*"")*(?![^""]*""))"; // Define delimiters, regular expression craziness 15 | static string LINE_SPLIT_RE = @"\r\n|\n\r|\n|\r"; // Define line delimiters, regular experession craziness 16 | static char[] TRIM_CHARS = { '\"' }; 17 | 18 | public static List> Read(string file) //Declare method 19 | { 20 | //Debug.Log("CSVReader is reading " + file); // Print filename, make sure parsed correctly 21 | 22 | var list = new List>(); //declare dictionary list 23 | 24 | TextAsset data = Resources.Load(file) as TextAsset; //Loads the TextAsset named in the file argument of the function 25 | 26 | // Debug.Log("Data loaded:" + data); // Print raw data, make sure parsed correctly 27 | 28 | var lines = Regex.Split(data.text, LINE_SPLIT_RE); // Split data.text into lines using LINE_SPLIT_RE characters 29 | 30 | if (lines.Length <= 1) return list; //Check that there is more than one line 31 | 32 | var header = Regex.Split(lines[0], SPLIT_RE); //Split header (element 0) 33 | 34 | // Loops through lines 35 | for (var i = 1; i < lines.Length; i++) 36 | { 37 | 38 | var values = Regex.Split(lines[i], SPLIT_RE); //Split lines according to SPLIT_RE, store in var (usually string array) 39 | if (values.Length == 0 || values[0] == "") continue; // Skip to end of loop (continue) if value is 0 length OR first value is empty 40 | 41 | var entry = new Dictionary(); // Creates dictionary object 42 | 43 | // Loops through every value 44 | for (var j = 0; j < header.Length && j < values.Length; j++) 45 | { 46 | string value = values[j]; // Set local variable value 47 | value = value.TrimStart(TRIM_CHARS).TrimEnd(TRIM_CHARS).Replace("\\", ""); // Trim characters 48 | object finalvalue = value; //set final value 49 | 50 | int n; // Create int, to hold value if int 51 | 52 | float f; // Create float, to hold value if float 53 | 54 | // If-else to attempt to parse value into int or float 55 | if (int.TryParse(value, out n)) 56 | { 57 | finalvalue = n; 58 | } 59 | else if (float.TryParse(value, out f)) 60 | { 61 | finalvalue = f; 62 | } 63 | entry[header[j]] = finalvalue; 64 | } 65 | list.Add(entry); // Add Dictionary ("entry" variable) to list 66 | } 67 | return list; //Return list 68 | } 69 | } -------------------------------------------------------------------------------- /Assets/CSVReader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 375534aa6a7c30143bc196f5c37c24d7 3 | timeCreated: 1490656994 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataBall.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1046608385834278} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1046608385834278 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 5 20 | m_Component: 21 | - component: {fileID: 4997608020000202} 22 | - component: {fileID: 33049295044256454} 23 | - component: {fileID: 135825247761695524} 24 | - component: {fileID: 23656542154375220} 25 | m_Layer: 0 26 | m_Name: DataBall 27 | m_TagString: Untagged 28 | m_Icon: {fileID: 0} 29 | m_NavMeshLayer: 0 30 | m_StaticEditorFlags: 0 31 | m_IsActive: 1 32 | --- !u!4 &4997608020000202 33 | Transform: 34 | m_ObjectHideFlags: 1 35 | m_PrefabParentObject: {fileID: 0} 36 | m_PrefabInternal: {fileID: 100100000} 37 | m_GameObject: {fileID: 1046608385834278} 38 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 39 | m_LocalPosition: {x: 0, y: 0, z: 0} 40 | m_LocalScale: {x: 0.25, y: 0.25, z: 0.25} 41 | m_Children: [] 42 | m_Father: {fileID: 0} 43 | m_RootOrder: 0 44 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 45 | --- !u!23 &23656542154375220 46 | MeshRenderer: 47 | m_ObjectHideFlags: 1 48 | m_PrefabParentObject: {fileID: 0} 49 | m_PrefabInternal: {fileID: 100100000} 50 | m_GameObject: {fileID: 1046608385834278} 51 | m_Enabled: 1 52 | m_CastShadows: 1 53 | m_ReceiveShadows: 1 54 | m_MotionVectors: 1 55 | m_LightProbeUsage: 1 56 | m_ReflectionProbeUsage: 1 57 | m_Materials: 58 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 59 | m_StaticBatchInfo: 60 | firstSubMesh: 0 61 | subMeshCount: 0 62 | m_StaticBatchRoot: {fileID: 0} 63 | m_ProbeAnchor: {fileID: 0} 64 | m_LightProbeVolumeOverride: {fileID: 0} 65 | m_ScaleInLightmap: 1 66 | m_PreserveUVs: 1 67 | m_IgnoreNormalsForChartDetection: 0 68 | m_ImportantGI: 0 69 | m_SelectedEditorRenderState: 3 70 | m_MinimumChartSize: 4 71 | m_AutoUVMaxDistance: 0.5 72 | m_AutoUVMaxAngle: 89 73 | m_LightmapParameters: {fileID: 0} 74 | m_SortingLayerID: 0 75 | m_SortingOrder: 0 76 | --- !u!33 &33049295044256454 77 | MeshFilter: 78 | m_ObjectHideFlags: 1 79 | m_PrefabParentObject: {fileID: 0} 80 | m_PrefabInternal: {fileID: 100100000} 81 | m_GameObject: {fileID: 1046608385834278} 82 | m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} 83 | --- !u!135 &135825247761695524 84 | SphereCollider: 85 | m_ObjectHideFlags: 1 86 | m_PrefabParentObject: {fileID: 0} 87 | m_PrefabInternal: {fileID: 100100000} 88 | m_GameObject: {fileID: 1046608385834278} 89 | m_Material: {fileID: 0} 90 | m_IsTrigger: 0 91 | m_Enabled: 1 92 | serializedVersion: 2 93 | m_Radius: 0.5 94 | m_Center: {x: 0, y: 0, z: 0} 95 | -------------------------------------------------------------------------------- /Assets/DataBall.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 38e51ff6a53e36b4694188da7c8f41c2 3 | timeCreated: 1490646869 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DataPlotter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using System; 5 | 6 | public class DataPlotter : MonoBehaviour { 7 | 8 | // Name of the input file, no extension 9 | public string inputfile; 10 | 11 | // List for holding data from CSV reader 12 | private List> pointList; 13 | 14 | // Indices for columns to be assigned 15 | public int columnX = 0; 16 | public int columnY = 1; 17 | public int columnZ = 2; 18 | 19 | // Full column names 20 | public string xName; 21 | public string yName; 22 | public string zName; 23 | 24 | public float plotScale = 10; 25 | 26 | // The prefab for the data points that will be instantiated 27 | public GameObject PointPrefab; 28 | 29 | // Object which will contain instantiated prefabs in hiearchy 30 | public GameObject PointHolder; 31 | 32 | // Use this for initialization 33 | void Start () { 34 | 35 | // Set pointlist to results of function Reader with argument inputfile 36 | pointList = CSVReader.Read(inputfile); 37 | 38 | //Log to console 39 | Debug.Log(pointList); 40 | 41 | // Declare list of strings, fill with keys (column names) 42 | List columnList = new List(pointList[1].Keys); 43 | 44 | // Print number of keys (using .count) 45 | Debug.Log("There are " + columnList.Count + " columns in the CSV"); 46 | 47 | foreach (string key in columnList) 48 | Debug.Log("Column name is " + key); 49 | 50 | // Assign column name from columnList to Name variables 51 | xName = columnList[columnX]; 52 | yName = columnList[columnY]; 53 | zName = columnList[columnZ]; 54 | 55 | // Get maxes of each axis 56 | float xMax = FindMaxValue(xName); 57 | float yMax = FindMaxValue(yName); 58 | float zMax = FindMaxValue(zName); 59 | 60 | // Get minimums of each axis 61 | float xMin = FindMinValue(xName); 62 | float yMin = FindMinValue(yName); 63 | float zMin = FindMinValue(zName); 64 | 65 | 66 | //Loop through Pointlist 67 | for (var i = 0; i < pointList.Count; i++) 68 | { 69 | // Get value in poinList at ith "row", in "column" Name, normalize 70 | float x = 71 | (System.Convert.ToSingle(pointList[i][xName]) - xMin) 72 | / (xMax - xMin); 73 | 74 | float y = 75 | (System.Convert.ToSingle(pointList[i][yName]) - yMin) 76 | / (yMax - yMin); 77 | 78 | float z = 79 | (System.Convert.ToSingle(pointList[i][zName]) - zMin) 80 | / (zMax - zMin); 81 | 82 | 83 | // Instantiate as gameobject variable so that it can be manipulated within loop 84 | GameObject dataPoint = Instantiate( 85 | PointPrefab, 86 | new Vector3(x, y, z)* plotScale, 87 | Quaternion.identity); 88 | 89 | // Make child of PointHolder object, to keep points within container in hiearchy 90 | dataPoint.transform.parent = PointHolder.transform; 91 | 92 | // Assigns original values to dataPointName 93 | string dataPointName = 94 | pointList[i][xName] + " " 95 | + pointList[i][yName] + " " 96 | + pointList[i][zName]; 97 | 98 | // Assigns name to the prefab 99 | dataPoint.transform.name = dataPointName; 100 | 101 | // Gets material color and sets it to a new RGB color we define 102 | dataPoint.GetComponent().material.color = 103 | new Color(x,y,z, 1.0f); 104 | } 105 | 106 | } 107 | 108 | private float FindMaxValue(string columnName) 109 | { 110 | //set initial value to first value 111 | float maxValue = Convert.ToSingle(pointList[0][columnName]); 112 | 113 | //Loop through Dictionary, overwrite existing maxValue if new value is larger 114 | for (var i = 0; i < pointList.Count; i++) 115 | { 116 | if (maxValue < Convert.ToSingle(pointList[i][columnName])) 117 | maxValue = Convert.ToSingle(pointList[i][columnName]); 118 | } 119 | 120 | //Spit out the max value 121 | return maxValue; 122 | } 123 | 124 | private float FindMinValue(string columnName) 125 | { 126 | 127 | float minValue = Convert.ToSingle(pointList[0][columnName]); 128 | 129 | //Loop through Dictionary, overwrite existing minValue if new value is smaller 130 | for (var i = 0; i < pointList.Count; i++) 131 | { 132 | if (Convert.ToSingle(pointList[i][columnName]) < minValue) 133 | minValue = Convert.ToSingle(pointList[i][columnName]); 134 | } 135 | 136 | return minValue; 137 | } 138 | 139 | } 140 | -------------------------------------------------------------------------------- /Assets/DataPlotter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3735dc8af6895994c9ad9e8a46cb87d5 3 | timeCreated: 1490662427 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a13e49cbec7cc04cbbb881493270a52 3 | folderAsset: yes 4 | timeCreated: 1490660213 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/iris.csv: -------------------------------------------------------------------------------- 1 | ,Sepal.Length,Sepal.Width,Petal.Length,Petal.Width,Species 2 | 1,5.1,3.5,1.4,0.2,setosa 3 | 2,4.9,3,1.4,0.2,setosa 4 | 3,4.7,3.2,1.3,0.2,setosa 5 | 4,4.6,3.1,1.5,0.2,setosa 6 | 5,5,3.6,1.4,0.2,setosa 7 | 6,5.4,3.9,1.7,0.4,setosa 8 | 7,4.6,3.4,1.4,0.3,setosa 9 | 8,5,3.4,1.5,0.2,setosa 10 | 9,4.4,2.9,1.4,0.2,setosa 11 | 10,4.9,3.1,1.5,0.1,setosa 12 | 11,5.4,3.7,1.5,0.2,setosa 13 | 12,4.8,3.4,1.6,0.2,setosa 14 | 13,4.8,3,1.4,0.1,setosa 15 | 14,4.3,3,1.1,0.1,setosa 16 | 15,5.8,4,1.2,0.2,setosa 17 | 16,5.7,4.4,1.5,0.4,setosa 18 | 17,5.4,3.9,1.3,0.4,setosa 19 | 18,5.1,3.5,1.4,0.3,setosa 20 | 19,5.7,3.8,1.7,0.3,setosa 21 | 20,5.1,3.8,1.5,0.3,setosa 22 | 21,5.4,3.4,1.7,0.2,setosa 23 | 22,5.1,3.7,1.5,0.4,setosa 24 | 23,4.6,3.6,1,0.2,setosa 25 | 24,5.1,3.3,1.7,0.5,setosa 26 | 25,4.8,3.4,1.9,0.2,setosa 27 | 26,5,3,1.6,0.2,setosa 28 | 27,5,3.4,1.6,0.4,setosa 29 | 28,5.2,3.5,1.5,0.2,setosa 30 | 29,5.2,3.4,1.4,0.2,setosa 31 | 30,4.7,3.2,1.6,0.2,setosa 32 | 31,4.8,3.1,1.6,0.2,setosa 33 | 32,5.4,3.4,1.5,0.4,setosa 34 | 33,5.2,4.1,1.5,0.1,setosa 35 | 34,5.5,4.2,1.4,0.2,setosa 36 | 35,4.9,3.1,1.5,0.2,setosa 37 | 36,5,3.2,1.2,0.2,setosa 38 | 37,5.5,3.5,1.3,0.2,setosa 39 | 38,4.9,3.6,1.4,0.1,setosa 40 | 39,4.4,3,1.3,0.2,setosa 41 | 40,5.1,3.4,1.5,0.2,setosa 42 | 41,5,3.5,1.3,0.3,setosa 43 | 42,4.5,2.3,1.3,0.3,setosa 44 | 43,4.4,3.2,1.3,0.2,setosa 45 | 44,5,3.5,1.6,0.6,setosa 46 | 45,5.1,3.8,1.9,0.4,setosa 47 | 46,4.8,3,1.4,0.3,setosa 48 | 47,5.1,3.8,1.6,0.2,setosa 49 | 48,4.6,3.2,1.4,0.2,setosa 50 | 49,5.3,3.7,1.5,0.2,setosa 51 | 50,5,3.3,1.4,0.2,setosa 52 | 51,7,3.2,4.7,1.4,versicolor 53 | 52,6.4,3.2,4.5,1.5,versicolor 54 | 53,6.9,3.1,4.9,1.5,versicolor 55 | 54,5.5,2.3,4,1.3,versicolor 56 | 55,6.5,2.8,4.6,1.5,versicolor 57 | 56,5.7,2.8,4.5,1.3,versicolor 58 | 57,6.3,3.3,4.7,1.6,versicolor 59 | 58,4.9,2.4,3.3,1,versicolor 60 | 59,6.6,2.9,4.6,1.3,versicolor 61 | 60,5.2,2.7,3.9,1.4,versicolor 62 | 61,5,2,3.5,1,versicolor 63 | 62,5.9,3,4.2,1.5,versicolor 64 | 63,6,2.2,4,1,versicolor 65 | 64,6.1,2.9,4.7,1.4,versicolor 66 | 65,5.6,2.9,3.6,1.3,versicolor 67 | 66,6.7,3.1,4.4,1.4,versicolor 68 | 67,5.6,3,4.5,1.5,versicolor 69 | 68,5.8,2.7,4.1,1,versicolor 70 | 69,6.2,2.2,4.5,1.5,versicolor 71 | 70,5.6,2.5,3.9,1.1,versicolor 72 | 71,5.9,3.2,4.8,1.8,versicolor 73 | 72,6.1,2.8,4,1.3,versicolor 74 | 73,6.3,2.5,4.9,1.5,versicolor 75 | 74,6.1,2.8,4.7,1.2,versicolor 76 | 75,6.4,2.9,4.3,1.3,versicolor 77 | 76,6.6,3,4.4,1.4,versicolor 78 | 77,6.8,2.8,4.8,1.4,versicolor 79 | 78,6.7,3,5,1.7,versicolor 80 | 79,6,2.9,4.5,1.5,versicolor 81 | 80,5.7,2.6,3.5,1,versicolor 82 | 81,5.5,2.4,3.8,1.1,versicolor 83 | 82,5.5,2.4,3.7,1,versicolor 84 | 83,5.8,2.7,3.9,1.2,versicolor 85 | 84,6,2.7,5.1,1.6,versicolor 86 | 85,5.4,3,4.5,1.5,versicolor 87 | 86,6,3.4,4.5,1.6,versicolor 88 | 87,6.7,3.1,4.7,1.5,versicolor 89 | 88,6.3,2.3,4.4,1.3,versicolor 90 | 89,5.6,3,4.1,1.3,versicolor 91 | 90,5.5,2.5,4,1.3,versicolor 92 | 91,5.5,2.6,4.4,1.2,versicolor 93 | 92,6.1,3,4.6,1.4,versicolor 94 | 93,5.8,2.6,4,1.2,versicolor 95 | 94,5,2.3,3.3,1,versicolor 96 | 95,5.6,2.7,4.2,1.3,versicolor 97 | 96,5.7,3,4.2,1.2,versicolor 98 | 97,5.7,2.9,4.2,1.3,versicolor 99 | 98,6.2,2.9,4.3,1.3,versicolor 100 | 99,5.1,2.5,3,1.1,versicolor 101 | 100,5.7,2.8,4.1,1.3,versicolor 102 | 101,6.3,3.3,6,2.5,virginica 103 | 102,5.8,2.7,5.1,1.9,virginica 104 | 103,7.1,3,5.9,2.1,virginica 105 | 104,6.3,2.9,5.6,1.8,virginica 106 | 105,6.5,3,5.8,2.2,virginica 107 | 106,7.6,3,6.6,2.1,virginica 108 | 107,4.9,2.5,4.5,1.7,virginica 109 | 108,7.3,2.9,6.3,1.8,virginica 110 | 109,6.7,2.5,5.8,1.8,virginica 111 | 110,7.2,3.6,6.1,2.5,virginica 112 | 111,6.5,3.2,5.1,2,virginica 113 | 112,6.4,2.7,5.3,1.9,virginica 114 | 113,6.8,3,5.5,2.1,virginica 115 | 114,5.7,2.5,5,2,virginica 116 | 115,5.8,2.8,5.1,2.4,virginica 117 | 116,6.4,3.2,5.3,2.3,virginica 118 | 117,6.5,3,5.5,1.8,virginica 119 | 118,7.7,3.8,6.7,2.2,virginica 120 | 119,7.7,2.6,6.9,2.3,virginica 121 | 120,6,2.2,5,1.5,virginica 122 | 121,6.9,3.2,5.7,2.3,virginica 123 | 122,5.6,2.8,4.9,2,virginica 124 | 123,7.7,2.8,6.7,2,virginica 125 | 124,6.3,2.7,4.9,1.8,virginica 126 | 125,6.7,3.3,5.7,2.1,virginica 127 | 126,7.2,3.2,6,1.8,virginica 128 | 127,6.2,2.8,4.8,1.8,virginica 129 | 128,6.1,3,4.9,1.8,virginica 130 | 129,6.4,2.8,5.6,2.1,virginica 131 | 130,7.2,3,5.8,1.6,virginica 132 | 131,7.4,2.8,6.1,1.9,virginica 133 | 132,7.9,3.8,6.4,2,virginica 134 | 133,6.4,2.8,5.6,2.2,virginica 135 | 134,6.3,2.8,5.1,1.5,virginica 136 | 135,6.1,2.6,5.6,1.4,virginica 137 | 136,7.7,3,6.1,2.3,virginica 138 | 137,6.3,3.4,5.6,2.4,virginica 139 | 138,6.4,3.1,5.5,1.8,virginica 140 | 139,6,3,4.8,1.8,virginica 141 | 140,6.9,3.1,5.4,2.1,virginica 142 | 141,6.7,3.1,5.6,2.4,virginica 143 | 142,6.9,3.1,5.1,2.3,virginica 144 | 143,5.8,2.7,5.1,1.9,virginica 145 | 144,6.8,3.2,5.9,2.3,virginica 146 | 145,6.7,3.3,5.7,2.5,virginica 147 | 146,6.7,3,5.2,2.3,virginica 148 | 147,6.3,2.5,5,1.9,virginica 149 | 148,6.5,3,5.2,2,virginica 150 | 149,6.2,3.4,5.4,2.3,virginica 151 | 150,5.9,3,5.1,1.8,virginica 152 | -------------------------------------------------------------------------------- /Assets/Resources/iris.csv.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58a22050492f5f34a86a54d14a721894 3 | timeCreated: 1490660743 4 | licenseType: Free 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scatterplot_Scene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c946c5afb903c3243bde9869ee597672 3 | timeCreated: 1490670503 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Standard Assets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 238dd03b79f3e954192b0124bd2eca00 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c32f58513a41ef4dab9cb7704c5fb92 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 943e057eaae705e43b9e9b2e53d6adb0 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 847c5f5e5581e6c40817c1f84662e65f 3 | folderAsset: yes 4 | timeCreated: 1490754261 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep01.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinzEugn/UnityScatterplot/3c4332ecc61a2636824fb28c78f20463d4298e55/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep01.wav -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep01.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42e65e088b3f4374e851b8dbd38f3df9 3 | AudioImporter: 4 | serializedVersion: 5 5 | format: -1 6 | loadType: 1 7 | quality: -1 8 | sampleRate: 0 9 | forceToMono: 0 10 | preloadAudioData: 1 11 | loadInBackground: 0 12 | overrideSampleRate: 0 13 | optimizeSampleRate: 0 14 | 3D: 1 15 | userData: 16 | assetBundleName: 17 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep02.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinzEugn/UnityScatterplot/3c4332ecc61a2636824fb28c78f20463d4298e55/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep02.wav -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep02.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8bc94ec6ed537e743b481638bdcd503d 3 | AudioImporter: 4 | serializedVersion: 5 5 | format: -1 6 | loadType: 1 7 | quality: -1 8 | sampleRate: 0 9 | forceToMono: 0 10 | preloadAudioData: 1 11 | loadInBackground: 0 12 | overrideSampleRate: 0 13 | optimizeSampleRate: 0 14 | 3D: 1 15 | userData: 16 | assetBundleName: 17 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep03.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinzEugn/UnityScatterplot/3c4332ecc61a2636824fb28c78f20463d4298e55/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep03.wav -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep03.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a9383dda6cabc047b7a297602e93eb4 3 | AudioImporter: 4 | serializedVersion: 5 5 | format: -1 6 | loadType: 1 7 | quality: -1 8 | sampleRate: 0 9 | forceToMono: 0 10 | preloadAudioData: 1 11 | loadInBackground: 0 12 | overrideSampleRate: 0 13 | optimizeSampleRate: 0 14 | 3D: 1 15 | userData: 16 | assetBundleName: 17 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep04.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinzEugn/UnityScatterplot/3c4332ecc61a2636824fb28c78f20463d4298e55/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep04.wav -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep04.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e9714160ce34f2b4ab63ff8c27bd68e1 3 | AudioImporter: 4 | serializedVersion: 5 5 | format: -1 6 | loadType: 1 7 | quality: -1 8 | sampleRate: 0 9 | forceToMono: 0 10 | preloadAudioData: 1 11 | loadInBackground: 0 12 | overrideSampleRate: 0 13 | optimizeSampleRate: 0 14 | 3D: 1 15 | userData: 16 | assetBundleName: 17 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Jump.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinzEugn/UnityScatterplot/3c4332ecc61a2636824fb28c78f20463d4298e55/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Jump.wav -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Jump.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5897aeed9b676024fbb8c694b421a861 3 | AudioImporter: 4 | serializedVersion: 5 5 | format: -1 6 | loadType: 1 7 | quality: -1 8 | sampleRate: 0 9 | forceToMono: 0 10 | preloadAudioData: 1 11 | loadInBackground: 0 12 | overrideSampleRate: 0 13 | optimizeSampleRate: 0 14 | 3D: 1 15 | userData: 16 | assetBundleName: 17 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Land.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinzEugn/UnityScatterplot/3c4332ecc61a2636824fb28c78f20463d4298e55/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Land.wav -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Land.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b09d59f4499d45428baa7a21e954296 3 | AudioImporter: 4 | serializedVersion: 5 5 | format: -1 6 | loadType: 1 7 | quality: -1 8 | sampleRate: 0 9 | forceToMono: 0 10 | preloadAudioData: 1 11 | loadInBackground: 0 12 | overrideSampleRate: 0 13 | optimizeSampleRate: 0 14 | 3D: 1 15 | userData: 16 | assetBundleName: 17 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/FirstPersonCharacterGuidelines.txt: -------------------------------------------------------------------------------- 1 | The first-person character is a single prefab which is designed to be used as-is. There's usually no need to create your own from the separate scripts provided. Just drop the prefab into your scene and you're good to go. 2 | 3 | 4 | The simplest way to get started with the First Person Character is to follow these steps: 5 | 6 | 1) Start with a suitable scene. There ought to be enough flat ground to walk around on. 7 | 8 | 2) Place the "FirstPersonCharacter" prefab in the scene. 9 | 10 | 3) If present, delete the "Main Camera" that exists in new scenes by default. The First Person Character prefab contains its own camera, so you don't need the default camera, or any of the camera rigs to use it. 11 | 12 | The first-person character is made up of a few components acting together. The FirstPersonCharacter script provides the functionality of moving, strafing and jumping. The SimpleMouseRotator provides the functionality of turning the body of the character left and right, and another copy of the same script on the "FirstPersonCamera" controls the looking-up-and-down effect. 13 | 14 | There is also an optional "Head Bob" script which provides a head bobbing effect and optionally also plays footstep sounds in sync with the head bobbing. This script can be disabled or removed if required. 15 | 16 | There are a number of simple adjustable settings on each component allowing you to change the movement speed, jump power, head bob style, and more. For more detail about each setting, see the comments in each script. 17 | 18 | The Character script also requires references to "zero friction" and "max friction" physics materials. These are provided already set-up for you. 19 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/FirstPersonCharacterGuidelines.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc9b000e9b8028247bd816e159382646 3 | TextScriptImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8293540fc63bc8e478af80925582960a 3 | folderAsset: yes 4 | timeCreated: 1490754458 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Prefabs/FPSController.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5e9e851c0e142814dac026a256ba2ac0 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Prefabs/RigidBodyFPSController.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100004 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 20: {fileID: 2000000} 12 | - 81: {fileID: 8100000} 13 | - 114: {fileID: 11400006} 14 | m_Layer: 0 15 | m_Name: MainCamera 16 | m_TagString: MainCamera 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!1 &100006 22 | GameObject: 23 | m_ObjectHideFlags: 0 24 | m_PrefabParentObject: {fileID: 0} 25 | m_PrefabInternal: {fileID: 100100000} 26 | serializedVersion: 4 27 | m_Component: 28 | - 4: {fileID: 400002} 29 | - 54: {fileID: 5400000} 30 | - 136: {fileID: 13600000} 31 | - 114: {fileID: 11400004} 32 | m_Layer: 0 33 | m_Name: RigidBodyFPSController 34 | m_TagString: Untagged 35 | m_Icon: {fileID: 0} 36 | m_NavMeshLayer: 0 37 | m_StaticEditorFlags: 0 38 | m_IsActive: 1 39 | --- !u!4 &400000 40 | Transform: 41 | m_ObjectHideFlags: 1 42 | m_PrefabParentObject: {fileID: 0} 43 | m_PrefabInternal: {fileID: 100100000} 44 | m_GameObject: {fileID: 100004} 45 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 46 | m_LocalPosition: {x: 0, y: .600000024, z: 0} 47 | m_LocalScale: {x: 1, y: 1, z: 1} 48 | m_Children: [] 49 | m_Father: {fileID: 400002} 50 | m_RootOrder: 0 51 | --- !u!4 &400002 52 | Transform: 53 | m_ObjectHideFlags: 1 54 | m_PrefabParentObject: {fileID: 0} 55 | m_PrefabInternal: {fileID: 100100000} 56 | m_GameObject: {fileID: 100006} 57 | m_LocalRotation: {x: 0, y: 1, z: 0, w: -1.62920685e-07} 58 | m_LocalPosition: {x: -30, y: 1, z: 25} 59 | m_LocalScale: {x: 1, y: 1, z: 1} 60 | m_Children: 61 | - {fileID: 400000} 62 | m_Father: {fileID: 0} 63 | m_RootOrder: 0 64 | --- !u!20 &2000000 65 | Camera: 66 | m_ObjectHideFlags: 1 67 | m_PrefabParentObject: {fileID: 0} 68 | m_PrefabInternal: {fileID: 100100000} 69 | m_GameObject: {fileID: 100004} 70 | m_Enabled: 1 71 | serializedVersion: 2 72 | m_ClearFlags: 1 73 | m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438} 74 | m_NormalizedViewPortRect: 75 | serializedVersion: 2 76 | x: 0 77 | y: 0 78 | width: 1 79 | height: 1 80 | near clip plane: .300000012 81 | far clip plane: 1000 82 | field of view: 60 83 | orthographic: 0 84 | orthographic size: 5 85 | m_Depth: 0 86 | m_CullingMask: 87 | serializedVersion: 2 88 | m_Bits: 4294967295 89 | m_RenderingPath: -1 90 | m_TargetTexture: {fileID: 0} 91 | m_TargetDisplay: 0 92 | m_HDR: 0 93 | m_OcclusionCulling: 1 94 | m_StereoConvergence: 10 95 | m_StereoSeparation: .0219999999 96 | --- !u!54 &5400000 97 | Rigidbody: 98 | m_ObjectHideFlags: 1 99 | m_PrefabParentObject: {fileID: 0} 100 | m_PrefabInternal: {fileID: 100100000} 101 | m_GameObject: {fileID: 100006} 102 | serializedVersion: 2 103 | m_Mass: 10 104 | m_Drag: 0 105 | m_AngularDrag: .0500000007 106 | m_UseGravity: 1 107 | m_IsKinematic: 0 108 | m_Interpolate: 0 109 | m_Constraints: 112 110 | m_CollisionDetection: 0 111 | --- !u!81 &8100000 112 | AudioListener: 113 | m_ObjectHideFlags: 1 114 | m_PrefabParentObject: {fileID: 0} 115 | m_PrefabInternal: {fileID: 100100000} 116 | m_GameObject: {fileID: 100004} 117 | m_Enabled: 1 118 | --- !u!114 &11400004 119 | MonoBehaviour: 120 | m_ObjectHideFlags: 1 121 | m_PrefabParentObject: {fileID: 0} 122 | m_PrefabInternal: {fileID: 100100000} 123 | m_GameObject: {fileID: 100006} 124 | m_Enabled: 1 125 | m_EditorHideFlags: 0 126 | m_Script: {fileID: 11500000, guid: 81c9795a96c094f4cbde4d65546aa9b2, type: 3} 127 | m_Name: 128 | m_EditorClassIdentifier: 129 | cam: {fileID: 2000000} 130 | movementSettings: 131 | ForwardSpeed: 8 132 | BackwardSpeed: 4 133 | StrafeSpeed: 4 134 | RunMultiplier: 2 135 | RunKey: 304 136 | JumpForce: 50 137 | SlopeCurveModifier: 138 | serializedVersion: 2 139 | m_Curve: 140 | - time: -90 141 | value: 1 142 | inSlope: 0 143 | outSlope: 0 144 | tangentMode: 0 145 | - time: 0 146 | value: 1 147 | inSlope: 0 148 | outSlope: 0 149 | tangentMode: 0 150 | - time: 90 151 | value: 0 152 | inSlope: 0 153 | outSlope: 0 154 | tangentMode: 0 155 | m_PreInfinity: 2 156 | m_PostInfinity: 2 157 | CurrentTargetSpeed: 8 158 | mouseLook: 159 | XSensitivity: 2 160 | YSensitivity: 2 161 | clampVerticalRotation: 1 162 | MinimumX: -45 163 | MaximumX: 90 164 | smooth: 1 165 | smoothTime: 18 166 | advancedSettings: 167 | groundCheckDistance: .100000001 168 | stickToGroundHelperDistance: .600000024 169 | slowDownRate: 20 170 | airControl: 0 171 | --- !u!114 &11400006 172 | MonoBehaviour: 173 | m_ObjectHideFlags: 1 174 | m_PrefabParentObject: {fileID: 0} 175 | m_PrefabInternal: {fileID: 100100000} 176 | m_GameObject: {fileID: 100004} 177 | m_Enabled: 1 178 | m_EditorHideFlags: 0 179 | m_Script: {fileID: 11500000, guid: 83c81407209f85e4c87c0cda8b32868e, type: 3} 180 | m_Name: 181 | m_EditorClassIdentifier: 182 | Camera: {fileID: 2000000} 183 | motionBob: 184 | HorizontalBobRange: .100000001 185 | VerticalBobRange: .0500000007 186 | Bobcurve: 187 | serializedVersion: 2 188 | m_Curve: 189 | - time: 0 190 | value: 0 191 | inSlope: 0 192 | outSlope: 0 193 | tangentMode: 0 194 | - time: .5 195 | value: 1 196 | inSlope: 0 197 | outSlope: 0 198 | tangentMode: 0 199 | - time: 1 200 | value: 0 201 | inSlope: 0 202 | outSlope: 0 203 | tangentMode: 0 204 | - time: 1.5 205 | value: -1 206 | inSlope: 0 207 | outSlope: 0 208 | tangentMode: 0 209 | - time: 2 210 | value: 0 211 | inSlope: 0 212 | outSlope: 0 213 | tangentMode: 0 214 | m_PreInfinity: 2 215 | m_PostInfinity: 2 216 | VerticaltoHorizontalRatio: 2 217 | jumpAndLandingBob: 218 | BobDuration: .150000006 219 | BobAmount: .200000003 220 | rigidbodyFirstPersonController: {fileID: 11400004} 221 | StrideInterval: 4 222 | RunningStrideLengthen: .722000003 223 | --- !u!136 &13600000 224 | CapsuleCollider: 225 | m_ObjectHideFlags: 1 226 | m_PrefabParentObject: {fileID: 0} 227 | m_PrefabInternal: {fileID: 100100000} 228 | m_GameObject: {fileID: 100006} 229 | m_Material: {fileID: 13400000, guid: c2815a7ab32e42c4bb42f59caacb8ec1, type: 2} 230 | m_IsTrigger: 0 231 | m_Enabled: 1 232 | m_Radius: .5 233 | m_Height: 1.60000002 234 | m_Direction: 1 235 | m_Center: {x: 0, y: 0, z: 0} 236 | --- !u!1001 &100100000 237 | Prefab: 238 | m_ObjectHideFlags: 1 239 | serializedVersion: 2 240 | m_Modification: 241 | m_TransformParent: {fileID: 0} 242 | m_Modifications: [] 243 | m_RemovedComponents: [] 244 | m_ParentPrefab: {fileID: 0} 245 | m_RootGameObject: {fileID: 100006} 246 | m_IsPrefabParent: 1 247 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Prefabs/RigidBodyFPSController.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c6453f8e1f814744d8b94e5a6d1f9942 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52d9391c2aceb3844b6d1e8b49a26379 3 | folderAsset: yes 4 | timeCreated: 1490754284 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/FirstPersonController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 278bea01e1f628548b6cd7919b069b0f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/HeadBob.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityStandardAssets.Utility; 4 | 5 | namespace UnityStandardAssets.Characters.FirstPerson 6 | { 7 | public class HeadBob : MonoBehaviour 8 | { 9 | public Camera Camera; 10 | public CurveControlledBob motionBob = new CurveControlledBob(); 11 | public LerpControlledBob jumpAndLandingBob = new LerpControlledBob(); 12 | public RigidbodyFirstPersonController rigidbodyFirstPersonController; 13 | public float StrideInterval; 14 | [Range(0f, 1f)] public float RunningStrideLengthen; 15 | 16 | // private CameraRefocus m_CameraRefocus; 17 | private bool m_PreviouslyGrounded; 18 | private Vector3 m_OriginalCameraPosition; 19 | 20 | 21 | private void Start() 22 | { 23 | motionBob.Setup(Camera, StrideInterval); 24 | m_OriginalCameraPosition = Camera.transform.localPosition; 25 | // m_CameraRefocus = new CameraRefocus(Camera, transform.root.transform, Camera.transform.localPosition); 26 | } 27 | 28 | 29 | private void Update() 30 | { 31 | // m_CameraRefocus.GetFocusPoint(); 32 | Vector3 newCameraPosition; 33 | if (rigidbodyFirstPersonController.Velocity.magnitude > 0 && rigidbodyFirstPersonController.Grounded) 34 | { 35 | Camera.transform.localPosition = motionBob.DoHeadBob(rigidbodyFirstPersonController.Velocity.magnitude*(rigidbodyFirstPersonController.Running ? RunningStrideLengthen : 1f)); 36 | newCameraPosition = Camera.transform.localPosition; 37 | newCameraPosition.y = Camera.transform.localPosition.y - jumpAndLandingBob.Offset(); 38 | } 39 | else 40 | { 41 | newCameraPosition = Camera.transform.localPosition; 42 | newCameraPosition.y = m_OriginalCameraPosition.y - jumpAndLandingBob.Offset(); 43 | } 44 | Camera.transform.localPosition = newCameraPosition; 45 | 46 | if (!m_PreviouslyGrounded && rigidbodyFirstPersonController.Grounded) 47 | { 48 | StartCoroutine(jumpAndLandingBob.DoBobCycle()); 49 | } 50 | 51 | m_PreviouslyGrounded = rigidbodyFirstPersonController.Grounded; 52 | // m_CameraRefocus.SetFocusPoint(); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/HeadBob.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae6b5f30b76d38d4e9869a7c041dc5f7 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/MouseLook.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityStandardAssets.CrossPlatformInput; 4 | 5 | namespace UnityStandardAssets.Characters.FirstPerson 6 | { 7 | [Serializable] 8 | public class MouseLook 9 | { 10 | public float XSensitivity = 2f; 11 | public float YSensitivity = 2f; 12 | public bool clampVerticalRotation = true; 13 | public float MinimumX = -90F; 14 | public float MaximumX = 90F; 15 | public bool smooth; 16 | public float smoothTime = 5f; 17 | public bool lockCursor = true; 18 | 19 | 20 | private Quaternion m_CharacterTargetRot; 21 | private Quaternion m_CameraTargetRot; 22 | private bool m_cursorIsLocked = true; 23 | 24 | public void Init(Transform character, Transform camera) 25 | { 26 | m_CharacterTargetRot = character.localRotation; 27 | m_CameraTargetRot = camera.localRotation; 28 | } 29 | 30 | 31 | public void LookRotation(Transform character, Transform camera) 32 | { 33 | float yRot = CrossPlatformInputManager.GetAxis("Mouse X") * XSensitivity; 34 | float xRot = CrossPlatformInputManager.GetAxis("Mouse Y") * YSensitivity; 35 | 36 | m_CharacterTargetRot *= Quaternion.Euler (0f, yRot, 0f); 37 | m_CameraTargetRot *= Quaternion.Euler (-xRot, 0f, 0f); 38 | 39 | if(clampVerticalRotation) 40 | m_CameraTargetRot = ClampRotationAroundXAxis (m_CameraTargetRot); 41 | 42 | if(smooth) 43 | { 44 | character.localRotation = Quaternion.Slerp (character.localRotation, m_CharacterTargetRot, 45 | smoothTime * Time.deltaTime); 46 | camera.localRotation = Quaternion.Slerp (camera.localRotation, m_CameraTargetRot, 47 | smoothTime * Time.deltaTime); 48 | } 49 | else 50 | { 51 | character.localRotation = m_CharacterTargetRot; 52 | camera.localRotation = m_CameraTargetRot; 53 | } 54 | 55 | UpdateCursorLock(); 56 | } 57 | 58 | public void SetCursorLock(bool value) 59 | { 60 | lockCursor = value; 61 | if(!lockCursor) 62 | {//we force unlock the cursor if the user disable the cursor locking helper 63 | Cursor.lockState = CursorLockMode.None; 64 | Cursor.visible = true; 65 | } 66 | } 67 | 68 | public void UpdateCursorLock() 69 | { 70 | //if the user set "lockCursor" we check & properly lock the cursos 71 | if (lockCursor) 72 | InternalLockUpdate(); 73 | } 74 | 75 | private void InternalLockUpdate() 76 | { 77 | if(Input.GetKeyUp(KeyCode.Escape)) 78 | { 79 | m_cursorIsLocked = false; 80 | } 81 | else if(Input.GetMouseButtonUp(0)) 82 | { 83 | m_cursorIsLocked = true; 84 | } 85 | 86 | if (m_cursorIsLocked) 87 | { 88 | Cursor.lockState = CursorLockMode.Locked; 89 | Cursor.visible = false; 90 | } 91 | else if (!m_cursorIsLocked) 92 | { 93 | Cursor.lockState = CursorLockMode.None; 94 | Cursor.visible = true; 95 | } 96 | } 97 | 98 | Quaternion ClampRotationAroundXAxis(Quaternion q) 99 | { 100 | q.x /= q.w; 101 | q.y /= q.w; 102 | q.z /= q.w; 103 | q.w = 1.0f; 104 | 105 | float angleX = 2.0f * Mathf.Rad2Deg * Mathf.Atan (q.x); 106 | 107 | angleX = Mathf.Clamp (angleX, MinimumX, MaximumX); 108 | 109 | q.x = Mathf.Tan (0.5f * Mathf.Deg2Rad * angleX); 110 | 111 | return q; 112 | } 113 | 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/MouseLook.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 32540d66b78b5484d9e840eafc089a58 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/RigidbodyFirstPersonController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 500e489b376fe69428506b27cd769489 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52a4e252551aaa54797e351c2510fa0b 3 | folderAsset: yes 4 | timeCreated: 1490754320 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/CrossPlatformInputGuidelines.txt: -------------------------------------------------------------------------------- 1 | 2 | Importing the CrossPlatformInput package adds a menu item to Unity, "CrossPlatformInput", which allows you to enable or disable the CrossPlatformInput in the editor. You must enable the CrossPlatformInput in order to see the control rigs in the editor, and to start using Unity Remote to control your game. 3 | 4 | The CrossPlatformInput sample assets contains two main sections. 5 | 6 | 1) The folder of prefabs provide a variety of ready-to-use "MobileControlRigs". Each control rig is suitable for a different purpose, and each implements the touch or tilt-based equivalent of some of the default standalone axes or buttons. These are ready to drop into your scene, and to use them you simply need to read the axes via the CrossPlatformInput class, rather than Unity's regular Input class. 7 | 8 | 2) The set of scripts provided are the scripts we used to put together the control rigs prefabs. They provide a simplified way of reading basic mobile input, such as tilt, taps and swipe gestures. They are designed so that various mobile controls can be read in the same way as regular Unity axes and buttons. You can use these scripts to build your own MobileControlRigs. 9 | 10 | 11 | 12 | For example the Car control rig feeds the tilt input of the mobile device to the "Horizontal" axis, and has an accelerator and brake touch button which are fed as a pair into the "Vertical" axis. These are virtual equivalents of the real "Horizontal" and "Vertical" axes defined in Unity's Input Manager. 13 | 14 | Therefore when you read CrossPlatformInput.GetAxis("Horizontal"), you will either get the "real" input value - if your build target is non-mobile, or the value from the mobile control rig - if your build target is set to a mobile platform. 15 | 16 | The CrossPlatformInput scripts and prefabs are provided together as an example of how you can implement a cross-platform control solution in Unity. They also allow us to provide our other sample scenes in a form that can be published as standalone or to mobile targets with no modification. 17 | 18 | To use the CrossPlatformInput, you need to drop a "Mobile Control Rig" into your scene (or create your own), and then make calls to CrossPlatformInput functions, referring to the axes and buttons that the Rig implements. 19 | 20 | When reading input from the CrossPlatformInput class, the values returned will be taken either from Unity's Input Manager settings, or from the mobile-specific controls set up, depending on which build target you have selected. 21 | 22 | The CrossPlatformInput class is designed to be called instead of Unity's own Input class, and so mirrors certain parts of the Input API - specifically the functions relating to Axes and Buttons: 23 | GetAxis, GetAxisRaw 24 | GetButton, GetButtonDown, GetButtonUp 25 | 26 | Notes for coders: 27 | This package sets two compiler define symbols. One is always set automatically, the other is optionally set from a menu item. 28 | 29 | Importing the "CrossPlatformInput" package will automatically add a compiler define symbol, "CROSS_PLATFORM_INPUT". This enables the CrossPlatformInput functions defined in some of the other Sample Asset packages (such as the Characters, Planes, etc). Without this symbol defined, those packages use Unity's regular Input class, which means they can be imported alone and still work without the CrossPlatformInput package. 30 | 31 | The optional define (which is set by default, but can be disabled using the "Mobile Input" menu), is "MOBILE_INPUT". This causes the MobileControlRigs to become active when a mobile build target is selected. It also enables certain mobile-specific control nuances in some of the packages, which make more sense when the character or vehicle is being controlled using mobile input (such as auto-leveling the character's look direction). This define is optional because some developers prefer to use standalone input methods instead of the Unity Remote app, when testing mobile apps in the editor's play mode. 32 | 33 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/CrossPlatformInputGuidelines.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3b997593a4f12c4c991490593f3b513 3 | TextScriptImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d88a0b7dd92c5524aaf2d65e569a6213 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/AxisTouchButton.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.EventSystems; 4 | 5 | namespace UnityStandardAssets.CrossPlatformInput 6 | { 7 | public class AxisTouchButton : MonoBehaviour, IPointerDownHandler, IPointerUpHandler 8 | { 9 | // designed to work in a pair with another axis touch button 10 | // (typically with one having -1 and one having 1 axisValues) 11 | public string axisName = "Horizontal"; // The name of the axis 12 | public float axisValue = 1; // The axis that the value has 13 | public float responseSpeed = 3; // The speed at which the axis touch button responds 14 | public float returnToCentreSpeed = 3; // The speed at which the button will return to its centre 15 | 16 | AxisTouchButton m_PairedWith; // Which button this one is paired with 17 | CrossPlatformInputManager.VirtualAxis m_Axis; // A reference to the virtual axis as it is in the cross platform input 18 | 19 | void OnEnable() 20 | { 21 | if (!CrossPlatformInputManager.AxisExists(axisName)) 22 | { 23 | // if the axis doesnt exist create a new one in cross platform input 24 | m_Axis = new CrossPlatformInputManager.VirtualAxis(axisName); 25 | CrossPlatformInputManager.RegisterVirtualAxis(m_Axis); 26 | } 27 | else 28 | { 29 | m_Axis = CrossPlatformInputManager.VirtualAxisReference(axisName); 30 | } 31 | FindPairedButton(); 32 | } 33 | 34 | void FindPairedButton() 35 | { 36 | // find the other button witch which this button should be paired 37 | // (it should have the same axisName) 38 | var otherAxisButtons = FindObjectsOfType(typeof(AxisTouchButton)) as AxisTouchButton[]; 39 | 40 | if (otherAxisButtons != null) 41 | { 42 | for (int i = 0; i < otherAxisButtons.Length; i++) 43 | { 44 | if (otherAxisButtons[i].axisName == axisName && otherAxisButtons[i] != this) 45 | { 46 | m_PairedWith = otherAxisButtons[i]; 47 | } 48 | } 49 | } 50 | } 51 | 52 | void OnDisable() 53 | { 54 | // The object is disabled so remove it from the cross platform input system 55 | m_Axis.Remove(); 56 | } 57 | 58 | 59 | public void OnPointerDown(PointerEventData data) 60 | { 61 | if (m_PairedWith == null) 62 | { 63 | FindPairedButton(); 64 | } 65 | // update the axis and record that the button has been pressed this frame 66 | m_Axis.Update(Mathf.MoveTowards(m_Axis.GetValue, axisValue, responseSpeed * Time.deltaTime)); 67 | } 68 | 69 | 70 | public void OnPointerUp(PointerEventData data) 71 | { 72 | m_Axis.Update(Mathf.MoveTowards(m_Axis.GetValue, 0, responseSpeed * Time.deltaTime)); 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/AxisTouchButton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ab98b66288df7b4fa182075f2f12bd6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/ButtonHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.CrossPlatformInput 5 | { 6 | public class ButtonHandler : MonoBehaviour 7 | { 8 | 9 | public string Name; 10 | 11 | void OnEnable() 12 | { 13 | 14 | } 15 | 16 | public void SetDownState() 17 | { 18 | CrossPlatformInputManager.SetButtonDown(Name); 19 | } 20 | 21 | 22 | public void SetUpState() 23 | { 24 | CrossPlatformInputManager.SetButtonUp(Name); 25 | } 26 | 27 | 28 | public void SetAxisPositiveState() 29 | { 30 | CrossPlatformInputManager.SetAxisPositive(Name); 31 | } 32 | 33 | 34 | public void SetAxisNeutralState() 35 | { 36 | CrossPlatformInputManager.SetAxisZero(Name); 37 | } 38 | 39 | 40 | public void SetAxisNegativeState() 41 | { 42 | CrossPlatformInputManager.SetAxisNegative(Name); 43 | } 44 | 45 | public void Update() 46 | { 47 | 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/ButtonHandler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85bf3be603548374ca46f521a3aa7fda 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/CrossPlatformInputManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ac1ce5a5adfd9f46adbf5b6f752a47c 3 | labels: 4 | - Done 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: -1010 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/InputAxisScrollbar.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.CrossPlatformInput 5 | { 6 | public class InputAxisScrollbar : MonoBehaviour 7 | { 8 | public string axis; 9 | 10 | void Update() { } 11 | 12 | public void HandleInput(float value) 13 | { 14 | CrossPlatformInputManager.SetAxis(axis, (value*2f) - 1f); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/InputAxisScrollbar.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d3269566d48b8447bb48d2259e28f8b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/Joystick.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.EventSystems; 4 | 5 | namespace UnityStandardAssets.CrossPlatformInput 6 | { 7 | public class Joystick : MonoBehaviour, IPointerDownHandler, IPointerUpHandler, IDragHandler 8 | { 9 | public enum AxisOption 10 | { 11 | // Options for which axes to use 12 | Both, // Use both 13 | OnlyHorizontal, // Only horizontal 14 | OnlyVertical // Only vertical 15 | } 16 | 17 | public int MovementRange = 100; 18 | public AxisOption axesToUse = AxisOption.Both; // The options for the axes that the still will use 19 | public string horizontalAxisName = "Horizontal"; // The name given to the horizontal axis for the cross platform input 20 | public string verticalAxisName = "Vertical"; // The name given to the vertical axis for the cross platform input 21 | 22 | Vector3 m_StartPos; 23 | bool m_UseX; // Toggle for using the x axis 24 | bool m_UseY; // Toggle for using the Y axis 25 | CrossPlatformInputManager.VirtualAxis m_HorizontalVirtualAxis; // Reference to the joystick in the cross platform input 26 | CrossPlatformInputManager.VirtualAxis m_VerticalVirtualAxis; // Reference to the joystick in the cross platform input 27 | 28 | void OnEnable() 29 | { 30 | CreateVirtualAxes(); 31 | } 32 | 33 | void Start() 34 | { 35 | m_StartPos = transform.position; 36 | } 37 | 38 | void UpdateVirtualAxes(Vector3 value) 39 | { 40 | var delta = m_StartPos - value; 41 | delta.y = -delta.y; 42 | delta /= MovementRange; 43 | if (m_UseX) 44 | { 45 | m_HorizontalVirtualAxis.Update(-delta.x); 46 | } 47 | 48 | if (m_UseY) 49 | { 50 | m_VerticalVirtualAxis.Update(delta.y); 51 | } 52 | } 53 | 54 | void CreateVirtualAxes() 55 | { 56 | // set axes to use 57 | m_UseX = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyHorizontal); 58 | m_UseY = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyVertical); 59 | 60 | // create new axes based on axes to use 61 | if (m_UseX) 62 | { 63 | m_HorizontalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(horizontalAxisName); 64 | CrossPlatformInputManager.RegisterVirtualAxis(m_HorizontalVirtualAxis); 65 | } 66 | if (m_UseY) 67 | { 68 | m_VerticalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(verticalAxisName); 69 | CrossPlatformInputManager.RegisterVirtualAxis(m_VerticalVirtualAxis); 70 | } 71 | } 72 | 73 | 74 | public void OnDrag(PointerEventData data) 75 | { 76 | Vector3 newPos = Vector3.zero; 77 | 78 | if (m_UseX) 79 | { 80 | int delta = (int)(data.position.x - m_StartPos.x); 81 | delta = Mathf.Clamp(delta, - MovementRange, MovementRange); 82 | newPos.x = delta; 83 | } 84 | 85 | if (m_UseY) 86 | { 87 | int delta = (int)(data.position.y - m_StartPos.y); 88 | delta = Mathf.Clamp(delta, -MovementRange, MovementRange); 89 | newPos.y = delta; 90 | } 91 | transform.position = new Vector3(m_StartPos.x + newPos.x, m_StartPos.y + newPos.y, m_StartPos.z + newPos.z); 92 | UpdateVirtualAxes(transform.position); 93 | } 94 | 95 | 96 | public void OnPointerUp(PointerEventData data) 97 | { 98 | transform.position = m_StartPos; 99 | UpdateVirtualAxes(m_StartPos); 100 | } 101 | 102 | 103 | public void OnPointerDown(PointerEventData data) { } 104 | 105 | void OnDisable() 106 | { 107 | // remove the joysticks from the cross platform input 108 | if (m_UseX) 109 | { 110 | m_HorizontalVirtualAxis.Remove(); 111 | } 112 | if (m_UseY) 113 | { 114 | m_VerticalVirtualAxis.Remove(); 115 | } 116 | } 117 | } 118 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/Joystick.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00c3c865782347f41b6358d9fba14b48 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/MobileControlRig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | #if UNITY_EDITOR 3 | using UnityEditor; 4 | #endif 5 | using UnityEngine; 6 | 7 | 8 | namespace UnityStandardAssets.CrossPlatformInput 9 | { 10 | [ExecuteInEditMode] 11 | public class MobileControlRig : MonoBehaviour 12 | { 13 | // this script enables or disables the child objects of a control rig 14 | // depending on whether the USE_MOBILE_INPUT define is declared. 15 | 16 | // This define is set or unset by a menu item that is included with 17 | // the Cross Platform Input package. 18 | 19 | #if !UNITY_EDITOR 20 | void OnEnable() 21 | { 22 | CheckEnableControlRig(); 23 | } 24 | #endif 25 | 26 | private void Start() 27 | { 28 | #if UNITY_EDITOR 29 | if (Application.isPlaying) //if in the editor, need to check if we are playing, as start is also called just after exiting play 30 | #endif 31 | { 32 | UnityEngine.EventSystems.EventSystem system = GameObject.FindObjectOfType(); 33 | 34 | if (system == null) 35 | {//the scene have no event system, spawn one 36 | GameObject o = new GameObject("EventSystem"); 37 | 38 | o.AddComponent(); 39 | o.AddComponent(); 40 | } 41 | } 42 | } 43 | 44 | #if UNITY_EDITOR 45 | 46 | private void OnEnable() 47 | { 48 | EditorUserBuildSettings.activeBuildTargetChanged += Update; 49 | EditorApplication.update += Update; 50 | } 51 | 52 | 53 | private void OnDisable() 54 | { 55 | EditorUserBuildSettings.activeBuildTargetChanged -= Update; 56 | EditorApplication.update -= Update; 57 | } 58 | 59 | 60 | private void Update() 61 | { 62 | CheckEnableControlRig(); 63 | } 64 | #endif 65 | 66 | 67 | private void CheckEnableControlRig() 68 | { 69 | #if MOBILE_INPUT 70 | EnableControlRig(true); 71 | #else 72 | EnableControlRig(false); 73 | #endif 74 | } 75 | 76 | 77 | private void EnableControlRig(bool enabled) 78 | { 79 | foreach (Transform t in transform) 80 | { 81 | t.gameObject.SetActive(enabled); 82 | } 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/MobileControlRig.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71398ce7fbc3a5b4fa50b50bd54317a7 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3f33f034733d9f4f9d439d80e26bdce 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific/MobileInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.CrossPlatformInput.PlatformSpecific 5 | { 6 | public class MobileInput : VirtualInput 7 | { 8 | private void AddButton(string name) 9 | { 10 | // we have not registered this button yet so add it, happens in the constructor 11 | CrossPlatformInputManager.RegisterVirtualButton(new CrossPlatformInputManager.VirtualButton(name)); 12 | } 13 | 14 | 15 | private void AddAxes(string name) 16 | { 17 | // we have not registered this button yet so add it, happens in the constructor 18 | CrossPlatformInputManager.RegisterVirtualAxis(new CrossPlatformInputManager.VirtualAxis(name)); 19 | } 20 | 21 | 22 | public override float GetAxis(string name, bool raw) 23 | { 24 | if (!m_VirtualAxes.ContainsKey(name)) 25 | { 26 | AddAxes(name); 27 | } 28 | return m_VirtualAxes[name].GetValue; 29 | } 30 | 31 | 32 | public override void SetButtonDown(string name) 33 | { 34 | if (!m_VirtualButtons.ContainsKey(name)) 35 | { 36 | AddButton(name); 37 | } 38 | m_VirtualButtons[name].Pressed(); 39 | } 40 | 41 | 42 | public override void SetButtonUp(string name) 43 | { 44 | if (!m_VirtualButtons.ContainsKey(name)) 45 | { 46 | AddButton(name); 47 | } 48 | m_VirtualButtons[name].Released(); 49 | } 50 | 51 | 52 | public override void SetAxisPositive(string name) 53 | { 54 | if (!m_VirtualAxes.ContainsKey(name)) 55 | { 56 | AddAxes(name); 57 | } 58 | m_VirtualAxes[name].Update(1f); 59 | } 60 | 61 | 62 | public override void SetAxisNegative(string name) 63 | { 64 | if (!m_VirtualAxes.ContainsKey(name)) 65 | { 66 | AddAxes(name); 67 | } 68 | m_VirtualAxes[name].Update(-1f); 69 | } 70 | 71 | 72 | public override void SetAxisZero(string name) 73 | { 74 | if (!m_VirtualAxes.ContainsKey(name)) 75 | { 76 | AddAxes(name); 77 | } 78 | m_VirtualAxes[name].Update(0f); 79 | } 80 | 81 | 82 | public override void SetAxis(string name, float value) 83 | { 84 | if (!m_VirtualAxes.ContainsKey(name)) 85 | { 86 | AddAxes(name); 87 | } 88 | m_VirtualAxes[name].Update(value); 89 | } 90 | 91 | 92 | public override bool GetButtonDown(string name) 93 | { 94 | if (m_VirtualButtons.ContainsKey(name)) 95 | { 96 | return m_VirtualButtons[name].GetButtonDown; 97 | } 98 | 99 | AddButton(name); 100 | return m_VirtualButtons[name].GetButtonDown; 101 | } 102 | 103 | 104 | public override bool GetButtonUp(string name) 105 | { 106 | if (m_VirtualButtons.ContainsKey(name)) 107 | { 108 | return m_VirtualButtons[name].GetButtonUp; 109 | } 110 | 111 | AddButton(name); 112 | return m_VirtualButtons[name].GetButtonUp; 113 | } 114 | 115 | 116 | public override bool GetButton(string name) 117 | { 118 | if (m_VirtualButtons.ContainsKey(name)) 119 | { 120 | return m_VirtualButtons[name].GetButton; 121 | } 122 | 123 | AddButton(name); 124 | return m_VirtualButtons[name].GetButton; 125 | } 126 | 127 | 128 | public override Vector3 MousePosition() 129 | { 130 | return virtualMousePosition; 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific/MobileInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9703d53e47195aa4190acd11369ccd1b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific/StandaloneInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.CrossPlatformInput.PlatformSpecific 5 | { 6 | public class StandaloneInput : VirtualInput 7 | { 8 | public override float GetAxis(string name, bool raw) 9 | { 10 | return raw ? Input.GetAxisRaw(name) : Input.GetAxis(name); 11 | } 12 | 13 | 14 | public override bool GetButton(string name) 15 | { 16 | return Input.GetButton(name); 17 | } 18 | 19 | 20 | public override bool GetButtonDown(string name) 21 | { 22 | return Input.GetButtonDown(name); 23 | } 24 | 25 | 26 | public override bool GetButtonUp(string name) 27 | { 28 | return Input.GetButtonUp(name); 29 | } 30 | 31 | 32 | public override void SetButtonDown(string name) 33 | { 34 | throw new Exception( 35 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 36 | } 37 | 38 | 39 | public override void SetButtonUp(string name) 40 | { 41 | throw new Exception( 42 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 43 | } 44 | 45 | 46 | public override void SetAxisPositive(string name) 47 | { 48 | throw new Exception( 49 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 50 | } 51 | 52 | 53 | public override void SetAxisNegative(string name) 54 | { 55 | throw new Exception( 56 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 57 | } 58 | 59 | 60 | public override void SetAxisZero(string name) 61 | { 62 | throw new Exception( 63 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 64 | } 65 | 66 | 67 | public override void SetAxis(string name, float value) 68 | { 69 | throw new Exception( 70 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 71 | } 72 | 73 | 74 | public override Vector3 MousePosition() 75 | { 76 | return Input.mousePosition; 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific/StandaloneInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9961032f4f02c4f41997c3ea399d2f22 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/TiltInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | #if UNITY_EDITOR 4 | using UnityEditor; 5 | #endif 6 | 7 | namespace UnityStandardAssets.CrossPlatformInput 8 | { 9 | // helps with managing tilt input on mobile devices 10 | public class TiltInput : MonoBehaviour 11 | { 12 | // options for the various orientations 13 | public enum AxisOptions 14 | { 15 | ForwardAxis, 16 | SidewaysAxis, 17 | } 18 | 19 | 20 | [Serializable] 21 | public class AxisMapping 22 | { 23 | public enum MappingType 24 | { 25 | NamedAxis, 26 | MousePositionX, 27 | MousePositionY, 28 | MousePositionZ 29 | }; 30 | 31 | 32 | public MappingType type; 33 | public string axisName; 34 | } 35 | 36 | 37 | public AxisMapping mapping; 38 | public AxisOptions tiltAroundAxis = AxisOptions.ForwardAxis; 39 | public float fullTiltAngle = 25; 40 | public float centreAngleOffset = 0; 41 | 42 | 43 | private CrossPlatformInputManager.VirtualAxis m_SteerAxis; 44 | 45 | 46 | private void OnEnable() 47 | { 48 | if (mapping.type == AxisMapping.MappingType.NamedAxis) 49 | { 50 | m_SteerAxis = new CrossPlatformInputManager.VirtualAxis(mapping.axisName); 51 | CrossPlatformInputManager.RegisterVirtualAxis(m_SteerAxis); 52 | } 53 | } 54 | 55 | 56 | private void Update() 57 | { 58 | float angle = 0; 59 | if (Input.acceleration != Vector3.zero) 60 | { 61 | switch (tiltAroundAxis) 62 | { 63 | case AxisOptions.ForwardAxis: 64 | angle = Mathf.Atan2(Input.acceleration.x, -Input.acceleration.y)*Mathf.Rad2Deg + 65 | centreAngleOffset; 66 | break; 67 | case AxisOptions.SidewaysAxis: 68 | angle = Mathf.Atan2(Input.acceleration.z, -Input.acceleration.y)*Mathf.Rad2Deg + 69 | centreAngleOffset; 70 | break; 71 | } 72 | } 73 | 74 | float axisValue = Mathf.InverseLerp(-fullTiltAngle, fullTiltAngle, angle)*2 - 1; 75 | switch (mapping.type) 76 | { 77 | case AxisMapping.MappingType.NamedAxis: 78 | m_SteerAxis.Update(axisValue); 79 | break; 80 | case AxisMapping.MappingType.MousePositionX: 81 | CrossPlatformInputManager.SetVirtualMousePositionX(axisValue*Screen.width); 82 | break; 83 | case AxisMapping.MappingType.MousePositionY: 84 | CrossPlatformInputManager.SetVirtualMousePositionY(axisValue*Screen.width); 85 | break; 86 | case AxisMapping.MappingType.MousePositionZ: 87 | CrossPlatformInputManager.SetVirtualMousePositionZ(axisValue*Screen.width); 88 | break; 89 | } 90 | } 91 | 92 | 93 | private void OnDisable() 94 | { 95 | m_SteerAxis.Remove(); 96 | } 97 | } 98 | } 99 | 100 | 101 | namespace UnityStandardAssets.CrossPlatformInput.Inspector 102 | { 103 | #if UNITY_EDITOR 104 | [CustomPropertyDrawer(typeof (TiltInput.AxisMapping))] 105 | public class TiltInputAxisStylePropertyDrawer : PropertyDrawer 106 | { 107 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 108 | { 109 | EditorGUI.BeginProperty(position, label, property); 110 | 111 | float x = position.x; 112 | float y = position.y; 113 | float inspectorWidth = position.width; 114 | 115 | // Don't make child fields be indented 116 | var indent = EditorGUI.indentLevel; 117 | EditorGUI.indentLevel = 0; 118 | 119 | var props = new[] {"type", "axisName"}; 120 | var widths = new[] {.4f, .6f}; 121 | if (property.FindPropertyRelative("type").enumValueIndex > 0) 122 | { 123 | // hide name if not a named axis 124 | props = new[] {"type"}; 125 | widths = new[] {1f}; 126 | } 127 | const float lineHeight = 18; 128 | for (int n = 0; n < props.Length; ++n) 129 | { 130 | float w = widths[n]*inspectorWidth; 131 | 132 | // Calculate rects 133 | Rect rect = new Rect(x, y, w, lineHeight); 134 | x += w; 135 | 136 | EditorGUI.PropertyField(rect, property.FindPropertyRelative(props[n]), GUIContent.none); 137 | } 138 | 139 | // Set indent back to what it was 140 | EditorGUI.indentLevel = indent; 141 | EditorGUI.EndProperty(); 142 | } 143 | } 144 | #endif 145 | } 146 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/TiltInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5c2d84226fbbaf94e9c1451f1c39b06a 3 | labels: 4 | - Not 5 | - Fully 6 | - Implemented 7 | MonoImporter: 8 | serializedVersion: 2 9 | defaultReferences: [] 10 | executionOrder: -1001 11 | icon: {instanceID: 0} 12 | userData: 13 | assetBundleName: 14 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/TouchPad.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.EventSystems; 4 | using UnityEngine.UI; 5 | 6 | namespace UnityStandardAssets.CrossPlatformInput 7 | { 8 | [RequireComponent(typeof(Image))] 9 | public class TouchPad : MonoBehaviour, IPointerDownHandler, IPointerUpHandler 10 | { 11 | // Options for which axes to use 12 | public enum AxisOption 13 | { 14 | Both, // Use both 15 | OnlyHorizontal, // Only horizontal 16 | OnlyVertical // Only vertical 17 | } 18 | 19 | 20 | public enum ControlStyle 21 | { 22 | Absolute, // operates from teh center of the image 23 | Relative, // operates from the center of the initial touch 24 | Swipe, // swipe to touch touch no maintained center 25 | } 26 | 27 | 28 | public AxisOption axesToUse = AxisOption.Both; // The options for the axes that the still will use 29 | public ControlStyle controlStyle = ControlStyle.Absolute; // control style to use 30 | public string horizontalAxisName = "Horizontal"; // The name given to the horizontal axis for the cross platform input 31 | public string verticalAxisName = "Vertical"; // The name given to the vertical axis for the cross platform input 32 | public float Xsensitivity = 1f; 33 | public float Ysensitivity = 1f; 34 | 35 | Vector3 m_StartPos; 36 | Vector2 m_PreviousDelta; 37 | Vector3 m_JoytickOutput; 38 | bool m_UseX; // Toggle for using the x axis 39 | bool m_UseY; // Toggle for using the Y axis 40 | CrossPlatformInputManager.VirtualAxis m_HorizontalVirtualAxis; // Reference to the joystick in the cross platform input 41 | CrossPlatformInputManager.VirtualAxis m_VerticalVirtualAxis; // Reference to the joystick in the cross platform input 42 | bool m_Dragging; 43 | int m_Id = -1; 44 | Vector2 m_PreviousTouchPos; // swipe style control touch 45 | 46 | 47 | #if !UNITY_EDITOR 48 | private Vector3 m_Center; 49 | private Image m_Image; 50 | #else 51 | Vector3 m_PreviousMouse; 52 | #endif 53 | 54 | void OnEnable() 55 | { 56 | CreateVirtualAxes(); 57 | } 58 | 59 | void Start() 60 | { 61 | #if !UNITY_EDITOR 62 | m_Image = GetComponent(); 63 | m_Center = m_Image.transform.position; 64 | #endif 65 | } 66 | 67 | void CreateVirtualAxes() 68 | { 69 | // set axes to use 70 | m_UseX = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyHorizontal); 71 | m_UseY = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyVertical); 72 | 73 | // create new axes based on axes to use 74 | if (m_UseX) 75 | { 76 | m_HorizontalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(horizontalAxisName); 77 | CrossPlatformInputManager.RegisterVirtualAxis(m_HorizontalVirtualAxis); 78 | } 79 | if (m_UseY) 80 | { 81 | m_VerticalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(verticalAxisName); 82 | CrossPlatformInputManager.RegisterVirtualAxis(m_VerticalVirtualAxis); 83 | } 84 | } 85 | 86 | void UpdateVirtualAxes(Vector3 value) 87 | { 88 | value = value.normalized; 89 | if (m_UseX) 90 | { 91 | m_HorizontalVirtualAxis.Update(value.x); 92 | } 93 | 94 | if (m_UseY) 95 | { 96 | m_VerticalVirtualAxis.Update(value.y); 97 | } 98 | } 99 | 100 | 101 | public void OnPointerDown(PointerEventData data) 102 | { 103 | m_Dragging = true; 104 | m_Id = data.pointerId; 105 | #if !UNITY_EDITOR 106 | if (controlStyle != ControlStyle.Absolute ) 107 | m_Center = data.position; 108 | #endif 109 | } 110 | 111 | void Update() 112 | { 113 | if (!m_Dragging) 114 | { 115 | return; 116 | } 117 | if (Input.touchCount >= m_Id + 1 && m_Id != -1) 118 | { 119 | #if !UNITY_EDITOR 120 | 121 | if (controlStyle == ControlStyle.Swipe) 122 | { 123 | m_Center = m_PreviousTouchPos; 124 | m_PreviousTouchPos = Input.touches[m_Id].position; 125 | } 126 | Vector2 pointerDelta = new Vector2(Input.touches[m_Id].position.x - m_Center.x , Input.touches[m_Id].position.y - m_Center.y).normalized; 127 | pointerDelta.x *= Xsensitivity; 128 | pointerDelta.y *= Ysensitivity; 129 | #else 130 | Vector2 pointerDelta; 131 | pointerDelta.x = Input.mousePosition.x - m_PreviousMouse.x; 132 | pointerDelta.y = Input.mousePosition.y - m_PreviousMouse.y; 133 | m_PreviousMouse = new Vector3(Input.mousePosition.x, Input.mousePosition.y, 0f); 134 | #endif 135 | UpdateVirtualAxes(new Vector3(pointerDelta.x, pointerDelta.y, 0)); 136 | } 137 | } 138 | 139 | 140 | public void OnPointerUp(PointerEventData data) 141 | { 142 | m_Dragging = false; 143 | m_Id = -1; 144 | UpdateVirtualAxes(Vector3.zero); 145 | } 146 | 147 | void OnDisable() 148 | { 149 | if (CrossPlatformInputManager.AxisExists(horizontalAxisName)) 150 | CrossPlatformInputManager.UnRegisterVirtualAxis(horizontalAxisName); 151 | 152 | if (CrossPlatformInputManager.AxisExists(verticalAxisName)) 153 | CrossPlatformInputManager.UnRegisterVirtualAxis(verticalAxisName); 154 | } 155 | } 156 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/TouchPad.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1caf40fc8bebb6b43b2550c05ca791d6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/VirtualInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace UnityStandardAssets.CrossPlatformInput 7 | { 8 | public abstract class VirtualInput 9 | { 10 | public Vector3 virtualMousePosition { get; private set; } 11 | 12 | 13 | protected Dictionary m_VirtualAxes = 14 | new Dictionary(); 15 | // Dictionary to store the name relating to the virtual axes 16 | protected Dictionary m_VirtualButtons = 17 | new Dictionary(); 18 | protected List m_AlwaysUseVirtual = new List(); 19 | // list of the axis and button names that have been flagged to always use a virtual axis or button 20 | 21 | 22 | public bool AxisExists(string name) 23 | { 24 | return m_VirtualAxes.ContainsKey(name); 25 | } 26 | 27 | public bool ButtonExists(string name) 28 | { 29 | return m_VirtualButtons.ContainsKey(name); 30 | } 31 | 32 | 33 | public void RegisterVirtualAxis(CrossPlatformInputManager.VirtualAxis axis) 34 | { 35 | // check if we already have an axis with that name and log and error if we do 36 | if (m_VirtualAxes.ContainsKey(axis.name)) 37 | { 38 | Debug.LogError("There is already a virtual axis named " + axis.name + " registered."); 39 | } 40 | else 41 | { 42 | // add any new axes 43 | m_VirtualAxes.Add(axis.name, axis); 44 | 45 | // if we dont want to match with the input manager setting then revert to always using virtual 46 | if (!axis.matchWithInputManager) 47 | { 48 | m_AlwaysUseVirtual.Add(axis.name); 49 | } 50 | } 51 | } 52 | 53 | 54 | public void RegisterVirtualButton(CrossPlatformInputManager.VirtualButton button) 55 | { 56 | // check if already have a buttin with that name and log an error if we do 57 | if (m_VirtualButtons.ContainsKey(button.name)) 58 | { 59 | Debug.LogError("There is already a virtual button named " + button.name + " registered."); 60 | } 61 | else 62 | { 63 | // add any new buttons 64 | m_VirtualButtons.Add(button.name, button); 65 | 66 | // if we dont want to match to the input manager then always use a virtual axis 67 | if (!button.matchWithInputManager) 68 | { 69 | m_AlwaysUseVirtual.Add(button.name); 70 | } 71 | } 72 | } 73 | 74 | 75 | public void UnRegisterVirtualAxis(string name) 76 | { 77 | // if we have an axis with that name then remove it from our dictionary of registered axes 78 | if (m_VirtualAxes.ContainsKey(name)) 79 | { 80 | m_VirtualAxes.Remove(name); 81 | } 82 | } 83 | 84 | 85 | public void UnRegisterVirtualButton(string name) 86 | { 87 | // if we have a button with this name then remove it from our dictionary of registered buttons 88 | if (m_VirtualButtons.ContainsKey(name)) 89 | { 90 | m_VirtualButtons.Remove(name); 91 | } 92 | } 93 | 94 | 95 | // returns a reference to a named virtual axis if it exists otherwise null 96 | public CrossPlatformInputManager.VirtualAxis VirtualAxisReference(string name) 97 | { 98 | return m_VirtualAxes.ContainsKey(name) ? m_VirtualAxes[name] : null; 99 | } 100 | 101 | 102 | public void SetVirtualMousePositionX(float f) 103 | { 104 | virtualMousePosition = new Vector3(f, virtualMousePosition.y, virtualMousePosition.z); 105 | } 106 | 107 | 108 | public void SetVirtualMousePositionY(float f) 109 | { 110 | virtualMousePosition = new Vector3(virtualMousePosition.x, f, virtualMousePosition.z); 111 | } 112 | 113 | 114 | public void SetVirtualMousePositionZ(float f) 115 | { 116 | virtualMousePosition = new Vector3(virtualMousePosition.x, virtualMousePosition.y, f); 117 | } 118 | 119 | 120 | public abstract float GetAxis(string name, bool raw); 121 | 122 | public abstract bool GetButton(string name); 123 | public abstract bool GetButtonDown(string name); 124 | public abstract bool GetButtonUp(string name); 125 | 126 | public abstract void SetButtonDown(string name); 127 | public abstract void SetButtonUp(string name); 128 | public abstract void SetAxisPositive(string name); 129 | public abstract void SetAxisNegative(string name); 130 | public abstract void SetAxisZero(string name); 131 | public abstract void SetAxis(string name, float value); 132 | public abstract Vector3 MousePosition(); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/VirtualInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f57aeb1b8dce3342bea5c28ac17db24 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 153c77e0022ff3148beba89b18de3476 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 11fa60a4f5bdba144a008a674f32eb19 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/NavyGrid.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: NavyGrid 10 | m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSION _EMISSIONMAP _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME 12 | _UVSEC_UV1 13 | m_LightmapFlags: 1 14 | m_CustomRenderQueue: -1 15 | stringTagMap: {} 16 | m_SavedProperties: 17 | serializedVersion: 2 18 | m_TexEnvs: 19 | - first: 20 | name: _BumpMap 21 | second: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - first: 26 | name: _DetailAlbedoMap 27 | second: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - first: 32 | name: _DetailMask 33 | second: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - first: 38 | name: _DetailNormalMap 39 | second: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - first: 44 | name: _EmissionMap 45 | second: 46 | m_Texture: {fileID: 2800000, guid: a196fd6788131ec459bfb26012466fc1, type: 3} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - first: 50 | name: _MainTex 51 | second: 52 | m_Texture: {fileID: 2800000, guid: 86e4aa9207c9e2740b6ace599d659c05, type: 3} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - first: 56 | name: _MetallicGlossMap 57 | second: 58 | m_Texture: {fileID: 0} 59 | m_Scale: {x: 1, y: 1} 60 | m_Offset: {x: 0, y: 0} 61 | - first: 62 | name: _Occlusion 63 | second: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | - first: 68 | name: _OcclusionMap 69 | second: 70 | m_Texture: {fileID: 0} 71 | m_Scale: {x: 1, y: 1} 72 | m_Offset: {x: 0, y: 0} 73 | - first: 74 | name: _ParallaxMap 75 | second: 76 | m_Texture: {fileID: 0} 77 | m_Scale: {x: 1, y: 1} 78 | m_Offset: {x: 0, y: 0} 79 | - first: 80 | name: _SpecGlossMap 81 | second: 82 | m_Texture: {fileID: 0} 83 | m_Scale: {x: 1, y: 1} 84 | m_Offset: {x: 0, y: 0} 85 | m_Floats: 86 | - first: 87 | name: _AlphaTestRef 88 | second: 0.5 89 | - first: 90 | name: _BumpScale 91 | second: 1 92 | - first: 93 | name: _Cutoff 94 | second: 0.5 95 | - first: 96 | name: _DetailNormalMapScale 97 | second: 1 98 | - first: 99 | name: _DstBlend 100 | second: 0 101 | - first: 102 | name: _EmissionScaleUI 103 | second: 2 104 | - first: 105 | name: _GlossMapScale 106 | second: 1 107 | - first: 108 | name: _Glossiness 109 | second: 0.068 110 | - first: 111 | name: _GlossyReflections 112 | second: 1 113 | - first: 114 | name: _Lightmapping 115 | second: 1 116 | - first: 117 | name: _Metallic 118 | second: 0.1 119 | - first: 120 | name: _Mode 121 | second: 0 122 | - first: 123 | name: _OcclusionStrength 124 | second: 1 125 | - first: 126 | name: _Parallax 127 | second: 0.02 128 | - first: 129 | name: _SmoothnessTextureChannel 130 | second: 0 131 | - first: 132 | name: _SpecularHighlights 133 | second: 1 134 | - first: 135 | name: _SrcBlend 136 | second: 1 137 | - first: 138 | name: _UVSec 139 | second: 0 140 | - first: 141 | name: _ZWrite 142 | second: 1 143 | m_Colors: 144 | - first: 145 | name: _Color 146 | second: {r: 0.20588237, g: 0.20588237, b: 0.20588237, a: 1} 147 | - first: 148 | name: _EmissionColor 149 | second: {r: 1.3348337, g: 1.3348337, b: 1.3348337, a: 1.3348337} 150 | - first: 151 | name: _EmissionColorUI 152 | second: {r: 0, g: 0, b: 0, a: 1} 153 | - first: 154 | name: _EmissionColorWithMapUI 155 | second: {r: 1, g: 1, b: 1, a: 1} 156 | - first: 157 | name: _SpecColor 158 | second: {r: 0.11764706, g: 0.11764706, b: 0.11764706, a: 1} 159 | - first: 160 | name: _SpecularColor 161 | second: {r: 0.15686275, g: 0.15686275, b: 0.15686275, a: 1} 162 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/NavyGrid.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 76ff537c8e1a84345868e6aeee938ab3 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/NavySmooth.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: NavySmooth 10 | m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSION _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME 12 | _UVSEC_UV1 13 | m_LightmapFlags: 1 14 | m_CustomRenderQueue: -1 15 | stringTagMap: {} 16 | m_SavedProperties: 17 | serializedVersion: 2 18 | m_TexEnvs: 19 | - first: 20 | name: _BumpMap 21 | second: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - first: 26 | name: _DetailAlbedoMap 27 | second: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - first: 32 | name: _DetailMask 33 | second: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - first: 38 | name: _DetailNormalMap 39 | second: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - first: 44 | name: _EmissionMap 45 | second: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - first: 50 | name: _MainTex 51 | second: 52 | m_Texture: {fileID: 2800000, guid: 86e4aa9207c9e2740b6ace599d659c05, type: 3} 53 | m_Scale: {x: 4, y: 4} 54 | m_Offset: {x: 0, y: 0} 55 | - first: 56 | name: _MetallicGlossMap 57 | second: 58 | m_Texture: {fileID: 0} 59 | m_Scale: {x: 1, y: 1} 60 | m_Offset: {x: 0, y: 0} 61 | - first: 62 | name: _Occlusion 63 | second: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | - first: 68 | name: _OcclusionMap 69 | second: 70 | m_Texture: {fileID: 0} 71 | m_Scale: {x: 1, y: 1} 72 | m_Offset: {x: 0, y: 0} 73 | - first: 74 | name: _ParallaxMap 75 | second: 76 | m_Texture: {fileID: 0} 77 | m_Scale: {x: 1, y: 1} 78 | m_Offset: {x: 0, y: 0} 79 | - first: 80 | name: _SpecGlossMap 81 | second: 82 | m_Texture: {fileID: 0} 83 | m_Scale: {x: 1, y: 1} 84 | m_Offset: {x: 0, y: 0} 85 | m_Floats: 86 | - first: 87 | name: _AlphaTestRef 88 | second: 0.5 89 | - first: 90 | name: _BumpScale 91 | second: 1 92 | - first: 93 | name: _Cutoff 94 | second: 0.5 95 | - first: 96 | name: _DetailNormalMapScale 97 | second: 1 98 | - first: 99 | name: _DstBlend 100 | second: 0 101 | - first: 102 | name: _EmissionScaleUI 103 | second: 0 104 | - first: 105 | name: _GlossMapScale 106 | second: 1 107 | - first: 108 | name: _Glossiness 109 | second: 0.1 110 | - first: 111 | name: _GlossyReflections 112 | second: 1 113 | - first: 114 | name: _Lightmapping 115 | second: 1 116 | - first: 117 | name: _Metallic 118 | second: 0.1 119 | - first: 120 | name: _Mode 121 | second: 0 122 | - first: 123 | name: _OcclusionStrength 124 | second: 1 125 | - first: 126 | name: _Parallax 127 | second: 0.02 128 | - first: 129 | name: _SmoothnessTextureChannel 130 | second: 0 131 | - first: 132 | name: _SpecularHighlights 133 | second: 1 134 | - first: 135 | name: _SrcBlend 136 | second: 1 137 | - first: 138 | name: _UVSec 139 | second: 0 140 | - first: 141 | name: _ZWrite 142 | second: 1 143 | m_Colors: 144 | - first: 145 | name: _Color 146 | second: {r: 1, g: 1, b: 1, a: 1} 147 | - first: 148 | name: _EmissionColor 149 | second: {r: 0, g: 0, b: 0, a: 0} 150 | - first: 151 | name: _EmissionColorUI 152 | second: {r: 0, g: 0, b: 0, a: 1} 153 | - first: 154 | name: _EmissionColorWithMapUI 155 | second: {r: 1, g: 1, b: 1, a: 1} 156 | - first: 157 | name: _SpecColor 158 | second: {r: 0.11764706, g: 0.11764706, b: 0.11764706, a: 1} 159 | - first: 160 | name: _SpecularColor 161 | second: {r: 0.15686275, g: 0.15686275, b: 0.15686275, a: 1} 162 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/NavySmooth.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1032d41f900276c40a9dd24f55b7d420 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/PinkGrid.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 4 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: PinkGrid 10 | m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSION _EMISSIONMAP _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME 12 | _UVSEC_UV1 13 | m_CustomRenderQueue: -1 14 | m_SavedProperties: 15 | serializedVersion: 2 16 | m_TexEnvs: 17 | data: 18 | first: 19 | name: _MainTex 20 | second: 21 | m_Texture: {fileID: 2800000, guid: 580615edf5e29d245af58fc5fe2b06ac, type: 3} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | data: 25 | first: 26 | name: _BumpMap 27 | second: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | data: 32 | first: 33 | name: _DetailNormalMap 34 | second: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | data: 39 | first: 40 | name: _EmissionMap 41 | second: 42 | m_Texture: {fileID: 2800000, guid: a196fd6788131ec459bfb26012466fc1, type: 3} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | data: 46 | first: 47 | name: _ParallaxMap 48 | second: 49 | m_Texture: {fileID: 0} 50 | m_Scale: {x: 1, y: 1} 51 | m_Offset: {x: 0, y: 0} 52 | data: 53 | first: 54 | name: _SpecGlossMap 55 | second: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | data: 60 | first: 61 | name: _DetailMask 62 | second: 63 | m_Texture: {fileID: 0} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | data: 67 | first: 68 | name: _DetailAlbedoMap 69 | second: 70 | m_Texture: {fileID: 0} 71 | m_Scale: {x: 1, y: 1} 72 | m_Offset: {x: 0, y: 0} 73 | data: 74 | first: 75 | name: _Occlusion 76 | second: 77 | m_Texture: {fileID: 0} 78 | m_Scale: {x: 1, y: 1} 79 | m_Offset: {x: 0, y: 0} 80 | data: 81 | first: 82 | name: _OcclusionMap 83 | second: 84 | m_Texture: {fileID: 0} 85 | m_Scale: {x: 1, y: 1} 86 | m_Offset: {x: 0, y: 0} 87 | data: 88 | first: 89 | name: _MetallicGlossMap 90 | second: 91 | m_Texture: {fileID: 0} 92 | m_Scale: {x: 1, y: 1} 93 | m_Offset: {x: 0, y: 0} 94 | m_Floats: 95 | data: 96 | first: 97 | name: _AlphaTestRef 98 | second: .5 99 | data: 100 | first: 101 | name: _Lightmapping 102 | second: 1 103 | data: 104 | first: 105 | name: _SrcBlend 106 | second: 1 107 | data: 108 | first: 109 | name: _DstBlend 110 | second: 0 111 | data: 112 | first: 113 | name: _Parallax 114 | second: .0199999996 115 | data: 116 | first: 117 | name: _ZWrite 118 | second: 1 119 | data: 120 | first: 121 | name: _Glossiness 122 | second: .100000001 123 | data: 124 | first: 125 | name: _BumpScale 126 | second: 1 127 | data: 128 | first: 129 | name: _OcclusionStrength 130 | second: 1 131 | data: 132 | first: 133 | name: _DetailNormalMapScale 134 | second: 1 135 | data: 136 | first: 137 | name: _UVSec 138 | second: 0 139 | data: 140 | first: 141 | name: _Mode 142 | second: 0 143 | data: 144 | first: 145 | name: _EmissionScaleUI 146 | second: 2 147 | data: 148 | first: 149 | name: _Metallic 150 | second: .100000001 151 | m_Colors: 152 | data: 153 | first: 154 | name: _EmissionColor 155 | second: {r: 1.33483374, g: 1.33483374, b: 1.33483374, a: 1.33483374} 156 | data: 157 | first: 158 | name: _Color 159 | second: {r: 1, g: 1, b: 1, a: 1} 160 | data: 161 | first: 162 | name: _SpecularColor 163 | second: {r: .156862751, g: .156862751, b: .156862751, a: 1} 164 | data: 165 | first: 166 | name: _EmissionColorUI 167 | second: {r: 0, g: 0, b: 0, a: 1} 168 | data: 169 | first: 170 | name: _EmissionColorWithMapUI 171 | second: {r: 1, g: 1, b: 1, a: 1} 172 | data: 173 | first: 174 | name: _SpecColor 175 | second: {r: .117647059, g: .117647059, b: .117647059, a: 1} 176 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/PinkGrid.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c19a618a0bd9844583b91dca0875a34 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/PinkSmooth.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: PinkSmooth 10 | m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSION _EMISSIONMAP _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME 12 | _UVSEC_UV1 13 | m_LightmapFlags: 1 14 | m_CustomRenderQueue: -1 15 | stringTagMap: {} 16 | m_SavedProperties: 17 | serializedVersion: 2 18 | m_TexEnvs: 19 | - first: 20 | name: _BumpMap 21 | second: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - first: 26 | name: _DetailAlbedoMap 27 | second: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - first: 32 | name: _DetailMask 33 | second: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - first: 38 | name: _DetailNormalMap 39 | second: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - first: 44 | name: _EmissionMap 45 | second: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - first: 50 | name: _MainTex 51 | second: 52 | m_Texture: {fileID: 2800000, guid: 580615edf5e29d245af58fc5fe2b06ac, type: 3} 53 | m_Scale: {x: 4, y: 4} 54 | m_Offset: {x: 0, y: 0} 55 | - first: 56 | name: _MetallicGlossMap 57 | second: 58 | m_Texture: {fileID: 0} 59 | m_Scale: {x: 1, y: 1} 60 | m_Offset: {x: 0, y: 0} 61 | - first: 62 | name: _Occlusion 63 | second: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | - first: 68 | name: _OcclusionMap 69 | second: 70 | m_Texture: {fileID: 0} 71 | m_Scale: {x: 1, y: 1} 72 | m_Offset: {x: 0, y: 0} 73 | - first: 74 | name: _ParallaxMap 75 | second: 76 | m_Texture: {fileID: 0} 77 | m_Scale: {x: 1, y: 1} 78 | m_Offset: {x: 0, y: 0} 79 | - first: 80 | name: _SpecGlossMap 81 | second: 82 | m_Texture: {fileID: 0} 83 | m_Scale: {x: 1, y: 1} 84 | m_Offset: {x: 0, y: 0} 85 | m_Floats: 86 | - first: 87 | name: _AlphaTestRef 88 | second: 0.5 89 | - first: 90 | name: _BumpScale 91 | second: 1 92 | - first: 93 | name: _Cutoff 94 | second: 0.5 95 | - first: 96 | name: _DetailNormalMapScale 97 | second: 1 98 | - first: 99 | name: _DstBlend 100 | second: 0 101 | - first: 102 | name: _EmissionScaleUI 103 | second: 2 104 | - first: 105 | name: _GlossMapScale 106 | second: 1 107 | - first: 108 | name: _Glossiness 109 | second: 0.1 110 | - first: 111 | name: _GlossyReflections 112 | second: 1 113 | - first: 114 | name: _Lightmapping 115 | second: 1 116 | - first: 117 | name: _Metallic 118 | second: 0.1 119 | - first: 120 | name: _Mode 121 | second: 0 122 | - first: 123 | name: _OcclusionStrength 124 | second: 1 125 | - first: 126 | name: _Parallax 127 | second: 0.02 128 | - first: 129 | name: _SmoothnessTextureChannel 130 | second: 0 131 | - first: 132 | name: _SpecularHighlights 133 | second: 1 134 | - first: 135 | name: _SrcBlend 136 | second: 1 137 | - first: 138 | name: _UVSec 139 | second: 0 140 | - first: 141 | name: _ZWrite 142 | second: 1 143 | m_Colors: 144 | - first: 145 | name: _Color 146 | second: {r: 1, g: 1, b: 1, a: 1} 147 | - first: 148 | name: _EmissionColor 149 | second: {r: 0, g: 0, b: 0, a: 1.3348337} 150 | - first: 151 | name: _EmissionColorUI 152 | second: {r: 0, g: 0, b: 0, a: 1} 153 | - first: 154 | name: _EmissionColorWithMapUI 155 | second: {r: 1, g: 1, b: 1, a: 1} 156 | - first: 157 | name: _SpecColor 158 | second: {r: 0.11764706, g: 0.11764706, b: 0.11764706, a: 1} 159 | - first: 160 | name: _SpecularColor 161 | second: {r: 0.15686275, g: 0.15686275, b: 0.15686275, a: 1} 162 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/PinkSmooth.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fed4e78bda2b3de45954637fee164b8c 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/YellowGrid.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 4 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: YellowGrid 10 | m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSION _EMISSIONMAP _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME 12 | _UVSEC_UV1 13 | m_CustomRenderQueue: -1 14 | m_SavedProperties: 15 | serializedVersion: 2 16 | m_TexEnvs: 17 | data: 18 | first: 19 | name: _MainTex 20 | second: 21 | m_Texture: {fileID: 2800000, guid: b4646ae63b0bcca40b1bdde3b87e01bf, type: 3} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | data: 25 | first: 26 | name: _BumpMap 27 | second: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | data: 32 | first: 33 | name: _DetailNormalMap 34 | second: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | data: 39 | first: 40 | name: _EmissionMap 41 | second: 42 | m_Texture: {fileID: 2800000, guid: a196fd6788131ec459bfb26012466fc1, type: 3} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | data: 46 | first: 47 | name: _ParallaxMap 48 | second: 49 | m_Texture: {fileID: 0} 50 | m_Scale: {x: 1, y: 1} 51 | m_Offset: {x: 0, y: 0} 52 | data: 53 | first: 54 | name: _SpecGlossMap 55 | second: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | data: 60 | first: 61 | name: _DetailMask 62 | second: 63 | m_Texture: {fileID: 0} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | data: 67 | first: 68 | name: _DetailAlbedoMap 69 | second: 70 | m_Texture: {fileID: 0} 71 | m_Scale: {x: 1, y: 1} 72 | m_Offset: {x: 0, y: 0} 73 | data: 74 | first: 75 | name: _Occlusion 76 | second: 77 | m_Texture: {fileID: 0} 78 | m_Scale: {x: 1, y: 1} 79 | m_Offset: {x: 0, y: 0} 80 | data: 81 | first: 82 | name: _OcclusionMap 83 | second: 84 | m_Texture: {fileID: 0} 85 | m_Scale: {x: 1, y: 1} 86 | m_Offset: {x: 0, y: 0} 87 | data: 88 | first: 89 | name: _MetallicGlossMap 90 | second: 91 | m_Texture: {fileID: 0} 92 | m_Scale: {x: 1, y: 1} 93 | m_Offset: {x: 0, y: 0} 94 | m_Floats: 95 | data: 96 | first: 97 | name: _AlphaTestRef 98 | second: .5 99 | data: 100 | first: 101 | name: _Lightmapping 102 | second: 1 103 | data: 104 | first: 105 | name: _SrcBlend 106 | second: 1 107 | data: 108 | first: 109 | name: _DstBlend 110 | second: 0 111 | data: 112 | first: 113 | name: _Parallax 114 | second: .0199999996 115 | data: 116 | first: 117 | name: _ZWrite 118 | second: 1 119 | data: 120 | first: 121 | name: _Glossiness 122 | second: .100000001 123 | data: 124 | first: 125 | name: _BumpScale 126 | second: 1 127 | data: 128 | first: 129 | name: _OcclusionStrength 130 | second: 1 131 | data: 132 | first: 133 | name: _DetailNormalMapScale 134 | second: 1 135 | data: 136 | first: 137 | name: _UVSec 138 | second: 0 139 | data: 140 | first: 141 | name: _Mode 142 | second: 0 143 | data: 144 | first: 145 | name: _EmissionScaleUI 146 | second: 2 147 | data: 148 | first: 149 | name: _Metallic 150 | second: .100000001 151 | m_Colors: 152 | data: 153 | first: 154 | name: _EmissionColor 155 | second: {r: 1.33483374, g: 1.33483374, b: 1.33483374, a: 1.33483374} 156 | data: 157 | first: 158 | name: _Color 159 | second: {r: 1, g: 1, b: 1, a: 1} 160 | data: 161 | first: 162 | name: _SpecularColor 163 | second: {r: .156862751, g: .156862751, b: .156862751, a: 1} 164 | data: 165 | first: 166 | name: _EmissionColorUI 167 | second: {r: 0, g: 0, b: 0, a: 1} 168 | data: 169 | first: 170 | name: _EmissionColorWithMapUI 171 | second: {r: 1, g: 1, b: 1, a: 1} 172 | data: 173 | first: 174 | name: _SpecColor 175 | second: {r: .117647059, g: .117647059, b: .117647059, a: 1} 176 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/YellowGrid.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82096aab38f01cb40a1cbf8629a810ba 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/YellowSmooth.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 4 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: YellowSmooth 10 | m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSIONMAP _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME 12 | _UVSEC_UV1 13 | m_CustomRenderQueue: -1 14 | m_SavedProperties: 15 | serializedVersion: 2 16 | m_TexEnvs: 17 | data: 18 | first: 19 | name: _MainTex 20 | second: 21 | m_Texture: {fileID: 2800000, guid: b4646ae63b0bcca40b1bdde3b87e01bf, type: 3} 22 | m_Scale: {x: 4, y: 4} 23 | m_Offset: {x: 0, y: 0} 24 | data: 25 | first: 26 | name: _BumpMap 27 | second: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | data: 32 | first: 33 | name: _DetailNormalMap 34 | second: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | data: 39 | first: 40 | name: _EmissionMap 41 | second: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | data: 46 | first: 47 | name: _ParallaxMap 48 | second: 49 | m_Texture: {fileID: 0} 50 | m_Scale: {x: 1, y: 1} 51 | m_Offset: {x: 0, y: 0} 52 | data: 53 | first: 54 | name: _SpecGlossMap 55 | second: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | data: 60 | first: 61 | name: _DetailMask 62 | second: 63 | m_Texture: {fileID: 0} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | data: 67 | first: 68 | name: _DetailAlbedoMap 69 | second: 70 | m_Texture: {fileID: 0} 71 | m_Scale: {x: 1, y: 1} 72 | m_Offset: {x: 0, y: 0} 73 | data: 74 | first: 75 | name: _Occlusion 76 | second: 77 | m_Texture: {fileID: 0} 78 | m_Scale: {x: 1, y: 1} 79 | m_Offset: {x: 0, y: 0} 80 | data: 81 | first: 82 | name: _OcclusionMap 83 | second: 84 | m_Texture: {fileID: 0} 85 | m_Scale: {x: 1, y: 1} 86 | m_Offset: {x: 0, y: 0} 87 | data: 88 | first: 89 | name: _MetallicGlossMap 90 | second: 91 | m_Texture: {fileID: 0} 92 | m_Scale: {x: 1, y: 1} 93 | m_Offset: {x: 0, y: 0} 94 | m_Floats: 95 | data: 96 | first: 97 | name: _AlphaTestRef 98 | second: .5 99 | data: 100 | first: 101 | name: _Lightmapping 102 | second: 1 103 | data: 104 | first: 105 | name: _SrcBlend 106 | second: 1 107 | data: 108 | first: 109 | name: _DstBlend 110 | second: 0 111 | data: 112 | first: 113 | name: _Parallax 114 | second: .0199999996 115 | data: 116 | first: 117 | name: _ZWrite 118 | second: 1 119 | data: 120 | first: 121 | name: _Glossiness 122 | second: .100000001 123 | data: 124 | first: 125 | name: _BumpScale 126 | second: 1 127 | data: 128 | first: 129 | name: _OcclusionStrength 130 | second: 1 131 | data: 132 | first: 133 | name: _DetailNormalMapScale 134 | second: 1 135 | data: 136 | first: 137 | name: _UVSec 138 | second: 0 139 | data: 140 | first: 141 | name: _Mode 142 | second: 0 143 | data: 144 | first: 145 | name: _EmissionScaleUI 146 | second: 2 147 | data: 148 | first: 149 | name: _Metallic 150 | second: .100000001 151 | m_Colors: 152 | data: 153 | first: 154 | name: _EmissionColor 155 | second: {r: 0, g: 0, b: 0, a: 1.33483374} 156 | data: 157 | first: 158 | name: _Color 159 | second: {r: 1, g: 1, b: 1, a: 1} 160 | data: 161 | first: 162 | name: _SpecularColor 163 | second: {r: .156862751, g: .156862751, b: .156862751, a: 1} 164 | data: 165 | first: 166 | name: _EmissionColorUI 167 | second: {r: 0, g: 0, b: 0, a: 1} 168 | data: 169 | first: 170 | name: _EmissionColorWithMapUI 171 | second: {r: 1, g: 1, b: 1, a: 1} 172 | data: 173 | first: 174 | name: _SpecColor 175 | second: {r: .117647059, g: .117647059, b: .117647059, a: 1} 176 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/YellowSmooth.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6e1d36c4bbd37d54f9ea183e4f5fd656 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec897f9ee2210c749ad1898ea59326f9 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/GridEmissive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinzEugn/UnityScatterplot/3c4332ecc61a2636824fb28c78f20463d4298e55/Assets/Standard Assets/Prototyping/Textures/GridEmissive.png -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/GridEmissive.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a196fd6788131ec459bfb26012466fc1 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: 2 31 | aniso: 4 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchMauveAlbedo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinzEugn/UnityScatterplot/3c4332ecc61a2636824fb28c78f20463d4298e55/Assets/Standard Assets/Prototyping/Textures/SwatchMauveAlbedo.png -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchMauveAlbedo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c3edc74ae8207fd45a93c4ed8ee27567 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchNavyAlbedo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinzEugn/UnityScatterplot/3c4332ecc61a2636824fb28c78f20463d4298e55/Assets/Standard Assets/Prototyping/Textures/SwatchNavyAlbedo.png -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchNavyAlbedo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86e4aa9207c9e2740b6ace599d659c05 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 32 29 | textureSettings: 30 | filterMode: -1 31 | aniso: 0 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchNavyDarkAlbedo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinzEugn/UnityScatterplot/3c4332ecc61a2636824fb28c78f20463d4298e55/Assets/Standard Assets/Prototyping/Textures/SwatchNavyDarkAlbedo.png -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchNavyDarkAlbedo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a336ccf90791f9841b7e680c010d1e88 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchOrangeAlbedo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinzEugn/UnityScatterplot/3c4332ecc61a2636824fb28c78f20463d4298e55/Assets/Standard Assets/Prototyping/Textures/SwatchOrangeAlbedo.png -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchOrangeAlbedo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8b939c5b46fae7e49af7d85f731ba4ec 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchPinkDAlbedo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinzEugn/UnityScatterplot/3c4332ecc61a2636824fb28c78f20463d4298e55/Assets/Standard Assets/Prototyping/Textures/SwatchPinkDAlbedo.png -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchPinkDAlbedo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 580615edf5e29d245af58fc5fe2b06ac 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 32 29 | textureSettings: 30 | filterMode: -1 31 | aniso: 0 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchTealAlbedo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinzEugn/UnityScatterplot/3c4332ecc61a2636824fb28c78f20463d4298e55/Assets/Standard Assets/Prototyping/Textures/SwatchTealAlbedo.png -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchTealAlbedo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 590546bcbd472d94e874f6e0c76cc266 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchTurquoiseAlbedo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinzEugn/UnityScatterplot/3c4332ecc61a2636824fb28c78f20463d4298e55/Assets/Standard Assets/Prototyping/Textures/SwatchTurquoiseAlbedo.png -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchTurquoiseAlbedo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c4d7ee42c7d4f944b2ce9d370fa265c 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 32 29 | textureSettings: 30 | filterMode: -1 31 | aniso: 0 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchWhiteAlbedo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinzEugn/UnityScatterplot/3c4332ecc61a2636824fb28c78f20463d4298e55/Assets/Standard Assets/Prototyping/Textures/SwatchWhiteAlbedo.png -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchWhiteAlbedo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d0b29cecf2678b41982d2173d3670ff 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchYellowAlbedo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PrinzEugn/UnityScatterplot/3c4332ecc61a2636824fb28c78f20463d4298e55/Assets/Standard Assets/Prototyping/Textures/SwatchYellowAlbedo.png -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchYellowAlbedo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4646ae63b0bcca40b1bdde3b87e01bf 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 32 29 | textureSettings: 30 | filterMode: -1 31 | aniso: 0 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: efcf5fed8b5889a45b59e652ad41a204 3 | folderAsset: yes 4 | timeCreated: 1490754424 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ActivateTrigger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using Object = UnityEngine.Object; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | public class ActivateTrigger : MonoBehaviour 8 | { 9 | // A multi-purpose script which causes an action to occur when 10 | // a trigger collider is entered. 11 | public enum Mode 12 | { 13 | Trigger = 0, // Just broadcast the action on to the target 14 | Replace = 1, // replace target with source 15 | Activate = 2, // Activate the target GameObject 16 | Enable = 3, // Enable a component 17 | Animate = 4, // Start animation on target 18 | Deactivate = 5 // Decativate target GameObject 19 | } 20 | 21 | public Mode action = Mode.Activate; // The action to accomplish 22 | public Object target; // The game object to affect. If none, the trigger work on this game object 23 | public GameObject source; 24 | public int triggerCount = 1; 25 | public bool repeatTrigger = false; 26 | 27 | 28 | private void DoActivateTrigger() 29 | { 30 | triggerCount--; 31 | 32 | if (triggerCount == 0 || repeatTrigger) 33 | { 34 | Object currentTarget = target ?? gameObject; 35 | Behaviour targetBehaviour = currentTarget as Behaviour; 36 | GameObject targetGameObject = currentTarget as GameObject; 37 | if (targetBehaviour != null) 38 | { 39 | targetGameObject = targetBehaviour.gameObject; 40 | } 41 | 42 | switch (action) 43 | { 44 | case Mode.Trigger: 45 | if (targetGameObject != null) 46 | { 47 | targetGameObject.BroadcastMessage("DoActivateTrigger"); 48 | } 49 | break; 50 | case Mode.Replace: 51 | if (source != null) 52 | { 53 | if (targetGameObject != null) 54 | { 55 | Instantiate(source, targetGameObject.transform.position, 56 | targetGameObject.transform.rotation); 57 | DestroyObject(targetGameObject); 58 | } 59 | } 60 | break; 61 | case Mode.Activate: 62 | if (targetGameObject != null) 63 | { 64 | targetGameObject.SetActive(true); 65 | } 66 | break; 67 | case Mode.Enable: 68 | if (targetBehaviour != null) 69 | { 70 | targetBehaviour.enabled = true; 71 | } 72 | break; 73 | case Mode.Animate: 74 | if (targetGameObject != null) 75 | { 76 | targetGameObject.GetComponent().Play(); 77 | } 78 | break; 79 | case Mode.Deactivate: 80 | if (targetGameObject != null) 81 | { 82 | targetGameObject.SetActive(false); 83 | } 84 | break; 85 | } 86 | } 87 | } 88 | 89 | 90 | private void OnTriggerEnter(Collider other) 91 | { 92 | DoActivateTrigger(); 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ActivateTrigger.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c8634e062924929664361c08745211fb 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/AutoMobileShaderSwitch.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c4978ff6447f9040b84acc89b0bbdc8 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/AutoMoveAndRotate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class AutoMoveAndRotate : MonoBehaviour 7 | { 8 | public Vector3andSpace moveUnitsPerSecond; 9 | public Vector3andSpace rotateDegreesPerSecond; 10 | public bool ignoreTimescale; 11 | private float m_LastRealTime; 12 | 13 | 14 | private void Start() 15 | { 16 | m_LastRealTime = Time.realtimeSinceStartup; 17 | } 18 | 19 | 20 | // Update is called once per frame 21 | private void Update() 22 | { 23 | float deltaTime = Time.deltaTime; 24 | if (ignoreTimescale) 25 | { 26 | deltaTime = (Time.realtimeSinceStartup - m_LastRealTime); 27 | m_LastRealTime = Time.realtimeSinceStartup; 28 | } 29 | transform.Translate(moveUnitsPerSecond.value*deltaTime, moveUnitsPerSecond.space); 30 | transform.Rotate(rotateDegreesPerSecond.value*deltaTime, moveUnitsPerSecond.space); 31 | } 32 | 33 | 34 | [Serializable] 35 | public class Vector3andSpace 36 | { 37 | public Vector3 value; 38 | public Space space = Space.Self; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/AutoMoveAndRotate.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a1347817507220a4384f3ff6f7c24546 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/CameraRefocus.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class CameraRefocus 7 | { 8 | public Camera Camera; 9 | public Vector3 Lookatpoint; 10 | public Transform Parent; 11 | 12 | private Vector3 m_OrigCameraPos; 13 | private bool m_Refocus; 14 | 15 | 16 | public CameraRefocus(Camera camera, Transform parent, Vector3 origCameraPos) 17 | { 18 | m_OrigCameraPos = origCameraPos; 19 | Camera = camera; 20 | Parent = parent; 21 | } 22 | 23 | 24 | public void ChangeCamera(Camera camera) 25 | { 26 | Camera = camera; 27 | } 28 | 29 | 30 | public void ChangeParent(Transform parent) 31 | { 32 | Parent = parent; 33 | } 34 | 35 | 36 | public void GetFocusPoint() 37 | { 38 | RaycastHit hitInfo; 39 | if (Physics.Raycast(Parent.transform.position + m_OrigCameraPos, Parent.transform.forward, out hitInfo, 40 | 100f)) 41 | { 42 | Lookatpoint = hitInfo.point; 43 | m_Refocus = true; 44 | return; 45 | } 46 | m_Refocus = false; 47 | } 48 | 49 | 50 | public void SetFocusPoint() 51 | { 52 | if (m_Refocus) 53 | { 54 | Camera.transform.LookAt(Lookatpoint); 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/CameraRefocus.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1e2e7a54dcc8694ab1eca46d072f264 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/CurveControlledBob.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | [Serializable] 8 | public class CurveControlledBob 9 | { 10 | public float HorizontalBobRange = 0.33f; 11 | public float VerticalBobRange = 0.33f; 12 | public AnimationCurve Bobcurve = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(0.5f, 1f), 13 | new Keyframe(1f, 0f), new Keyframe(1.5f, -1f), 14 | new Keyframe(2f, 0f)); // sin curve for head bob 15 | public float VerticaltoHorizontalRatio = 1f; 16 | 17 | private float m_CyclePositionX; 18 | private float m_CyclePositionY; 19 | private float m_BobBaseInterval; 20 | private Vector3 m_OriginalCameraPosition; 21 | private float m_Time; 22 | 23 | 24 | public void Setup(Camera camera, float bobBaseInterval) 25 | { 26 | m_BobBaseInterval = bobBaseInterval; 27 | m_OriginalCameraPosition = camera.transform.localPosition; 28 | 29 | // get the length of the curve in time 30 | m_Time = Bobcurve[Bobcurve.length - 1].time; 31 | } 32 | 33 | 34 | public Vector3 DoHeadBob(float speed) 35 | { 36 | float xPos = m_OriginalCameraPosition.x + (Bobcurve.Evaluate(m_CyclePositionX)*HorizontalBobRange); 37 | float yPos = m_OriginalCameraPosition.y + (Bobcurve.Evaluate(m_CyclePositionY)*VerticalBobRange); 38 | 39 | m_CyclePositionX += (speed*Time.deltaTime)/m_BobBaseInterval; 40 | m_CyclePositionY += ((speed*Time.deltaTime)/m_BobBaseInterval)*VerticaltoHorizontalRatio; 41 | 42 | if (m_CyclePositionX > m_Time) 43 | { 44 | m_CyclePositionX = m_CyclePositionX - m_Time; 45 | } 46 | if (m_CyclePositionY > m_Time) 47 | { 48 | m_CyclePositionY = m_CyclePositionY - m_Time; 49 | } 50 | 51 | return new Vector3(xPos, yPos, 0f); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/CurveControlledBob.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 492f54f4accf00440828ffcb9e4fcc19 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/DragRigidbody.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | public class DragRigidbody : MonoBehaviour 8 | { 9 | const float k_Spring = 50.0f; 10 | const float k_Damper = 5.0f; 11 | const float k_Drag = 10.0f; 12 | const float k_AngularDrag = 5.0f; 13 | const float k_Distance = 0.2f; 14 | const bool k_AttachToCenterOfMass = false; 15 | 16 | private SpringJoint m_SpringJoint; 17 | 18 | 19 | private void Update() 20 | { 21 | // Make sure the user pressed the mouse down 22 | if (!Input.GetMouseButtonDown(0)) 23 | { 24 | return; 25 | } 26 | 27 | var mainCamera = FindCamera(); 28 | 29 | // We need to actually hit an object 30 | RaycastHit hit = new RaycastHit(); 31 | if ( 32 | !Physics.Raycast(mainCamera.ScreenPointToRay(Input.mousePosition).origin, 33 | mainCamera.ScreenPointToRay(Input.mousePosition).direction, out hit, 100, 34 | Physics.DefaultRaycastLayers)) 35 | { 36 | return; 37 | } 38 | // We need to hit a rigidbody that is not kinematic 39 | if (!hit.rigidbody || hit.rigidbody.isKinematic) 40 | { 41 | return; 42 | } 43 | 44 | if (!m_SpringJoint) 45 | { 46 | var go = new GameObject("Rigidbody dragger"); 47 | Rigidbody body = go.AddComponent(); 48 | m_SpringJoint = go.AddComponent(); 49 | body.isKinematic = true; 50 | } 51 | 52 | m_SpringJoint.transform.position = hit.point; 53 | m_SpringJoint.anchor = Vector3.zero; 54 | 55 | m_SpringJoint.spring = k_Spring; 56 | m_SpringJoint.damper = k_Damper; 57 | m_SpringJoint.maxDistance = k_Distance; 58 | m_SpringJoint.connectedBody = hit.rigidbody; 59 | 60 | StartCoroutine("DragObject", hit.distance); 61 | } 62 | 63 | 64 | private IEnumerator DragObject(float distance) 65 | { 66 | var oldDrag = m_SpringJoint.connectedBody.drag; 67 | var oldAngularDrag = m_SpringJoint.connectedBody.angularDrag; 68 | m_SpringJoint.connectedBody.drag = k_Drag; 69 | m_SpringJoint.connectedBody.angularDrag = k_AngularDrag; 70 | var mainCamera = FindCamera(); 71 | while (Input.GetMouseButton(0)) 72 | { 73 | var ray = mainCamera.ScreenPointToRay(Input.mousePosition); 74 | m_SpringJoint.transform.position = ray.GetPoint(distance); 75 | yield return null; 76 | } 77 | if (m_SpringJoint.connectedBody) 78 | { 79 | m_SpringJoint.connectedBody.drag = oldDrag; 80 | m_SpringJoint.connectedBody.angularDrag = oldAngularDrag; 81 | m_SpringJoint.connectedBody = null; 82 | } 83 | } 84 | 85 | 86 | private Camera FindCamera() 87 | { 88 | if (GetComponent()) 89 | { 90 | return GetComponent(); 91 | } 92 | 93 | return Camera.main; 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/DragRigidbody.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58650e15a2607e44daa0f150e0061d89 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/DynamicShadowSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class DynamicShadowSettings : MonoBehaviour 7 | { 8 | public Light sunLight; 9 | public float minHeight = 10; 10 | public float minShadowDistance = 80; 11 | public float minShadowBias = 1; 12 | public float maxHeight = 1000; 13 | public float maxShadowDistance = 10000; 14 | public float maxShadowBias = 0.1f; 15 | public float adaptTime = 1; 16 | 17 | private float m_SmoothHeight; 18 | private float m_ChangeSpeed; 19 | private float m_OriginalStrength = 1; 20 | 21 | 22 | private void Start() 23 | { 24 | m_OriginalStrength = sunLight.shadowStrength; 25 | } 26 | 27 | 28 | // Update is called once per frame 29 | private void Update() 30 | { 31 | Ray ray = new Ray(Camera.main.transform.position, -Vector3.up); 32 | RaycastHit hit; 33 | float height = transform.position.y; 34 | if (Physics.Raycast(ray, out hit)) 35 | { 36 | height = hit.distance; 37 | } 38 | 39 | if (Mathf.Abs(height - m_SmoothHeight) > 1) 40 | { 41 | m_SmoothHeight = Mathf.SmoothDamp(m_SmoothHeight, height, ref m_ChangeSpeed, adaptTime); 42 | } 43 | 44 | float i = Mathf.InverseLerp(minHeight, maxHeight, m_SmoothHeight); 45 | 46 | QualitySettings.shadowDistance = Mathf.Lerp(minShadowDistance, maxShadowDistance, i); 47 | sunLight.shadowBias = Mathf.Lerp(minShadowBias, maxShadowBias, 1 - ((1 - i)*(1 - i))); 48 | sunLight.shadowStrength = Mathf.Lerp(m_OriginalStrength, 0, i); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/DynamicShadowSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8566902b50d5bfb4fb7f8b89f9cdbe8b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/EventSystemChecker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | using UnityEngine.EventSystems; 5 | 6 | public class EventSystemChecker : MonoBehaviour 7 | { 8 | //public GameObject eventSystem; 9 | 10 | // Use this for initialization 11 | void Awake () 12 | { 13 | if(!FindObjectOfType()) 14 | { 15 | //Instantiate(eventSystem); 16 | GameObject obj = new GameObject("EventSystem"); 17 | obj.AddComponent(); 18 | obj.AddComponent().forceModuleActive = true; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/EventSystemChecker.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c0578910bbe00d43919a92c7b9893fe 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/FOVKick.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | [Serializable] 8 | public class FOVKick 9 | { 10 | public Camera Camera; // optional camera setup, if null the main camera will be used 11 | [HideInInspector] public float originalFov; // the original fov 12 | public float FOVIncrease = 3f; // the amount the field of view increases when going into a run 13 | public float TimeToIncrease = 1f; // the amount of time the field of view will increase over 14 | public float TimeToDecrease = 1f; // the amount of time the field of view will take to return to its original size 15 | public AnimationCurve IncreaseCurve; 16 | 17 | 18 | public void Setup(Camera camera) 19 | { 20 | CheckStatus(camera); 21 | 22 | Camera = camera; 23 | originalFov = camera.fieldOfView; 24 | } 25 | 26 | 27 | private void CheckStatus(Camera camera) 28 | { 29 | if (camera == null) 30 | { 31 | throw new Exception("FOVKick camera is null, please supply the camera to the constructor"); 32 | } 33 | 34 | if (IncreaseCurve == null) 35 | { 36 | throw new Exception( 37 | "FOVKick Increase curve is null, please define the curve for the field of view kicks"); 38 | } 39 | } 40 | 41 | 42 | public void ChangeCamera(Camera camera) 43 | { 44 | Camera = camera; 45 | } 46 | 47 | 48 | public IEnumerator FOVKickUp() 49 | { 50 | float t = Mathf.Abs((Camera.fieldOfView - originalFov)/FOVIncrease); 51 | while (t < TimeToIncrease) 52 | { 53 | Camera.fieldOfView = originalFov + (IncreaseCurve.Evaluate(t/TimeToIncrease)*FOVIncrease); 54 | t += Time.deltaTime; 55 | yield return new WaitForEndOfFrame(); 56 | } 57 | } 58 | 59 | 60 | public IEnumerator FOVKickDown() 61 | { 62 | float t = Mathf.Abs((Camera.fieldOfView - originalFov)/FOVIncrease); 63 | while (t > 0) 64 | { 65 | Camera.fieldOfView = originalFov + (IncreaseCurve.Evaluate(t/TimeToDecrease)*FOVIncrease); 66 | t -= Time.deltaTime; 67 | yield return new WaitForEndOfFrame(); 68 | } 69 | //make sure that fov returns to the original size 70 | Camera.fieldOfView = originalFov; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/FOVKick.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6045a93fb05b9c74884821030da2c46c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/FPSCounter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.UI; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | [RequireComponent(typeof (Text))] 8 | public class FPSCounter : MonoBehaviour 9 | { 10 | const float fpsMeasurePeriod = 0.5f; 11 | private int m_FpsAccumulator = 0; 12 | private float m_FpsNextPeriod = 0; 13 | private int m_CurrentFps; 14 | const string display = "{0} FPS"; 15 | private Text m_Text; 16 | 17 | 18 | private void Start() 19 | { 20 | m_FpsNextPeriod = Time.realtimeSinceStartup + fpsMeasurePeriod; 21 | m_Text = GetComponent(); 22 | } 23 | 24 | 25 | private void Update() 26 | { 27 | // measure average frames per second 28 | m_FpsAccumulator++; 29 | if (Time.realtimeSinceStartup > m_FpsNextPeriod) 30 | { 31 | m_CurrentFps = (int) (m_FpsAccumulator/fpsMeasurePeriod); 32 | m_FpsAccumulator = 0; 33 | m_FpsNextPeriod += fpsMeasurePeriod; 34 | m_Text.text = string.Format(display, m_CurrentFps); 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/FPSCounter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 22bbf57ec543cee42a5aa0ec2dd9e457 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/FollowTarget.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | public class FollowTarget : MonoBehaviour 8 | { 9 | public Transform target; 10 | public Vector3 offset = new Vector3(0f, 7.5f, 0f); 11 | 12 | 13 | private void LateUpdate() 14 | { 15 | transform.position = target.position + offset; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/FollowTarget.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 246cc59c7a84ea44f87f6b70acfe30c5 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ForcedReset.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.SceneManagement; 4 | using UnityStandardAssets.CrossPlatformInput; 5 | 6 | [RequireComponent(typeof (GUITexture))] 7 | public class ForcedReset : MonoBehaviour 8 | { 9 | private void Update() 10 | { 11 | // if we have forced a reset ... 12 | if (CrossPlatformInputManager.GetButtonDown("ResetObject")) 13 | { 14 | //... reload the scene 15 | SceneManager.LoadScene(SceneManager.GetSceneAt(0).path); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ForcedReset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b886447cba80f74e820adb3c9e70c76 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/LerpControlledBob.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | [Serializable] 8 | public class LerpControlledBob 9 | { 10 | public float BobDuration; 11 | public float BobAmount; 12 | 13 | private float m_Offset = 0f; 14 | 15 | 16 | // provides the offset that can be used 17 | public float Offset() 18 | { 19 | return m_Offset; 20 | } 21 | 22 | 23 | public IEnumerator DoBobCycle() 24 | { 25 | // make the camera move down slightly 26 | float t = 0f; 27 | while (t < BobDuration) 28 | { 29 | m_Offset = Mathf.Lerp(0f, BobAmount, t/BobDuration); 30 | t += Time.deltaTime; 31 | yield return new WaitForFixedUpdate(); 32 | } 33 | 34 | // make it move back to neutral 35 | t = 0f; 36 | while (t < BobDuration) 37 | { 38 | m_Offset = Mathf.Lerp(BobAmount, 0f, t/BobDuration); 39 | t += Time.deltaTime; 40 | yield return new WaitForFixedUpdate(); 41 | } 42 | m_Offset = 0f; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/LerpControlledBob.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1bbfafbde15c854681023b9e01e12dd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ObjectResetter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace UnityStandardAssets.Utility 7 | { 8 | public class ObjectResetter : MonoBehaviour 9 | { 10 | private Vector3 originalPosition; 11 | private Quaternion originalRotation; 12 | private List originalStructure; 13 | 14 | private Rigidbody Rigidbody; 15 | 16 | // Use this for initialization 17 | private void Start() 18 | { 19 | originalStructure = new List(GetComponentsInChildren()); 20 | originalPosition = transform.position; 21 | originalRotation = transform.rotation; 22 | 23 | Rigidbody = GetComponent(); 24 | } 25 | 26 | 27 | public void DelayedReset(float delay) 28 | { 29 | StartCoroutine(ResetCoroutine(delay)); 30 | } 31 | 32 | 33 | public IEnumerator ResetCoroutine(float delay) 34 | { 35 | yield return new WaitForSeconds(delay); 36 | 37 | // remove any gameobjects added (fire, skid trails, etc) 38 | foreach (var t in GetComponentsInChildren()) 39 | { 40 | if (!originalStructure.Contains(t)) 41 | { 42 | t.parent = null; 43 | } 44 | } 45 | 46 | transform.position = originalPosition; 47 | transform.rotation = originalRotation; 48 | if (Rigidbody) 49 | { 50 | Rigidbody.velocity = Vector3.zero; 51 | Rigidbody.angularVelocity = Vector3.zero; 52 | } 53 | 54 | SendMessage("Reset"); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ObjectResetter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 643c971818f68d3439e84b5d8bdafe07 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ParticleSystemDestroyer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | using Random = UnityEngine.Random; 5 | 6 | namespace UnityStandardAssets.Utility 7 | { 8 | public class ParticleSystemDestroyer : MonoBehaviour 9 | { 10 | // allows a particle system to exist for a specified duration, 11 | // then shuts off emission, and waits for all particles to expire 12 | // before destroying the gameObject 13 | 14 | public float minDuration = 8; 15 | public float maxDuration = 10; 16 | 17 | private float m_MaxLifetime; 18 | private bool m_EarlyStop; 19 | 20 | 21 | private IEnumerator Start() 22 | { 23 | var systems = GetComponentsInChildren(); 24 | 25 | // find out the maximum lifetime of any particles in this effect 26 | foreach (var system in systems) 27 | { 28 | m_MaxLifetime = Mathf.Max(system.startLifetime, m_MaxLifetime); 29 | } 30 | 31 | // wait for random duration 32 | 33 | float stopTime = Time.time + Random.Range(minDuration, maxDuration); 34 | 35 | while (Time.time < stopTime || m_EarlyStop) 36 | { 37 | yield return null; 38 | } 39 | Debug.Log("stopping " + name); 40 | 41 | // turn off emission 42 | foreach (var system in systems) 43 | { 44 | var emission = system.emission; 45 | emission.enabled = false; 46 | } 47 | BroadcastMessage("Extinguish", SendMessageOptions.DontRequireReceiver); 48 | 49 | // wait for any remaining particles to expire 50 | yield return new WaitForSeconds(m_MaxLifetime); 51 | 52 | Destroy(gameObject); 53 | } 54 | 55 | 56 | public void Stop() 57 | { 58 | // stops the particle system early 59 | m_EarlyStop = true; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ParticleSystemDestroyer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 29014cd42b6d273408e0ceefd336c0b3 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/PlatformSpecificContent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | #if UNITY_EDITOR 4 | using UnityEditor; 5 | #endif 6 | 7 | namespace UnityStandardAssets.Utility 8 | { 9 | #if UNITY_EDITOR 10 | 11 | [ExecuteInEditMode] 12 | #endif 13 | public class PlatformSpecificContent : MonoBehaviour 14 | { 15 | private enum BuildTargetGroup 16 | { 17 | Standalone, 18 | Mobile 19 | } 20 | 21 | [SerializeField] private BuildTargetGroup m_BuildTargetGroup; 22 | [SerializeField] private GameObject[] m_Content = new GameObject[0]; 23 | [SerializeField] private MonoBehaviour[] m_MonoBehaviours = new MonoBehaviour[0]; 24 | [SerializeField] private bool m_ChildrenOfThisObject; 25 | 26 | #if !UNITY_EDITOR 27 | void OnEnable() 28 | { 29 | CheckEnableContent(); 30 | } 31 | #endif 32 | 33 | #if UNITY_EDITOR 34 | 35 | private void OnEnable() 36 | { 37 | EditorUserBuildSettings.activeBuildTargetChanged += Update; 38 | EditorApplication.update += Update; 39 | } 40 | 41 | 42 | private void OnDisable() 43 | { 44 | EditorUserBuildSettings.activeBuildTargetChanged -= Update; 45 | EditorApplication.update -= Update; 46 | } 47 | 48 | 49 | private void Update() 50 | { 51 | CheckEnableContent(); 52 | } 53 | #endif 54 | 55 | 56 | private void CheckEnableContent() 57 | { 58 | #if (UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_BLACKBERRY ) 59 | if (m_BuildTargetGroup == BuildTargetGroup.Mobile) 60 | { 61 | EnableContent(true); 62 | } else { 63 | EnableContent(false); 64 | } 65 | #endif 66 | 67 | #if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_BLACKBERRY ) 68 | if (m_BuildTargetGroup == BuildTargetGroup.Mobile) 69 | { 70 | EnableContent(false); 71 | } 72 | else 73 | { 74 | EnableContent(true); 75 | } 76 | #endif 77 | } 78 | 79 | 80 | private void EnableContent(bool enabled) 81 | { 82 | if (m_Content.Length > 0) 83 | { 84 | foreach (var g in m_Content) 85 | { 86 | if (g != null) 87 | { 88 | g.SetActive(enabled); 89 | } 90 | } 91 | } 92 | if (m_ChildrenOfThisObject) 93 | { 94 | foreach (Transform t in transform) 95 | { 96 | t.gameObject.SetActive(enabled); 97 | } 98 | } 99 | if (m_MonoBehaviours.Length > 0) 100 | { 101 | foreach (var monoBehaviour in m_MonoBehaviours) 102 | { 103 | monoBehaviour.enabled = enabled; 104 | } 105 | } 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/PlatformSpecificContent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b27507c5d0efbbd47ac8c1de9a1a0a35 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b43a4ef15621158419a2b639f7a98245 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/Prefabs/FramerateCounter.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100000 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 224: {fileID: 22409990} 11 | - 223: {fileID: 22323452} 12 | - 114: {fileID: 11403178} 13 | - 114: {fileID: 11448042} 14 | m_Layer: 5 15 | m_Name: FramerateCounter 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!1 &167734 22 | GameObject: 23 | m_ObjectHideFlags: 0 24 | m_PrefabParentObject: {fileID: 0} 25 | m_PrefabInternal: {fileID: 100100000} 26 | serializedVersion: 4 27 | m_Component: 28 | - 224: {fileID: 22488988} 29 | - 222: {fileID: 22250932} 30 | - 114: {fileID: 11410038} 31 | - 114: {fileID: 11400482} 32 | m_Layer: 5 33 | m_Name: Text 34 | m_TagString: Untagged 35 | m_Icon: {fileID: 0} 36 | m_NavMeshLayer: 0 37 | m_StaticEditorFlags: 0 38 | m_IsActive: 1 39 | --- !u!114 &11400482 40 | MonoBehaviour: 41 | m_ObjectHideFlags: 1 42 | m_PrefabParentObject: {fileID: 0} 43 | m_PrefabInternal: {fileID: 100100000} 44 | m_GameObject: {fileID: 167734} 45 | m_Enabled: 1 46 | m_EditorHideFlags: 0 47 | m_Script: {fileID: 11500000, guid: 22bbf57ec543cee42a5aa0ec2dd9e457, type: 3} 48 | m_Name: 49 | m_EditorClassIdentifier: 50 | --- !u!114 &11403178 51 | MonoBehaviour: 52 | m_ObjectHideFlags: 1 53 | m_PrefabParentObject: {fileID: 0} 54 | m_PrefabInternal: {fileID: 100100000} 55 | m_GameObject: {fileID: 100000} 56 | m_Enabled: 1 57 | m_EditorHideFlags: 0 58 | m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 59 | m_Name: 60 | m_EditorClassIdentifier: 61 | m_UiScaleMode: 0 62 | m_ReferencePixelsPerUnit: 100 63 | m_ScaleFactor: 1 64 | m_ReferenceResolution: {x: 800, y: 600} 65 | m_ScreenMatchMode: 0 66 | m_MatchWidthOrHeight: 0 67 | m_PhysicalUnit: 3 68 | m_FallbackScreenDPI: 96 69 | m_DefaultSpriteDPI: 96 70 | m_DynamicPixelsPerUnit: 1 71 | --- !u!114 &11410038 72 | MonoBehaviour: 73 | m_ObjectHideFlags: 1 74 | m_PrefabParentObject: {fileID: 0} 75 | m_PrefabInternal: {fileID: 100100000} 76 | m_GameObject: {fileID: 167734} 77 | m_Enabled: 1 78 | m_EditorHideFlags: 0 79 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 80 | m_Name: 81 | m_EditorClassIdentifier: 82 | m_Material: {fileID: 0} 83 | m_Color: {r: .196078435, g: .196078435, b: .196078435, a: 1} 84 | m_FontData: 85 | m_Font: {fileID: 12800000, guid: b51a3e520f9164da198dc59c8acfccd6, type: 3} 86 | m_FontSize: 18 87 | m_FontStyle: 0 88 | m_BestFit: 0 89 | m_MinSize: 10 90 | m_MaxSize: 40 91 | m_Alignment: 4 92 | m_RichText: 0 93 | m_HorizontalOverflow: 0 94 | m_VerticalOverflow: 0 95 | m_LineSpacing: 1 96 | m_Text: 'FPS 97 | 98 | ' 99 | --- !u!114 &11448042 100 | MonoBehaviour: 101 | m_ObjectHideFlags: 1 102 | m_PrefabParentObject: {fileID: 0} 103 | m_PrefabInternal: {fileID: 100100000} 104 | m_GameObject: {fileID: 100000} 105 | m_Enabled: 1 106 | m_EditorHideFlags: 0 107 | m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 108 | m_Name: 109 | m_EditorClassIdentifier: 110 | m_IgnoreReversedGraphics: 1 111 | m_BlockingObjects: 0 112 | m_BlockingMask: 113 | serializedVersion: 2 114 | m_Bits: 4294967295 115 | --- !u!222 &22250932 116 | CanvasRenderer: 117 | m_ObjectHideFlags: 1 118 | m_PrefabParentObject: {fileID: 0} 119 | m_PrefabInternal: {fileID: 100100000} 120 | m_GameObject: {fileID: 167734} 121 | --- !u!223 &22323452 122 | Canvas: 123 | m_ObjectHideFlags: 1 124 | m_PrefabParentObject: {fileID: 0} 125 | m_PrefabInternal: {fileID: 100100000} 126 | m_GameObject: {fileID: 100000} 127 | m_Enabled: 1 128 | serializedVersion: 2 129 | m_RenderMode: 0 130 | m_Camera: {fileID: 0} 131 | m_PlaneDistance: 100 132 | m_PixelPerfect: 0 133 | m_ReceivesEvents: 1 134 | m_OverrideSorting: 0 135 | m_OverridePixelPerfect: 0 136 | m_SortingLayerID: 0 137 | m_SortingOrder: 0 138 | --- !u!224 &22409990 139 | RectTransform: 140 | m_ObjectHideFlags: 1 141 | m_PrefabParentObject: {fileID: 0} 142 | m_PrefabInternal: {fileID: 100100000} 143 | m_GameObject: {fileID: 100000} 144 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 145 | m_LocalPosition: {x: 0, y: 0, z: 0} 146 | m_LocalScale: {x: 0, y: 0, z: 0} 147 | m_Children: 148 | - {fileID: 22488988} 149 | m_Father: {fileID: 0} 150 | m_RootOrder: 0 151 | m_AnchorMin: {x: 0, y: 0} 152 | m_AnchorMax: {x: 0, y: 0} 153 | m_AnchoredPosition: {x: 0, y: 0} 154 | m_SizeDelta: {x: 0, y: 0} 155 | m_Pivot: {x: 0, y: 0} 156 | --- !u!224 &22488988 157 | RectTransform: 158 | m_ObjectHideFlags: 1 159 | m_PrefabParentObject: {fileID: 0} 160 | m_PrefabInternal: {fileID: 100100000} 161 | m_GameObject: {fileID: 167734} 162 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 163 | m_LocalPosition: {x: 0, y: 0, z: 0} 164 | m_LocalScale: {x: 1, y: 1, z: 1} 165 | m_Children: [] 166 | m_Father: {fileID: 22409990} 167 | m_RootOrder: 0 168 | m_AnchorMin: {x: .5, y: 1} 169 | m_AnchorMax: {x: .5, y: 1} 170 | m_AnchoredPosition: {x: 0, y: 0} 171 | m_SizeDelta: {x: 160, y: 30} 172 | m_Pivot: {x: .5, y: 1} 173 | --- !u!1001 &100100000 174 | Prefab: 175 | m_ObjectHideFlags: 1 176 | serializedVersion: 2 177 | m_Modification: 178 | m_TransformParent: {fileID: 0} 179 | m_Modifications: [] 180 | m_RemovedComponents: [] 181 | m_ParentPrefab: {fileID: 0} 182 | m_RootGameObject: {fileID: 100000} 183 | m_IsPrefabParent: 1 184 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/Prefabs/FramerateCounter.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 81154777d5417884981849c5243f6c01 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/SimpleActivatorMenu.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class SimpleActivatorMenu : MonoBehaviour 7 | { 8 | // An incredibly simple menu which, when given references 9 | // to gameobjects in the scene 10 | public GUIText camSwitchButton; 11 | public GameObject[] objects; 12 | 13 | 14 | private int m_CurrentActiveObject; 15 | 16 | 17 | private void OnEnable() 18 | { 19 | // active object starts from first in array 20 | m_CurrentActiveObject = 0; 21 | camSwitchButton.text = objects[m_CurrentActiveObject].name; 22 | } 23 | 24 | 25 | public void NextCamera() 26 | { 27 | int nextactiveobject = m_CurrentActiveObject + 1 >= objects.Length ? 0 : m_CurrentActiveObject + 1; 28 | 29 | for (int i = 0; i < objects.Length; i++) 30 | { 31 | objects[i].SetActive(i == nextactiveobject); 32 | } 33 | 34 | m_CurrentActiveObject = nextactiveobject; 35 | camSwitchButton.text = objects[m_CurrentActiveObject].name; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/SimpleActivatorMenu.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69b69a5b0e0a85b4aa97a7edc40c37d1 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/SimpleMouseRotator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityStandardAssets.CrossPlatformInput; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | public class SimpleMouseRotator : MonoBehaviour 8 | { 9 | // A mouselook behaviour with constraints which operate relative to 10 | // this gameobject's initial rotation. 11 | // Only rotates around local X and Y. 12 | // Works in local coordinates, so if this object is parented 13 | // to another moving gameobject, its local constraints will 14 | // operate correctly 15 | // (Think: looking out the side window of a car, or a gun turret 16 | // on a moving spaceship with a limited angular range) 17 | // to have no constraints on an axis, set the rotationRange to 360 or greater. 18 | public Vector2 rotationRange = new Vector3(70, 70); 19 | public float rotationSpeed = 10; 20 | public float dampingTime = 0.2f; 21 | public bool autoZeroVerticalOnMobile = true; 22 | public bool autoZeroHorizontalOnMobile = false; 23 | public bool relative = true; 24 | 25 | 26 | private Vector3 m_TargetAngles; 27 | private Vector3 m_FollowAngles; 28 | private Vector3 m_FollowVelocity; 29 | private Quaternion m_OriginalRotation; 30 | 31 | 32 | private void Start() 33 | { 34 | m_OriginalRotation = transform.localRotation; 35 | } 36 | 37 | 38 | private void Update() 39 | { 40 | // we make initial calculations from the original local rotation 41 | transform.localRotation = m_OriginalRotation; 42 | 43 | // read input from mouse or mobile controls 44 | float inputH; 45 | float inputV; 46 | if (relative) 47 | { 48 | inputH = CrossPlatformInputManager.GetAxis("Mouse X"); 49 | inputV = CrossPlatformInputManager.GetAxis("Mouse Y"); 50 | 51 | // wrap values to avoid springing quickly the wrong way from positive to negative 52 | if (m_TargetAngles.y > 180) 53 | { 54 | m_TargetAngles.y -= 360; 55 | m_FollowAngles.y -= 360; 56 | } 57 | if (m_TargetAngles.x > 180) 58 | { 59 | m_TargetAngles.x -= 360; 60 | m_FollowAngles.x -= 360; 61 | } 62 | if (m_TargetAngles.y < -180) 63 | { 64 | m_TargetAngles.y += 360; 65 | m_FollowAngles.y += 360; 66 | } 67 | if (m_TargetAngles.x < -180) 68 | { 69 | m_TargetAngles.x += 360; 70 | m_FollowAngles.x += 360; 71 | } 72 | 73 | #if MOBILE_INPUT 74 | // on mobile, sometimes we want input mapped directly to tilt value, 75 | // so it springs back automatically when the look input is released. 76 | if (autoZeroHorizontalOnMobile) { 77 | m_TargetAngles.y = Mathf.Lerp (-rotationRange.y * 0.5f, rotationRange.y * 0.5f, inputH * .5f + .5f); 78 | } else { 79 | m_TargetAngles.y += inputH * rotationSpeed; 80 | } 81 | if (autoZeroVerticalOnMobile) { 82 | m_TargetAngles.x = Mathf.Lerp (-rotationRange.x * 0.5f, rotationRange.x * 0.5f, inputV * .5f + .5f); 83 | } else { 84 | m_TargetAngles.x += inputV * rotationSpeed; 85 | } 86 | #else 87 | // with mouse input, we have direct control with no springback required. 88 | m_TargetAngles.y += inputH*rotationSpeed; 89 | m_TargetAngles.x += inputV*rotationSpeed; 90 | #endif 91 | 92 | // clamp values to allowed range 93 | m_TargetAngles.y = Mathf.Clamp(m_TargetAngles.y, -rotationRange.y*0.5f, rotationRange.y*0.5f); 94 | m_TargetAngles.x = Mathf.Clamp(m_TargetAngles.x, -rotationRange.x*0.5f, rotationRange.x*0.5f); 95 | } 96 | else 97 | { 98 | inputH = Input.mousePosition.x; 99 | inputV = Input.mousePosition.y; 100 | 101 | // set values to allowed range 102 | m_TargetAngles.y = Mathf.Lerp(-rotationRange.y*0.5f, rotationRange.y*0.5f, inputH/Screen.width); 103 | m_TargetAngles.x = Mathf.Lerp(-rotationRange.x*0.5f, rotationRange.x*0.5f, inputV/Screen.height); 104 | } 105 | 106 | // smoothly interpolate current values to target angles 107 | m_FollowAngles = Vector3.SmoothDamp(m_FollowAngles, m_TargetAngles, ref m_FollowVelocity, dampingTime); 108 | 109 | // update the actual gameobject's rotation 110 | transform.localRotation = m_OriginalRotation*Quaternion.Euler(-m_FollowAngles.x, m_FollowAngles.y, 0); 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/SimpleMouseRotator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cadd54e4832aeef4b9359f44cbe335cd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/SmoothFollow.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace UnityStandardAssets.Utility 4 | { 5 | public class SmoothFollow : MonoBehaviour 6 | { 7 | 8 | // The target we are following 9 | [SerializeField] 10 | private Transform target; 11 | // The distance in the x-z plane to the target 12 | [SerializeField] 13 | private float distance = 10.0f; 14 | // the height we want the camera to be above the target 15 | [SerializeField] 16 | private float height = 5.0f; 17 | 18 | [SerializeField] 19 | private float rotationDamping; 20 | [SerializeField] 21 | private float heightDamping; 22 | 23 | // Use this for initialization 24 | void Start() { } 25 | 26 | // Update is called once per frame 27 | void LateUpdate() 28 | { 29 | // Early out if we don't have a target 30 | if (!target) 31 | return; 32 | 33 | // Calculate the current rotation angles 34 | var wantedRotationAngle = target.eulerAngles.y; 35 | var wantedHeight = target.position.y + height; 36 | 37 | var currentRotationAngle = transform.eulerAngles.y; 38 | var currentHeight = transform.position.y; 39 | 40 | // Damp the rotation around the y-axis 41 | currentRotationAngle = Mathf.LerpAngle(currentRotationAngle, wantedRotationAngle, rotationDamping * Time.deltaTime); 42 | 43 | // Damp the height 44 | currentHeight = Mathf.Lerp(currentHeight, wantedHeight, heightDamping * Time.deltaTime); 45 | 46 | // Convert the angle into a rotation 47 | var currentRotation = Quaternion.Euler(0, currentRotationAngle, 0); 48 | 49 | // Set the position of the camera on the x-z plane to: 50 | // distance meters behind the target 51 | transform.position = target.position; 52 | transform.position -= currentRotation * Vector3.forward * distance; 53 | 54 | // Set the height of the camera 55 | transform.position = new Vector3(transform.position.x ,currentHeight , transform.position.z); 56 | 57 | // Always look at the target 58 | transform.LookAt(target); 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/SmoothFollow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f76806479d916a64aa03f8e3eba7912f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/TimedObjectActivator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | using UnityEngine.SceneManagement; 5 | #if UNITY_EDITOR 6 | using UnityEditor; 7 | #endif 8 | 9 | namespace UnityStandardAssets.Utility 10 | { 11 | public class TimedObjectActivator : MonoBehaviour 12 | { 13 | public enum Action 14 | { 15 | Activate, 16 | Deactivate, 17 | Destroy, 18 | ReloadLevel, 19 | Call, 20 | } 21 | 22 | 23 | [Serializable] 24 | public class Entry 25 | { 26 | public GameObject target; 27 | public Action action; 28 | public float delay; 29 | } 30 | 31 | 32 | [Serializable] 33 | public class Entries 34 | { 35 | public Entry[] entries; 36 | } 37 | 38 | 39 | public Entries entries = new Entries(); 40 | 41 | 42 | private void Awake() 43 | { 44 | foreach (Entry entry in entries.entries) 45 | { 46 | switch (entry.action) 47 | { 48 | case Action.Activate: 49 | StartCoroutine(Activate(entry)); 50 | break; 51 | case Action.Deactivate: 52 | StartCoroutine(Deactivate(entry)); 53 | break; 54 | case Action.Destroy: 55 | Destroy(entry.target, entry.delay); 56 | break; 57 | 58 | case Action.ReloadLevel: 59 | StartCoroutine(ReloadLevel(entry)); 60 | break; 61 | } 62 | } 63 | } 64 | 65 | 66 | private IEnumerator Activate(Entry entry) 67 | { 68 | yield return new WaitForSeconds(entry.delay); 69 | entry.target.SetActive(true); 70 | } 71 | 72 | 73 | private IEnumerator Deactivate(Entry entry) 74 | { 75 | yield return new WaitForSeconds(entry.delay); 76 | entry.target.SetActive(false); 77 | } 78 | 79 | 80 | private IEnumerator ReloadLevel(Entry entry) 81 | { 82 | yield return new WaitForSeconds(entry.delay); 83 | SceneManager.LoadScene(SceneManager.GetSceneAt(0).path); 84 | } 85 | } 86 | } 87 | 88 | 89 | namespace UnityStandardAssets.Utility.Inspector 90 | { 91 | #if UNITY_EDITOR 92 | [CustomPropertyDrawer(typeof (TimedObjectActivator.Entries))] 93 | public class EntriesDrawer : PropertyDrawer 94 | { 95 | private const float k_LineHeight = 18; 96 | private const float k_Spacing = 4; 97 | 98 | 99 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 100 | { 101 | EditorGUI.BeginProperty(position, label, property); 102 | 103 | float x = position.x; 104 | float y = position.y; 105 | float width = position.width; 106 | 107 | // Draw label 108 | EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); 109 | 110 | // Don't make child fields be indented 111 | var indent = EditorGUI.indentLevel; 112 | EditorGUI.indentLevel = 0; 113 | 114 | var entries = property.FindPropertyRelative("entries"); 115 | 116 | if (entries.arraySize > 0) 117 | { 118 | float actionWidth = .25f*width; 119 | float targetWidth = .6f*width; 120 | float delayWidth = .1f*width; 121 | float buttonWidth = .05f*width; 122 | 123 | for (int i = 0; i < entries.arraySize; ++i) 124 | { 125 | y += k_LineHeight + k_Spacing; 126 | 127 | var entry = entries.GetArrayElementAtIndex(i); 128 | 129 | float rowX = x; 130 | 131 | // Calculate rects 132 | Rect actionRect = new Rect(rowX, y, actionWidth, k_LineHeight); 133 | rowX += actionWidth; 134 | 135 | Rect targetRect = new Rect(rowX, y, targetWidth, k_LineHeight); 136 | rowX += targetWidth; 137 | 138 | Rect delayRect = new Rect(rowX, y, delayWidth, k_LineHeight); 139 | rowX += delayWidth; 140 | 141 | Rect buttonRect = new Rect(rowX, y, buttonWidth, k_LineHeight); 142 | rowX += buttonWidth; 143 | 144 | // Draw fields - passs GUIContent.none to each so they are drawn without labels 145 | 146 | if (entry.FindPropertyRelative("action").enumValueIndex != 147 | (int) TimedObjectActivator.Action.ReloadLevel) 148 | { 149 | EditorGUI.PropertyField(actionRect, entry.FindPropertyRelative("action"), GUIContent.none); 150 | EditorGUI.PropertyField(targetRect, entry.FindPropertyRelative("target"), GUIContent.none); 151 | } 152 | else 153 | { 154 | actionRect.width = actionRect.width + targetRect.width; 155 | EditorGUI.PropertyField(actionRect, entry.FindPropertyRelative("action"), GUIContent.none); 156 | } 157 | 158 | EditorGUI.PropertyField(delayRect, entry.FindPropertyRelative("delay"), GUIContent.none); 159 | if (GUI.Button(buttonRect, "-")) 160 | { 161 | entries.DeleteArrayElementAtIndex(i); 162 | break; 163 | } 164 | } 165 | } 166 | 167 | // add & sort buttons 168 | y += k_LineHeight + k_Spacing; 169 | 170 | var addButtonRect = new Rect(position.x + position.width - 120, y, 60, k_LineHeight); 171 | if (GUI.Button(addButtonRect, "Add")) 172 | { 173 | entries.InsertArrayElementAtIndex(entries.arraySize); 174 | } 175 | 176 | var sortButtonRect = new Rect(position.x + position.width - 60, y, 60, k_LineHeight); 177 | if (GUI.Button(sortButtonRect, "Sort")) 178 | { 179 | bool changed = true; 180 | while (entries.arraySize > 1 && changed) 181 | { 182 | changed = false; 183 | for (int i = 0; i < entries.arraySize - 1; ++i) 184 | { 185 | var e1 = entries.GetArrayElementAtIndex(i); 186 | var e2 = entries.GetArrayElementAtIndex(i + 1); 187 | 188 | if (e1.FindPropertyRelative("delay").floatValue > e2.FindPropertyRelative("delay").floatValue) 189 | { 190 | entries.MoveArrayElement(i + 1, i); 191 | changed = true; 192 | break; 193 | } 194 | } 195 | } 196 | } 197 | 198 | 199 | // Set indent back to what it was 200 | EditorGUI.indentLevel = indent; 201 | // 202 | 203 | 204 | EditorGUI.EndProperty(); 205 | } 206 | 207 | 208 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 209 | { 210 | SerializedProperty entries = property.FindPropertyRelative("entries"); 211 | float lineAndSpace = k_LineHeight + k_Spacing; 212 | return 40 + (entries.arraySize*lineAndSpace) + lineAndSpace; 213 | } 214 | } 215 | #endif 216 | } 217 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/TimedObjectActivator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3a7cedf246fca744f90cbdc9dbe41166 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/TimedObjectDestructor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class TimedObjectDestructor : MonoBehaviour 7 | { 8 | [SerializeField] private float m_TimeOut = 1.0f; 9 | [SerializeField] private bool m_DetachChildren = false; 10 | 11 | 12 | private void Awake() 13 | { 14 | Invoke("DestroyNow", m_TimeOut); 15 | } 16 | 17 | 18 | private void DestroyNow() 19 | { 20 | if (m_DetachChildren) 21 | { 22 | transform.DetachChildren(); 23 | } 24 | DestroyObject(gameObject); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/TimedObjectDestructor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37fac21d1f093d344816942d1abce94e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/WaypointCircuit.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70852dc981465ea48bb527b9e33a87fd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/WaypointProgressTracker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class WaypointProgressTracker : MonoBehaviour 7 | { 8 | // This script can be used with any object that is supposed to follow a 9 | // route marked out by waypoints. 10 | 11 | // This script manages the amount to look ahead along the route, 12 | // and keeps track of progress and laps. 13 | 14 | [SerializeField] private WaypointCircuit circuit; // A reference to the waypoint-based route we should follow 15 | 16 | [SerializeField] private float lookAheadForTargetOffset = 5; 17 | // The offset ahead along the route that the we will aim for 18 | 19 | [SerializeField] private float lookAheadForTargetFactor = .1f; 20 | // A multiplier adding distance ahead along the route to aim for, based on current speed 21 | 22 | [SerializeField] private float lookAheadForSpeedOffset = 10; 23 | // The offset ahead only the route for speed adjustments (applied as the rotation of the waypoint target transform) 24 | 25 | [SerializeField] private float lookAheadForSpeedFactor = .2f; 26 | // A multiplier adding distance ahead along the route for speed adjustments 27 | 28 | [SerializeField] private ProgressStyle progressStyle = ProgressStyle.SmoothAlongRoute; 29 | // whether to update the position smoothly along the route (good for curved paths) or just when we reach each waypoint. 30 | 31 | [SerializeField] private float pointToPointThreshold = 4; 32 | // proximity to waypoint which must be reached to switch target to next waypoint : only used in PointToPoint mode. 33 | 34 | public enum ProgressStyle 35 | { 36 | SmoothAlongRoute, 37 | PointToPoint, 38 | } 39 | 40 | // these are public, readable by other objects - i.e. for an AI to know where to head! 41 | public WaypointCircuit.RoutePoint targetPoint { get; private set; } 42 | public WaypointCircuit.RoutePoint speedPoint { get; private set; } 43 | public WaypointCircuit.RoutePoint progressPoint { get; private set; } 44 | 45 | public Transform target; 46 | 47 | private float progressDistance; // The progress round the route, used in smooth mode. 48 | private int progressNum; // the current waypoint number, used in point-to-point mode. 49 | private Vector3 lastPosition; // Used to calculate current speed (since we may not have a rigidbody component) 50 | private float speed; // current speed of this object (calculated from delta since last frame) 51 | 52 | // setup script properties 53 | private void Start() 54 | { 55 | // we use a transform to represent the point to aim for, and the point which 56 | // is considered for upcoming changes-of-speed. This allows this component 57 | // to communicate this information to the AI without requiring further dependencies. 58 | 59 | // You can manually create a transform and assign it to this component *and* the AI, 60 | // then this component will update it, and the AI can read it. 61 | if (target == null) 62 | { 63 | target = new GameObject(name + " Waypoint Target").transform; 64 | } 65 | 66 | Reset(); 67 | } 68 | 69 | 70 | // reset the object to sensible values 71 | public void Reset() 72 | { 73 | progressDistance = 0; 74 | progressNum = 0; 75 | if (progressStyle == ProgressStyle.PointToPoint) 76 | { 77 | target.position = circuit.Waypoints[progressNum].position; 78 | target.rotation = circuit.Waypoints[progressNum].rotation; 79 | } 80 | } 81 | 82 | 83 | private void Update() 84 | { 85 | if (progressStyle == ProgressStyle.SmoothAlongRoute) 86 | { 87 | // determine the position we should currently be aiming for 88 | // (this is different to the current progress position, it is a a certain amount ahead along the route) 89 | // we use lerp as a simple way of smoothing out the speed over time. 90 | if (Time.deltaTime > 0) 91 | { 92 | speed = Mathf.Lerp(speed, (lastPosition - transform.position).magnitude/Time.deltaTime, 93 | Time.deltaTime); 94 | } 95 | target.position = 96 | circuit.GetRoutePoint(progressDistance + lookAheadForTargetOffset + lookAheadForTargetFactor*speed) 97 | .position; 98 | target.rotation = 99 | Quaternion.LookRotation( 100 | circuit.GetRoutePoint(progressDistance + lookAheadForSpeedOffset + lookAheadForSpeedFactor*speed) 101 | .direction); 102 | 103 | 104 | // get our current progress along the route 105 | progressPoint = circuit.GetRoutePoint(progressDistance); 106 | Vector3 progressDelta = progressPoint.position - transform.position; 107 | if (Vector3.Dot(progressDelta, progressPoint.direction) < 0) 108 | { 109 | progressDistance += progressDelta.magnitude*0.5f; 110 | } 111 | 112 | lastPosition = transform.position; 113 | } 114 | else 115 | { 116 | // point to point mode. Just increase the waypoint if we're close enough: 117 | 118 | Vector3 targetDelta = target.position - transform.position; 119 | if (targetDelta.magnitude < pointToPointThreshold) 120 | { 121 | progressNum = (progressNum + 1)%circuit.Waypoints.Length; 122 | } 123 | 124 | 125 | target.position = circuit.Waypoints[progressNum].position; 126 | target.rotation = circuit.Waypoints[progressNum].rotation; 127 | 128 | // get our current progress along the route 129 | progressPoint = circuit.GetRoutePoint(progressDistance); 130 | Vector3 progressDelta = progressPoint.position - transform.position; 131 | if (Vector3.Dot(progressDelta, progressPoint.direction) < 0) 132 | { 133 | progressDistance += progressDelta.magnitude; 134 | } 135 | lastPosition = transform.position; 136 | } 137 | } 138 | 139 | 140 | private void OnDrawGizmos() 141 | { 142 | if (Application.isPlaying) 143 | { 144 | Gizmos.color = Color.green; 145 | Gizmos.DrawLine(transform.position, target.position); 146 | Gizmos.DrawWireSphere(circuit.GetRoutePosition(progressDistance), 1); 147 | Gizmos.color = Color.yellow; 148 | Gizmos.DrawLine(target.position, target.position + target.forward); 149 | } 150 | } 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/WaypointProgressTracker.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c5cb22d331ef7d64796f917c6a455a32 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | m_SpeedOfSound: 347 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_DSPBufferSize: 0 12 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | m_Gravity: {x: 0, y: -9.81000042, z: 0} 7 | m_DefaultMaterial: {fileID: 0} 8 | m_BounceThreshold: 2 9 | m_SleepVelocity: .150000006 10 | m_SleepAngularVelocity: .140000001 11 | m_MaxAngularVelocity: 7 12 | m_MinPenetrationForPenalty: .00999999978 13 | m_SolverIterationCount: 6 14 | m_RaycastsHitTriggers: 1 15 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 16 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/SampleScenes/Scenes/2dCharacter.unity 10 | - enabled: 1 11 | path: Assets/SampleScenes/Scenes/AircraftJet2Axis.unity 12 | - enabled: 1 13 | path: Assets/SampleScenes/Scenes/AircraftJetAI.unity 14 | - enabled: 1 15 | path: Assets/SampleScenes/Scenes/AircraftPropeller4Axis.unity 16 | - enabled: 1 17 | path: Assets/SampleScenes/Scenes/AircraftPropellerAI.unity 18 | - enabled: 1 19 | path: Assets/SampleScenes/Scenes/Car.unity 20 | - enabled: 1 21 | path: Assets/SampleScenes/Scenes/CarAIWaypointBased.unity 22 | - enabled: 1 23 | path: Assets/SampleScenes/Scenes/CharacterFirstPerson.unity 24 | - enabled: 1 25 | path: Assets/SampleScenes/Scenes/CharacterThirdPerson.unity 26 | - enabled: 1 27 | path: Assets/SampleScenes/Scenes/CharacterThirdPersonAI.unity 28 | - enabled: 1 29 | path: Assets/SampleScenes/Scenes/Particles.unity 30 | - enabled: 1 31 | path: Assets/SampleScenes/Scenes/RollerBall.unity 32 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_WebSecurityEmulationEnabled: 0 10 | m_WebSecurityEmulationHostUrl: http://www.mydomain.com/mygame.unity3d 11 | m_DefaultBehaviorMode: 1702065251 12 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 9 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_TierSettings_Tier1: 42 | renderingPath: 1 43 | useCascadedShadowMaps: 1 44 | m_TierSettings_Tier2: 45 | renderingPath: 1 46 | useCascadedShadowMaps: 1 47 | m_TierSettings_Tier3: 48 | renderingPath: 1 49 | useCascadedShadowMaps: 1 50 | m_DefaultRenderingPath: 1 51 | m_DefaultMobileRenderingPath: 1 52 | m_TierSettings: [] 53 | m_LightmapStripping: 0 54 | m_FogStripping: 0 55 | m_LightmapKeepPlain: 1 56 | m_LightmapKeepDirCombined: 1 57 | m_LightmapKeepDirSeparate: 1 58 | m_LightmapKeepDynamicPlain: 1 59 | m_LightmapKeepDynamicDirCombined: 1 60 | m_LightmapKeepDynamicDirSeparate: 1 61 | m_FogKeepLinear: 1 62 | m_FogKeepExp: 1 63 | m_FogKeepExp2: 1 64 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshLayers: 5 | m_ObjectHideFlags: 0 6 | Built-in Layer 0: 7 | name: Default 8 | cost: 1 9 | editType: 2 10 | Built-in Layer 1: 11 | name: Not Walkable 12 | cost: 1 13 | editType: 0 14 | Built-in Layer 2: 15 | name: Jump 16 | cost: 2 17 | editType: 2 18 | User Layer 0: 19 | name: Terrain 20 | cost: 50 21 | editType: 3 22 | User Layer 1: 23 | name: 24 | cost: 1 25 | editType: 3 26 | User Layer 2: 27 | name: 28 | cost: 1 29 | editType: 3 30 | User Layer 3: 31 | name: 32 | cost: 1 33 | editType: 3 34 | User Layer 4: 35 | name: 36 | cost: 1 37 | editType: 3 38 | User Layer 5: 39 | name: 40 | cost: 1 41 | editType: 3 42 | User Layer 6: 43 | name: 44 | cost: 1 45 | editType: 3 46 | User Layer 7: 47 | name: 48 | cost: 1 49 | editType: 3 50 | User Layer 8: 51 | name: 52 | cost: 1 53 | editType: 3 54 | User Layer 9: 55 | name: 56 | cost: 1 57 | editType: 3 58 | User Layer 10: 59 | name: 60 | cost: 1 61 | editType: 3 62 | User Layer 11: 63 | name: 64 | cost: 1 65 | editType: 3 66 | User Layer 12: 67 | name: 68 | cost: 1 69 | editType: 3 70 | User Layer 13: 71 | name: 72 | cost: 1 73 | editType: 3 74 | User Layer 14: 75 | name: 76 | cost: 1 77 | editType: 3 78 | User Layer 15: 79 | name: 80 | cost: 1 81 | editType: 3 82 | User Layer 16: 83 | name: 84 | cost: 1 85 | editType: 3 86 | User Layer 17: 87 | name: 88 | cost: 1 89 | editType: 3 90 | User Layer 18: 91 | name: 92 | cost: 1 93 | editType: 3 94 | User Layer 19: 95 | name: 96 | cost: 1 97 | editType: 3 98 | User Layer 20: 99 | name: 100 | cost: 1 101 | editType: 3 102 | User Layer 21: 103 | name: 104 | cost: 1 105 | editType: 3 106 | User Layer 22: 107 | name: 108 | cost: 1 109 | editType: 3 110 | User Layer 23: 111 | name: 112 | cost: 1 113 | editType: 3 114 | User Layer 24: 115 | name: 116 | cost: 1 117 | editType: 3 118 | User Layer 25: 119 | name: 120 | cost: 1 121 | editType: 3 122 | User Layer 26: 123 | name: 124 | cost: 1 125 | editType: 3 126 | User Layer 27: 127 | name: 128 | cost: 1 129 | editType: 3 130 | User Layer 28: 131 | name: 132 | cost: 1 133 | editType: 3 134 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | m_Gravity: {x: 0, y: -9.81000042} 7 | m_DefaultMaterial: {fileID: 0} 8 | m_VelocityIterations: 8 9 | m_PositionIterations: 3 10 | m_VelocityThreshold: 1 11 | m_MaxLinearCorrection: .200000003 12 | m_MaxAngularCorrection: 8 13 | m_MaxTranslationSpeed: 100 14 | m_MaxRotationSpeed: 360 15 | m_BaumgarteScale: .200000003 16 | m_BaumgarteTimeOfImpactScale: .75 17 | m_TimeToSleep: .5 18 | m_LinearSleepTolerance: .00999999978 19 | m_AngularSleepTolerance: 2 20 | m_RaycastsHitTriggers: 1 21 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 22 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2017.1.0f3 2 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Fastest 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 20 17 | shadowCascade2Split: .333333343 18 | shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669} 19 | blendWeights: 1 20 | textureQuality: 1 21 | anisotropicTextures: 0 22 | antiAliasing: 0 23 | softParticles: 0 24 | softVegetation: 0 25 | realtimeReflectionProbes: 0 26 | billboardsFaceCameraPosition: 0 27 | vSyncCount: 0 28 | lodBias: .300000012 29 | maximumLODLevel: 0 30 | particleRaycastBudget: 4 31 | excludedTargetPlatforms: [] 32 | - serializedVersion: 2 33 | name: Fast 34 | pixelLightCount: 0 35 | shadows: 1 36 | shadowResolution: 0 37 | shadowProjection: 1 38 | shadowCascades: 1 39 | shadowDistance: 20 40 | shadowCascade2Split: .333333343 41 | shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669} 42 | blendWeights: 2 43 | textureQuality: 0 44 | anisotropicTextures: 0 45 | antiAliasing: 0 46 | softParticles: 0 47 | softVegetation: 0 48 | realtimeReflectionProbes: 0 49 | billboardsFaceCameraPosition: 0 50 | vSyncCount: 0 51 | lodBias: .400000006 52 | maximumLODLevel: 0 53 | particleRaycastBudget: 16 54 | excludedTargetPlatforms: [] 55 | - serializedVersion: 2 56 | name: Simple 57 | pixelLightCount: 1 58 | shadows: 1 59 | shadowResolution: 1 60 | shadowProjection: 1 61 | shadowCascades: 1 62 | shadowDistance: 80 63 | shadowCascade2Split: .333333343 64 | shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669} 65 | blendWeights: 2 66 | textureQuality: 0 67 | anisotropicTextures: 1 68 | antiAliasing: 0 69 | softParticles: 0 70 | softVegetation: 0 71 | realtimeReflectionProbes: 0 72 | billboardsFaceCameraPosition: 0 73 | vSyncCount: 0 74 | lodBias: .699999988 75 | maximumLODLevel: 0 76 | particleRaycastBudget: 64 77 | excludedTargetPlatforms: [] 78 | - serializedVersion: 2 79 | name: Good 80 | pixelLightCount: 2 81 | shadows: 2 82 | shadowResolution: 2 83 | shadowProjection: 1 84 | shadowCascades: 2 85 | shadowDistance: 100 86 | shadowCascade2Split: .333333343 87 | shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669} 88 | blendWeights: 2 89 | textureQuality: 0 90 | anisotropicTextures: 1 91 | antiAliasing: 2 92 | softParticles: 1 93 | softVegetation: 1 94 | realtimeReflectionProbes: 1 95 | billboardsFaceCameraPosition: 1 96 | vSyncCount: 0 97 | lodBias: 1 98 | maximumLODLevel: 0 99 | particleRaycastBudget: 256 100 | excludedTargetPlatforms: [] 101 | - serializedVersion: 2 102 | name: Beautiful 103 | pixelLightCount: 8 104 | shadows: 2 105 | shadowResolution: 3 106 | shadowProjection: 1 107 | shadowCascades: 2 108 | shadowDistance: 120 109 | shadowCascade2Split: .333333343 110 | shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669} 111 | blendWeights: 4 112 | textureQuality: 0 113 | anisotropicTextures: 2 114 | antiAliasing: 8 115 | softParticles: 1 116 | softVegetation: 1 117 | realtimeReflectionProbes: 1 118 | billboardsFaceCameraPosition: 1 119 | vSyncCount: 0 120 | lodBias: 1.5 121 | maximumLODLevel: 0 122 | particleRaycastBudget: 1024 123 | excludedTargetPlatforms: [] 124 | - serializedVersion: 2 125 | name: Fantastic 126 | pixelLightCount: 4 127 | shadows: 2 128 | shadowResolution: 3 129 | shadowProjection: 1 130 | shadowCascades: 4 131 | shadowDistance: 120 132 | shadowCascade2Split: .333333343 133 | shadowCascade4Split: {x: .0666666701, y: .199999988, z: .466666639} 134 | blendWeights: 4 135 | textureQuality: 0 136 | anisotropicTextures: 2 137 | antiAliasing: 4 138 | softParticles: 1 139 | softVegetation: 1 140 | realtimeReflectionProbes: 1 141 | billboardsFaceCameraPosition: 1 142 | vSyncCount: 0 143 | lodBias: 2 144 | maximumLODLevel: 0 145 | particleRaycastBudget: 4096 146 | excludedTargetPlatforms: [] 147 | m_PerPlatformDefaultQuality: 148 | Android: 1 149 | BlackBerry: 1 150 | Standalone: 5 151 | WP8: 1 152 | Web: 4 153 | WebGL: 1 154 | Windows Store Apps: 1 155 | iPhone: 1 156 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: 7 | - Fire 8 | layers: 9 | - Default 10 | - TransparentFX 11 | - Ignore Raycast 12 | - 13 | - Water 14 | - UI 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | - 41 | m_SortingLayers: 42 | - name: Default 43 | userID: 0 44 | uniqueID: 0 45 | locked: 0 46 | - name: Background 47 | userID: 1 48 | uniqueID: 1093696345 49 | locked: 0 50 | - name: Foreground 51 | userID: 2 52 | uniqueID: 1859086223 53 | locked: 0 54 | - name: Characters 55 | userID: 3 56 | uniqueID: 3940858523 57 | locked: 0 58 | - name: UI 59 | userID: 4 60 | uniqueID: 771169021 61 | locked: 0 62 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: .0199999996 7 | Maximum Allowed Timestep: .333333343 8 | m_TimeScale: 1 9 | -------------------------------------------------------------------------------- /ProjectSettings/UnityAdsSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00000000000000008100000000000000 3 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 0 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | CrashReportingSettings: 11 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 12 | m_Enabled: 0 13 | m_CaptureEditorExceptions: 1 14 | UnityPurchasingSettings: 15 | m_Enabled: 0 16 | m_TestMode: 0 17 | UnityAnalyticsSettings: 18 | m_Enabled: 0 19 | m_InitializeOnStartup: 1 20 | m_TestMode: 0 21 | m_TestEventUrl: 22 | m_TestConfigUrl: 23 | UnityAdsSettings: 24 | m_Enabled: 0 25 | m_InitializeOnStartup: 1 26 | m_TestMode: 0 27 | m_EnabledPlatforms: 4294967295 28 | m_IosGameId: 29 | m_AndroidGameId: 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UnityScatterplot 2 | Very basic scatterplot generation in unity based off of a CSV file 3 | 4 | 5 | Refer to the full tutorial here for how this project was built, for beginners to Unity: 6 | http://sites.psu.edu/bdssblog/2017/04/06/basic-data-visualization-in-unity-scatterplot-creation/ 7 | --------------------------------------------------------------------------------