text
stringlengths
2
104M
meta
dict
fileFormatVersion: 2 guid: 6ac1ce5a5adfd9f46adbf5b6f752a47c labels: - Done MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: -1010 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 7d3269566d48b8447bb48d2259e28f8b MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; using UnityStandardAssets.CrossPlatformInput.PlatformSpecific; namespace UnityStandardAssets.CrossPlatformInput { public static class CrossPlatformInputManager { public enum ActiveInputMethod { Hardware, Touch } private static VirtualInput activeInput; private static VirtualInput s_TouchInput; private static VirtualInput s_HardwareInput; static CrossPlatformInputManager() { s_TouchInput = new MobileInput(); s_HardwareInput = new StandaloneInput(); #if MOBILE_INPUT activeInput = s_TouchInput; #else activeInput = s_HardwareInput; #endif } public static void SwitchActiveInputMethod(ActiveInputMethod activeInputMethod) { switch (activeInputMethod) { case ActiveInputMethod.Hardware: activeInput = s_HardwareInput; break; case ActiveInputMethod.Touch: activeInput = s_TouchInput; break; } } public static bool AxisExists(string name) { return activeInput.AxisExists(name); } public static bool ButtonExists(string name) { return activeInput.ButtonExists(name); } public static void RegisterVirtualAxis(VirtualAxis axis) { activeInput.RegisterVirtualAxis(axis); } public static void RegisterVirtualButton(VirtualButton button) { activeInput.RegisterVirtualButton(button); } public static void UnRegisterVirtualAxis(string name) { if (name == null) { throw new ArgumentNullException("name"); } activeInput.UnRegisterVirtualAxis(name); } public static void UnRegisterVirtualButton(string name) { activeInput.UnRegisterVirtualButton(name); } // returns a reference to a named virtual axis if it exists otherwise null public static VirtualAxis VirtualAxisReference(string name) { return activeInput.VirtualAxisReference(name); } // returns the platform appropriate axis for the given name public static float GetAxis(string name) { return GetAxis(name, false); } public static float GetAxisRaw(string name) { return GetAxis(name, true); } // private function handles both types of axis (raw and not raw) private static float GetAxis(string name, bool raw) { return activeInput.GetAxis(name, raw); } // -- Button handling -- public static bool GetButton(string name) { return activeInput.GetButton(name); } public static bool GetButtonDown(string name) { return activeInput.GetButtonDown(name); } public static bool GetButtonUp(string name) { return activeInput.GetButtonUp(name); } public static void SetButtonDown(string name) { activeInput.SetButtonDown(name); } public static void SetButtonUp(string name) { activeInput.SetButtonUp(name); } public static void SetAxisPositive(string name) { activeInput.SetAxisPositive(name); } public static void SetAxisNegative(string name) { activeInput.SetAxisNegative(name); } public static void SetAxisZero(string name) { activeInput.SetAxisZero(name); } public static void SetAxis(string name, float value) { activeInput.SetAxis(name, value); } public static Vector3 mousePosition { get { return activeInput.MousePosition(); } } public static void SetVirtualMousePositionX(float f) { activeInput.SetVirtualMousePositionX(f); } public static void SetVirtualMousePositionY(float f) { activeInput.SetVirtualMousePositionY(f); } public static void SetVirtualMousePositionZ(float f) { activeInput.SetVirtualMousePositionZ(f); } // virtual axis and button classes - applies to mobile input // Can be mapped to touch joysticks, tilt, gyro, etc, depending on desired implementation. // Could also be implemented by other input devices - kinect, electronic sensors, etc public class VirtualAxis { public string name { get; private set; } private float m_Value; public bool matchWithInputManager { get; private set; } public VirtualAxis(string name) : this(name, true) { } public VirtualAxis(string name, bool matchToInputSettings) { this.name = name; matchWithInputManager = matchToInputSettings; } // removes an axes from the cross platform input system public void Remove() { UnRegisterVirtualAxis(name); } // a controller gameobject (eg. a virtual thumbstick) should update this class public void Update(float value) { m_Value = value; } public float GetValue { get { return m_Value; } } public float GetValueRaw { get { return m_Value; } } } // a controller gameobject (eg. a virtual GUI button) should call the // 'pressed' function of this class. Other objects can then read the // Get/Down/Up state of this button. public class VirtualButton { public string name { get; private set; } public bool matchWithInputManager { get; private set; } private int m_LastPressedFrame = -5; private int m_ReleasedFrame = -5; private bool m_Pressed; public VirtualButton(string name) : this(name, true) { } public VirtualButton(string name, bool matchToInputSettings) { this.name = name; matchWithInputManager = matchToInputSettings; } // A controller gameobject should call this function when the button is pressed down public void Pressed() { if (m_Pressed) { return; } m_Pressed = true; m_LastPressedFrame = Time.frameCount; } // A controller gameobject should call this function when the button is released public void Released() { m_Pressed = false; m_ReleasedFrame = Time.frameCount; } // the controller gameobject should call Remove when the button is destroyed or disabled public void Remove() { UnRegisterVirtualButton(name); } // these are the states of the button which can be read via the cross platform input system public bool GetButton { get { return m_Pressed; } } public bool GetButtonDown { get { return m_LastPressedFrame - Time.frameCount == -1; } } public bool GetButtonUp { get { return (m_ReleasedFrame == Time.frameCount - 1); } } } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 71398ce7fbc3a5b4fa50b50bd54317a7 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; using UnityEngine.EventSystems; namespace UnityStandardAssets.CrossPlatformInput { public class AxisTouchButton : MonoBehaviour, IPointerDownHandler, IPointerUpHandler { // designed to work in a pair with another axis touch button // (typically with one having -1 and one having 1 axisValues) public string axisName = "Horizontal"; // The name of the axis public float axisValue = 1; // The axis that the value has public float responseSpeed = 3; // The speed at which the axis touch button responds public float returnToCentreSpeed = 3; // The speed at which the button will return to its centre AxisTouchButton m_PairedWith; // Which button this one is paired with CrossPlatformInputManager.VirtualAxis m_Axis; // A reference to the virtual axis as it is in the cross platform input void OnEnable() { if (!CrossPlatformInputManager.AxisExists(axisName)) { // if the axis doesnt exist create a new one in cross platform input m_Axis = new CrossPlatformInputManager.VirtualAxis(axisName); CrossPlatformInputManager.RegisterVirtualAxis(m_Axis); } else { m_Axis = CrossPlatformInputManager.VirtualAxisReference(axisName); } FindPairedButton(); } void FindPairedButton() { // find the other button witch which this button should be paired // (it should have the same axisName) var otherAxisButtons = FindObjectsOfType(typeof(AxisTouchButton)) as AxisTouchButton[]; if (otherAxisButtons != null) { for (int i = 0; i < otherAxisButtons.Length; i++) { if (otherAxisButtons[i].axisName == axisName && otherAxisButtons[i] != this) { m_PairedWith = otherAxisButtons[i]; } } } } void OnDisable() { // The object is disabled so remove it from the cross platform input system m_Axis.Remove(); } public void OnPointerDown(PointerEventData data) { if (m_PairedWith == null) { FindPairedButton(); } // update the axis and record that the button has been pressed this frame m_Axis.Update(Mathf.MoveTowards(m_Axis.GetValue, axisValue, responseSpeed * Time.deltaTime)); } public void OnPointerUp(PointerEventData data) { m_Axis.Update(Mathf.MoveTowards(m_Axis.GetValue, 0, responseSpeed * Time.deltaTime)); } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; #if UNITY_EDITOR using UnityEditor; #endif namespace UnityStandardAssets.CrossPlatformInput { // helps with managing tilt input on mobile devices public class TiltInput : MonoBehaviour { // options for the various orientations public enum AxisOptions { ForwardAxis, SidewaysAxis, } [Serializable] public class AxisMapping { public enum MappingType { NamedAxis, MousePositionX, MousePositionY, MousePositionZ }; public MappingType type; public string axisName; } public AxisMapping mapping; public AxisOptions tiltAroundAxis = AxisOptions.ForwardAxis; public float fullTiltAngle = 25; public float centreAngleOffset = 0; private CrossPlatformInputManager.VirtualAxis m_SteerAxis; private void OnEnable() { if (mapping.type == AxisMapping.MappingType.NamedAxis) { m_SteerAxis = new CrossPlatformInputManager.VirtualAxis(mapping.axisName); CrossPlatformInputManager.RegisterVirtualAxis(m_SteerAxis); } } private void Update() { float angle = 0; if (Input.acceleration != Vector3.zero) { switch (tiltAroundAxis) { case AxisOptions.ForwardAxis: angle = Mathf.Atan2(Input.acceleration.x, -Input.acceleration.y)*Mathf.Rad2Deg + centreAngleOffset; break; case AxisOptions.SidewaysAxis: angle = Mathf.Atan2(Input.acceleration.z, -Input.acceleration.y)*Mathf.Rad2Deg + centreAngleOffset; break; } } float axisValue = Mathf.InverseLerp(-fullTiltAngle, fullTiltAngle, angle)*2 - 1; switch (mapping.type) { case AxisMapping.MappingType.NamedAxis: m_SteerAxis.Update(axisValue); break; case AxisMapping.MappingType.MousePositionX: CrossPlatformInputManager.SetVirtualMousePositionX(axisValue*Screen.width); break; case AxisMapping.MappingType.MousePositionY: CrossPlatformInputManager.SetVirtualMousePositionY(axisValue*Screen.width); break; case AxisMapping.MappingType.MousePositionZ: CrossPlatformInputManager.SetVirtualMousePositionZ(axisValue*Screen.width); break; } } private void OnDisable() { m_SteerAxis.Remove(); } } } namespace UnityStandardAssets.CrossPlatformInput.Inspector { #if UNITY_EDITOR [CustomPropertyDrawer(typeof (TiltInput.AxisMapping))] public class TiltInputAxisStylePropertyDrawer : PropertyDrawer { public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { EditorGUI.BeginProperty(position, label, property); float x = position.x; float y = position.y; float inspectorWidth = position.width; // Don't make child fields be indented var indent = EditorGUI.indentLevel; EditorGUI.indentLevel = 0; var props = new[] {"type", "axisName"}; var widths = new[] {.4f, .6f}; if (property.FindPropertyRelative("type").enumValueIndex > 0) { // hide name if not a named axis props = new[] {"type"}; widths = new[] {1f}; } const float lineHeight = 18; for (int n = 0; n < props.Length; ++n) { float w = widths[n]*inspectorWidth; // Calculate rects Rect rect = new Rect(x, y, w, lineHeight); x += w; EditorGUI.PropertyField(rect, property.FindPropertyRelative(props[n]), GUIContent.none); } // Set indent back to what it was EditorGUI.indentLevel = indent; EditorGUI.EndProperty(); } } #endif }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 00c3c865782347f41b6358d9fba14b48 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; namespace UnityStandardAssets.CrossPlatformInput { public class ButtonHandler : MonoBehaviour { public string Name; void OnEnable() { } public void SetDownState() { CrossPlatformInputManager.SetButtonDown(Name); } public void SetUpState() { CrossPlatformInputManager.SetButtonUp(Name); } public void SetAxisPositiveState() { CrossPlatformInputManager.SetAxisPositive(Name); } public void SetAxisNeutralState() { CrossPlatformInputManager.SetAxisZero(Name); } public void SetAxisNegativeState() { CrossPlatformInputManager.SetAxisNegative(Name); } public void Update() { } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using System.Collections.Generic; using UnityEngine; namespace UnityStandardAssets.CrossPlatformInput { public abstract class VirtualInput { public Vector3 virtualMousePosition { get; private set; } protected Dictionary<string, CrossPlatformInputManager.VirtualAxis> m_VirtualAxes = new Dictionary<string, CrossPlatformInputManager.VirtualAxis>(); // Dictionary to store the name relating to the virtual axes protected Dictionary<string, CrossPlatformInputManager.VirtualButton> m_VirtualButtons = new Dictionary<string, CrossPlatformInputManager.VirtualButton>(); protected List<string> m_AlwaysUseVirtual = new List<string>(); // list of the axis and button names that have been flagged to always use a virtual axis or button public bool AxisExists(string name) { return m_VirtualAxes.ContainsKey(name); } public bool ButtonExists(string name) { return m_VirtualButtons.ContainsKey(name); } public void RegisterVirtualAxis(CrossPlatformInputManager.VirtualAxis axis) { // check if we already have an axis with that name and log and error if we do if (m_VirtualAxes.ContainsKey(axis.name)) { Debug.LogError("There is already a virtual axis named " + axis.name + " registered."); } else { // add any new axes m_VirtualAxes.Add(axis.name, axis); // if we dont want to match with the input manager setting then revert to always using virtual if (!axis.matchWithInputManager) { m_AlwaysUseVirtual.Add(axis.name); } } } public void RegisterVirtualButton(CrossPlatformInputManager.VirtualButton button) { // check if already have a buttin with that name and log an error if we do if (m_VirtualButtons.ContainsKey(button.name)) { Debug.LogError("There is already a virtual button named " + button.name + " registered."); } else { // add any new buttons m_VirtualButtons.Add(button.name, button); // if we dont want to match to the input manager then always use a virtual axis if (!button.matchWithInputManager) { m_AlwaysUseVirtual.Add(button.name); } } } public void UnRegisterVirtualAxis(string name) { // if we have an axis with that name then remove it from our dictionary of registered axes if (m_VirtualAxes.ContainsKey(name)) { m_VirtualAxes.Remove(name); } } public void UnRegisterVirtualButton(string name) { // if we have a button with this name then remove it from our dictionary of registered buttons if (m_VirtualButtons.ContainsKey(name)) { m_VirtualButtons.Remove(name); } } // returns a reference to a named virtual axis if it exists otherwise null public CrossPlatformInputManager.VirtualAxis VirtualAxisReference(string name) { return m_VirtualAxes.ContainsKey(name) ? m_VirtualAxes[name] : null; } public void SetVirtualMousePositionX(float f) { virtualMousePosition = new Vector3(f, virtualMousePosition.y, virtualMousePosition.z); } public void SetVirtualMousePositionY(float f) { virtualMousePosition = new Vector3(virtualMousePosition.x, f, virtualMousePosition.z); } public void SetVirtualMousePositionZ(float f) { virtualMousePosition = new Vector3(virtualMousePosition.x, virtualMousePosition.y, f); } public abstract float GetAxis(string name, bool raw); public abstract bool GetButton(string name); public abstract bool GetButtonDown(string name); public abstract bool GetButtonUp(string name); public abstract void SetButtonDown(string name); public abstract void SetButtonUp(string name); public abstract void SetAxisPositive(string name); public abstract void SetAxisNegative(string name); public abstract void SetAxisZero(string name); public abstract void SetAxis(string name, float value); public abstract Vector3 MousePosition(); } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 1caf40fc8bebb6b43b2550c05ca791d6 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; namespace UnityStandardAssets.CrossPlatformInput.PlatformSpecific { public class StandaloneInput : VirtualInput { public override float GetAxis(string name, bool raw) { return raw ? Input.GetAxisRaw(name) : Input.GetAxis(name); } public override bool GetButton(string name) { return Input.GetButton(name); } public override bool GetButtonDown(string name) { return Input.GetButtonDown(name); } public override bool GetButtonUp(string name) { return Input.GetButtonUp(name); } public override void SetButtonDown(string name) { throw new Exception( " This is not possible to be called for standalone input. Please check your platform and code where this is called"); } public override void SetButtonUp(string name) { throw new Exception( " This is not possible to be called for standalone input. Please check your platform and code where this is called"); } public override void SetAxisPositive(string name) { throw new Exception( " This is not possible to be called for standalone input. Please check your platform and code where this is called"); } public override void SetAxisNegative(string name) { throw new Exception( " This is not possible to be called for standalone input. Please check your platform and code where this is called"); } public override void SetAxisZero(string name) { throw new Exception( " This is not possible to be called for standalone input. Please check your platform and code where this is called"); } public override void SetAxis(string name, float value) { throw new Exception( " This is not possible to be called for standalone input. Please check your platform and code where this is called"); } public override Vector3 MousePosition() { return Input.mousePosition; } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; namespace UnityStandardAssets.CrossPlatformInput.PlatformSpecific { public class MobileInput : VirtualInput { private void AddButton(string name) { // we have not registered this button yet so add it, happens in the constructor CrossPlatformInputManager.RegisterVirtualButton(new CrossPlatformInputManager.VirtualButton(name)); } private void AddAxes(string name) { // we have not registered this button yet so add it, happens in the constructor CrossPlatformInputManager.RegisterVirtualAxis(new CrossPlatformInputManager.VirtualAxis(name)); } public override float GetAxis(string name, bool raw) { if (!m_VirtualAxes.ContainsKey(name)) { AddAxes(name); } return m_VirtualAxes[name].GetValue; } public override void SetButtonDown(string name) { if (!m_VirtualButtons.ContainsKey(name)) { AddButton(name); } m_VirtualButtons[name].Pressed(); } public override void SetButtonUp(string name) { if (!m_VirtualButtons.ContainsKey(name)) { AddButton(name); } m_VirtualButtons[name].Released(); } public override void SetAxisPositive(string name) { if (!m_VirtualAxes.ContainsKey(name)) { AddAxes(name); } m_VirtualAxes[name].Update(1f); } public override void SetAxisNegative(string name) { if (!m_VirtualAxes.ContainsKey(name)) { AddAxes(name); } m_VirtualAxes[name].Update(-1f); } public override void SetAxisZero(string name) { if (!m_VirtualAxes.ContainsKey(name)) { AddAxes(name); } m_VirtualAxes[name].Update(0f); } public override void SetAxis(string name, float value) { if (!m_VirtualAxes.ContainsKey(name)) { AddAxes(name); } m_VirtualAxes[name].Update(value); } public override bool GetButtonDown(string name) { if (m_VirtualButtons.ContainsKey(name)) { return m_VirtualButtons[name].GetButtonDown; } AddButton(name); return m_VirtualButtons[name].GetButtonDown; } public override bool GetButtonUp(string name) { if (m_VirtualButtons.ContainsKey(name)) { return m_VirtualButtons[name].GetButtonUp; } AddButton(name); return m_VirtualButtons[name].GetButtonUp; } public override bool GetButton(string name) { if (m_VirtualButtons.ContainsKey(name)) { return m_VirtualButtons[name].GetButton; } AddButton(name); return m_VirtualButtons[name].GetButton; } public override Vector3 MousePosition() { return virtualMousePosition; } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 9703d53e47195aa4190acd11369ccd1b MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 9961032f4f02c4f41997c3ea399d2f22 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 37fac21d1f093d344816942d1abce94e MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: a1347817507220a4384f3ff6f7c24546 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: c5cb22d331ef7d64796f917c6a455a32 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; namespace UnityStandardAssets.Utility { public class WaypointProgressTracker : MonoBehaviour { // This script can be used with any object that is supposed to follow a // route marked out by waypoints. // This script manages the amount to look ahead along the route, // and keeps track of progress and laps. [SerializeField] private WaypointCircuit circuit; // A reference to the waypoint-based route we should follow [SerializeField] private float lookAheadForTargetOffset = 5; // The offset ahead along the route that the we will aim for [SerializeField] private float lookAheadForTargetFactor = .1f; // A multiplier adding distance ahead along the route to aim for, based on current speed [SerializeField] private float lookAheadForSpeedOffset = 10; // The offset ahead only the route for speed adjustments (applied as the rotation of the waypoint target transform) [SerializeField] private float lookAheadForSpeedFactor = .2f; // A multiplier adding distance ahead along the route for speed adjustments [SerializeField] private ProgressStyle progressStyle = ProgressStyle.SmoothAlongRoute; // whether to update the position smoothly along the route (good for curved paths) or just when we reach each waypoint. [SerializeField] private float pointToPointThreshold = 4; // proximity to waypoint which must be reached to switch target to next waypoint : only used in PointToPoint mode. public enum ProgressStyle { SmoothAlongRoute, PointToPoint, } // these are public, readable by other objects - i.e. for an AI to know where to head! public WaypointCircuit.RoutePoint targetPoint { get; private set; } public WaypointCircuit.RoutePoint speedPoint { get; private set; } public WaypointCircuit.RoutePoint progressPoint { get; private set; } public Transform target; private float progressDistance; // The progress round the route, used in smooth mode. private int progressNum; // the current waypoint number, used in point-to-point mode. private Vector3 lastPosition; // Used to calculate current speed (since we may not have a rigidbody component) private float speed; // current speed of this object (calculated from delta since last frame) // setup script properties private void Start() { // we use a transform to represent the point to aim for, and the point which // is considered for upcoming changes-of-speed. This allows this component // to communicate this information to the AI without requiring further dependencies. // You can manually create a transform and assign it to this component *and* the AI, // then this component will update it, and the AI can read it. if (target == null) { target = new GameObject(name + " Waypoint Target").transform; } Reset(); } // reset the object to sensible values public void Reset() { progressDistance = 0; progressNum = 0; if (progressStyle == ProgressStyle.PointToPoint) { target.position = circuit.Waypoints[progressNum].position; target.rotation = circuit.Waypoints[progressNum].rotation; } } private void Update() { if (progressStyle == ProgressStyle.SmoothAlongRoute) { // determine the position we should currently be aiming for // (this is different to the current progress position, it is a a certain amount ahead along the route) // we use lerp as a simple way of smoothing out the speed over time. if (Time.deltaTime > 0) { speed = Mathf.Lerp(speed, (lastPosition - transform.position).magnitude/Time.deltaTime, Time.deltaTime); } target.position = circuit.GetRoutePoint(progressDistance + lookAheadForTargetOffset + lookAheadForTargetFactor*speed) .position; target.rotation = Quaternion.LookRotation( circuit.GetRoutePoint(progressDistance + lookAheadForSpeedOffset + lookAheadForSpeedFactor*speed) .direction); // get our current progress along the route progressPoint = circuit.GetRoutePoint(progressDistance); Vector3 progressDelta = progressPoint.position - transform.position; if (Vector3.Dot(progressDelta, progressPoint.direction) < 0) { progressDistance += progressDelta.magnitude*0.5f; } lastPosition = transform.position; } else { // point to point mode. Just increase the waypoint if we're close enough: Vector3 targetDelta = target.position - transform.position; if (targetDelta.magnitude < pointToPointThreshold) { progressNum = (progressNum + 1)%circuit.Waypoints.Length; } target.position = circuit.Waypoints[progressNum].position; target.rotation = circuit.Waypoints[progressNum].rotation; // get our current progress along the route progressPoint = circuit.GetRoutePoint(progressDistance); Vector3 progressDelta = progressPoint.position - transform.position; if (Vector3.Dot(progressDelta, progressPoint.direction) < 0) { progressDistance += progressDelta.magnitude; } lastPosition = transform.position; } } private void OnDrawGizmos() { if (Application.isPlaying) { Gizmos.color = Color.green; Gizmos.DrawLine(transform.position, target.position); Gizmos.DrawWireSphere(circuit.GetRoutePosition(progressDistance), 1); Gizmos.color = Color.yellow; Gizmos.DrawLine(target.position, target.position + target.forward); } } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: b43a4ef15621158419a2b639f7a98245 folderAsset: yes DefaultImporter: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 29014cd42b6d273408e0ceefd336c0b3 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; namespace UnityStandardAssets.Utility { public class DynamicShadowSettings : MonoBehaviour { public Light sunLight; public float minHeight = 10; public float minShadowDistance = 80; public float minShadowBias = 1; public float maxHeight = 1000; public float maxShadowDistance = 10000; public float maxShadowBias = 0.1f; public float adaptTime = 1; private float m_SmoothHeight; private float m_ChangeSpeed; private float m_OriginalStrength = 1; private void Start() { m_OriginalStrength = sunLight.shadowStrength; } // Update is called once per frame private void Update() { Ray ray = new Ray(Camera.main.transform.position, -Vector3.up); RaycastHit hit; float height = transform.position.y; if (Physics.Raycast(ray, out hit)) { height = hit.distance; } if (Mathf.Abs(height - m_SmoothHeight) > 1) { m_SmoothHeight = Mathf.SmoothDamp(m_SmoothHeight, height, ref m_ChangeSpeed, adaptTime); } float i = Mathf.InverseLerp(minHeight, maxHeight, m_SmoothHeight); QualitySettings.shadowDistance = Mathf.Lerp(minShadowDistance, maxShadowDistance, i); sunLight.shadowBias = Mathf.Lerp(minShadowBias, maxShadowBias, 1 - ((1 - i)*(1 - i))); sunLight.shadowStrength = Mathf.Lerp(m_OriginalStrength, 0, i); } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: c8634e062924929664361c08745211fb MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using System.Collections; using UnityEngine; using UnityEngine.SceneManagement; #if UNITY_EDITOR using UnityEditor; #endif namespace UnityStandardAssets.Utility { public class TimedObjectActivator : MonoBehaviour { public enum Action { Activate, Deactivate, Destroy, ReloadLevel, Call, } [Serializable] public class Entry { public GameObject target; public Action action; public float delay; } [Serializable] public class Entries { public Entry[] entries; } public Entries entries = new Entries(); private void Awake() { foreach (Entry entry in entries.entries) { switch (entry.action) { case Action.Activate: StartCoroutine(Activate(entry)); break; case Action.Deactivate: StartCoroutine(Deactivate(entry)); break; case Action.Destroy: Destroy(entry.target, entry.delay); break; case Action.ReloadLevel: StartCoroutine(ReloadLevel(entry)); break; } } } private IEnumerator Activate(Entry entry) { yield return new WaitForSeconds(entry.delay); entry.target.SetActive(true); } private IEnumerator Deactivate(Entry entry) { yield return new WaitForSeconds(entry.delay); entry.target.SetActive(false); } private IEnumerator ReloadLevel(Entry entry) { yield return new WaitForSeconds(entry.delay); SceneManager.LoadScene(SceneManager.GetSceneAt(0).path); } } } namespace UnityStandardAssets.Utility.Inspector { #if UNITY_EDITOR [CustomPropertyDrawer(typeof (TimedObjectActivator.Entries))] public class EntriesDrawer : PropertyDrawer { private const float k_LineHeight = 18; private const float k_Spacing = 4; public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { EditorGUI.BeginProperty(position, label, property); float x = position.x; float y = position.y; float width = position.width; // Draw label EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); // Don't make child fields be indented var indent = EditorGUI.indentLevel; EditorGUI.indentLevel = 0; var entries = property.FindPropertyRelative("entries"); if (entries.arraySize > 0) { float actionWidth = .25f*width; float targetWidth = .6f*width; float delayWidth = .1f*width; float buttonWidth = .05f*width; for (int i = 0; i < entries.arraySize; ++i) { y += k_LineHeight + k_Spacing; var entry = entries.GetArrayElementAtIndex(i); float rowX = x; // Calculate rects Rect actionRect = new Rect(rowX, y, actionWidth, k_LineHeight); rowX += actionWidth; Rect targetRect = new Rect(rowX, y, targetWidth, k_LineHeight); rowX += targetWidth; Rect delayRect = new Rect(rowX, y, delayWidth, k_LineHeight); rowX += delayWidth; Rect buttonRect = new Rect(rowX, y, buttonWidth, k_LineHeight); rowX += buttonWidth; // Draw fields - passs GUIContent.none to each so they are drawn without labels if (entry.FindPropertyRelative("action").enumValueIndex != (int) TimedObjectActivator.Action.ReloadLevel) { EditorGUI.PropertyField(actionRect, entry.FindPropertyRelative("action"), GUIContent.none); EditorGUI.PropertyField(targetRect, entry.FindPropertyRelative("target"), GUIContent.none); } else { actionRect.width = actionRect.width + targetRect.width; EditorGUI.PropertyField(actionRect, entry.FindPropertyRelative("action"), GUIContent.none); } EditorGUI.PropertyField(delayRect, entry.FindPropertyRelative("delay"), GUIContent.none); if (GUI.Button(buttonRect, "-")) { entries.DeleteArrayElementAtIndex(i); break; } } } // add & sort buttons y += k_LineHeight + k_Spacing; var addButtonRect = new Rect(position.x + position.width - 120, y, 60, k_LineHeight); if (GUI.Button(addButtonRect, "Add")) { entries.InsertArrayElementAtIndex(entries.arraySize); } var sortButtonRect = new Rect(position.x + position.width - 60, y, 60, k_LineHeight); if (GUI.Button(sortButtonRect, "Sort")) { bool changed = true; while (entries.arraySize > 1 && changed) { changed = false; for (int i = 0; i < entries.arraySize - 1; ++i) { var e1 = entries.GetArrayElementAtIndex(i); var e2 = entries.GetArrayElementAtIndex(i + 1); if (e1.FindPropertyRelative("delay").floatValue > e2.FindPropertyRelative("delay").floatValue) { entries.MoveArrayElement(i + 1, i); changed = true; break; } } } } // Set indent back to what it was EditorGUI.indentLevel = indent; // EditorGUI.EndProperty(); } public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { SerializedProperty entries = property.FindPropertyRelative("entries"); float lineAndSpace = k_LineHeight + k_Spacing; return 40 + (entries.arraySize*lineAndSpace) + lineAndSpace; } } #endif }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; using UnityEngine.SceneManagement; using UnityStandardAssets.CrossPlatformInput; [RequireComponent(typeof (GUITexture))] public class ForcedReset : MonoBehaviour { private void Update() { // if we have forced a reset ... if (CrossPlatformInputManager.GetButtonDown("ResetObject")) { //... reload the scene SceneManager.LoadScene(SceneManager.GetSceneAt(0).path); } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; namespace UnityStandardAssets.Utility { public class AutoMoveAndRotate : MonoBehaviour { public Vector3andSpace moveUnitsPerSecond; public Vector3andSpace rotateDegreesPerSecond; public bool ignoreTimescale; private float m_LastRealTime; private void Start() { m_LastRealTime = Time.realtimeSinceStartup; } // Update is called once per frame private void Update() { float deltaTime = Time.deltaTime; if (ignoreTimescale) { deltaTime = (Time.realtimeSinceStartup - m_LastRealTime); m_LastRealTime = Time.realtimeSinceStartup; } transform.Translate(moveUnitsPerSecond.value*deltaTime, moveUnitsPerSecond.space); transform.Rotate(rotateDegreesPerSecond.value*deltaTime, moveUnitsPerSecond.space); } [Serializable] public class Vector3andSpace { public Vector3 value; public Space space = Space.Self; } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 8566902b50d5bfb4fb7f8b89f9cdbe8b MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using System.Collections; using UnityEngine; using Random = UnityEngine.Random; namespace UnityStandardAssets.Utility { public class ParticleSystemDestroyer : MonoBehaviour { // allows a particle system to exist for a specified duration, // then shuts off emission, and waits for all particles to expire // before destroying the gameObject public float minDuration = 8; public float maxDuration = 10; private float m_MaxLifetime; private bool m_EarlyStop; private IEnumerator Start() { var systems = GetComponentsInChildren<ParticleSystem>(); // find out the maximum lifetime of any particles in this effect foreach (var system in systems) { m_MaxLifetime = Mathf.Max(system.startLifetime, m_MaxLifetime); } // wait for random duration float stopTime = Time.time + Random.Range(minDuration, maxDuration); while (Time.time < stopTime || m_EarlyStop) { yield return null; } Debug.Log("stopping " + name); // turn off emission foreach (var system in systems) { var emission = system.emission; emission.enabled = false; } BroadcastMessage("Extinguish", SendMessageOptions.DontRequireReceiver); // wait for any remaining particles to expire yield return new WaitForSeconds(m_MaxLifetime); Destroy(gameObject); } public void Stop() { // stops the particle system early m_EarlyStop = true; } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 9c4978ff6447f9040b84acc89b0bbdc8 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 3a7cedf246fca744f90cbdc9dbe41166 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using System.Collections.Generic; using UnityEngine; #if UNITY_EDITOR using UnityEditor; #endif namespace UnityStandardAssets.Utility { public class AutoMobileShaderSwitch : MonoBehaviour { [SerializeField] private ReplacementList m_ReplacementList; // Use this for initialization private void OnEnable() { #if UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_BLACKBERRY var renderers = FindObjectsOfType<Renderer>(); Debug.Log (renderers.Length+" renderers"); var oldMaterials = new List<Material>(); var newMaterials = new List<Material>(); int materialsReplaced = 0; int materialInstancesReplaced = 0; foreach(ReplacementDefinition replacementDef in m_ReplacementList.items) { foreach(var r in renderers) { Material[] modifiedMaterials = null; for(int n=0; n<r.sharedMaterials.Length; ++n) { var material = r.sharedMaterials[n]; if (material.shader == replacementDef.original) { if (modifiedMaterials == null) { modifiedMaterials = r.materials; } if (!oldMaterials.Contains(material)) { oldMaterials.Add(material); Material newMaterial = (Material)Instantiate(material); newMaterial.shader = replacementDef.replacement; newMaterials.Add(newMaterial); ++materialsReplaced; } Debug.Log ("replacing "+r.gameObject.name+" renderer "+n+" with "+newMaterials[oldMaterials.IndexOf(material)].name); modifiedMaterials[n] = newMaterials[oldMaterials.IndexOf(material)]; ++materialInstancesReplaced; } } if (modifiedMaterials != null) { r.materials = modifiedMaterials; } } } Debug.Log (materialInstancesReplaced+" material instances replaced"); Debug.Log (materialsReplaced+" materials replaced"); for(int n=0; n<oldMaterials.Count; ++n) { Debug.Log (oldMaterials[n].name+" ("+oldMaterials[n].shader.name+")"+" replaced with "+newMaterials[n].name+" ("+newMaterials[n].shader.name+")"); } #endif } [Serializable] public class ReplacementDefinition { public Shader original = null; public Shader replacement = null; } [Serializable] public class ReplacementList { public ReplacementDefinition[] items = new ReplacementDefinition[0]; } } } namespace UnityStandardAssets.Utility.Inspector { #if UNITY_EDITOR [CustomPropertyDrawer(typeof (AutoMobileShaderSwitch.ReplacementList))] public class ReplacementListDrawer : PropertyDrawer { const float k_LineHeight = 18; const float k_Spacing = 4; public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { EditorGUI.BeginProperty(position, label, property); float x = position.x; float y = position.y; float inspectorWidth = position.width; // Don't make child fields be indented var indent = EditorGUI.indentLevel; EditorGUI.indentLevel = 0; var items = property.FindPropertyRelative("items"); var titles = new string[] {"Original", "Replacement", ""}; var props = new string[] {"original", "replacement", "-"}; var widths = new float[] {.45f, .45f, .1f}; const float lineHeight = 18; bool changedLength = false; if (items.arraySize > 0) { for (int i = -1; i < items.arraySize; ++i) { var item = items.GetArrayElementAtIndex(i); float rowX = x; for (int n = 0; n < props.Length; ++n) { float w = widths[n]*inspectorWidth; // Calculate rects Rect rect = new Rect(rowX, y, w, lineHeight); rowX += w; if (i == -1) { // draw title labels EditorGUI.LabelField(rect, titles[n]); } else { if (props[n] == "-" || props[n] == "^" || props[n] == "v") { if (GUI.Button(rect, props[n])) { switch (props[n]) { case "-": items.DeleteArrayElementAtIndex(i); items.DeleteArrayElementAtIndex(i); changedLength = true; break; case "v": if (i > 0) { items.MoveArrayElement(i, i + 1); } break; case "^": if (i < items.arraySize - 1) { items.MoveArrayElement(i, i - 1); } break; } } } else { SerializedProperty prop = item.FindPropertyRelative(props[n]); EditorGUI.PropertyField(rect, prop, GUIContent.none); } } } y += lineHeight + k_Spacing; if (changedLength) { break; } } } // add button var addButtonRect = new Rect((x + position.width) - widths[widths.Length - 1]*inspectorWidth, y, widths[widths.Length - 1]*inspectorWidth, lineHeight); if (GUI.Button(addButtonRect, "+")) { items.InsertArrayElementAtIndex(items.arraySize); } y += lineHeight + k_Spacing; // Set indent back to what it was EditorGUI.indentLevel = indent; EditorGUI.EndProperty(); } public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { SerializedProperty items = property.FindPropertyRelative("items"); float lineAndSpace = k_LineHeight + k_Spacing; return 40 + (items.arraySize*lineAndSpace) + lineAndSpace; } } #endif }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: c1bbfafbde15c854681023b9e01e12dd MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using System.Collections; using UnityEngine; #if UNITY_EDITOR using UnityEditor; #endif namespace UnityStandardAssets.Utility { public class WaypointCircuit : MonoBehaviour { public WaypointList waypointList = new WaypointList(); [SerializeField] private bool smoothRoute = true; private int numPoints; private Vector3[] points; private float[] distances; public float editorVisualisationSubsteps = 100; public float Length { get; private set; } public Transform[] Waypoints { get { return waypointList.items; } } //this being here will save GC allocs private int p0n; private int p1n; private int p2n; private int p3n; private float i; private Vector3 P0; private Vector3 P1; private Vector3 P2; private Vector3 P3; // Use this for initialization private void Awake() { if (Waypoints.Length > 1) { CachePositionsAndDistances(); } numPoints = Waypoints.Length; } public RoutePoint GetRoutePoint(float dist) { // position and direction Vector3 p1 = GetRoutePosition(dist); Vector3 p2 = GetRoutePosition(dist + 0.1f); Vector3 delta = p2 - p1; return new RoutePoint(p1, delta.normalized); } public Vector3 GetRoutePosition(float dist) { int point = 0; if (Length == 0) { Length = distances[distances.Length - 1]; } dist = Mathf.Repeat(dist, Length); while (distances[point] < dist) { ++point; } // get nearest two points, ensuring points wrap-around start & end of circuit p1n = ((point - 1) + numPoints)%numPoints; p2n = point; // found point numbers, now find interpolation value between the two middle points i = Mathf.InverseLerp(distances[p1n], distances[p2n], dist); if (smoothRoute) { // smooth catmull-rom calculation between the two relevant points // get indices for the surrounding 2 points, because // four points are required by the catmull-rom function p0n = ((point - 2) + numPoints)%numPoints; p3n = (point + 1)%numPoints; // 2nd point may have been the 'last' point - a dupe of the first, // (to give a value of max track distance instead of zero) // but now it must be wrapped back to zero if that was the case. p2n = p2n%numPoints; P0 = points[p0n]; P1 = points[p1n]; P2 = points[p2n]; P3 = points[p3n]; return CatmullRom(P0, P1, P2, P3, i); } else { // simple linear lerp between the two points: p1n = ((point - 1) + numPoints)%numPoints; p2n = point; return Vector3.Lerp(points[p1n], points[p2n], i); } } private Vector3 CatmullRom(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float i) { // comments are no use here... it's the catmull-rom equation. // Un-magic this, lord vector! return 0.5f* ((2*p1) + (-p0 + p2)*i + (2*p0 - 5*p1 + 4*p2 - p3)*i*i + (-p0 + 3*p1 - 3*p2 + p3)*i*i*i); } private void CachePositionsAndDistances() { // transfer the position of each point and distances between points to arrays for // speed of lookup at runtime points = new Vector3[Waypoints.Length + 1]; distances = new float[Waypoints.Length + 1]; float accumulateDistance = 0; for (int i = 0; i < points.Length; ++i) { var t1 = Waypoints[(i)%Waypoints.Length]; var t2 = Waypoints[(i + 1)%Waypoints.Length]; if (t1 != null && t2 != null) { Vector3 p1 = t1.position; Vector3 p2 = t2.position; points[i] = Waypoints[i%Waypoints.Length].position; distances[i] = accumulateDistance; accumulateDistance += (p1 - p2).magnitude; } } } private void OnDrawGizmos() { DrawGizmos(false); } private void OnDrawGizmosSelected() { DrawGizmos(true); } private void DrawGizmos(bool selected) { waypointList.circuit = this; if (Waypoints.Length > 1) { numPoints = Waypoints.Length; CachePositionsAndDistances(); Length = distances[distances.Length - 1]; Gizmos.color = selected ? Color.yellow : new Color(1, 1, 0, 0.5f); Vector3 prev = Waypoints[0].position; if (smoothRoute) { for (float dist = 0; dist < Length; dist += Length/editorVisualisationSubsteps) { Vector3 next = GetRoutePosition(dist + 1); Gizmos.DrawLine(prev, next); prev = next; } Gizmos.DrawLine(prev, Waypoints[0].position); } else { for (int n = 0; n < Waypoints.Length; ++n) { Vector3 next = Waypoints[(n + 1)%Waypoints.Length].position; Gizmos.DrawLine(prev, next); prev = next; } } } } [Serializable] public class WaypointList { public WaypointCircuit circuit; public Transform[] items = new Transform[0]; } public struct RoutePoint { public Vector3 position; public Vector3 direction; public RoutePoint(Vector3 position, Vector3 direction) { this.position = position; this.direction = direction; } } } } namespace UnityStandardAssets.Utility.Inspector { #if UNITY_EDITOR [CustomPropertyDrawer(typeof (WaypointCircuit.WaypointList))] public class WaypointListDrawer : PropertyDrawer { private float lineHeight = 18; private float spacing = 4; public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { EditorGUI.BeginProperty(position, label, property); float x = position.x; float y = position.y; float inspectorWidth = position.width; // Draw label // Don't make child fields be indented var indent = EditorGUI.indentLevel; EditorGUI.indentLevel = 0; var items = property.FindPropertyRelative("items"); var titles = new string[] {"Transform", "", "", ""}; var props = new string[] {"transform", "^", "v", "-"}; var widths = new float[] {.7f, .1f, .1f, .1f}; float lineHeight = 18; bool changedLength = false; if (items.arraySize > 0) { for (int i = -1; i < items.arraySize; ++i) { var item = items.GetArrayElementAtIndex(i); float rowX = x; for (int n = 0; n < props.Length; ++n) { float w = widths[n]*inspectorWidth; // Calculate rects Rect rect = new Rect(rowX, y, w, lineHeight); rowX += w; if (i == -1) { EditorGUI.LabelField(rect, titles[n]); } else { if (n == 0) { EditorGUI.ObjectField(rect, item.objectReferenceValue, typeof (Transform), true); } else { if (GUI.Button(rect, props[n])) { switch (props[n]) { case "-": items.DeleteArrayElementAtIndex(i); items.DeleteArrayElementAtIndex(i); changedLength = true; break; case "v": if (i > 0) { items.MoveArrayElement(i, i + 1); } break; case "^": if (i < items.arraySize - 1) { items.MoveArrayElement(i, i - 1); } break; } } } } } y += lineHeight + spacing; if (changedLength) { break; } } } else { // add button var addButtonRect = new Rect((x + position.width) - widths[widths.Length - 1]*inspectorWidth, y, widths[widths.Length - 1]*inspectorWidth, lineHeight); if (GUI.Button(addButtonRect, "+")) { items.InsertArrayElementAtIndex(items.arraySize); } y += lineHeight + spacing; } // add all button var addAllButtonRect = new Rect(x, y, inspectorWidth, lineHeight); if (GUI.Button(addAllButtonRect, "Assign using all child objects")) { var circuit = property.FindPropertyRelative("circuit").objectReferenceValue as WaypointCircuit; var children = new Transform[circuit.transform.childCount]; int n = 0; foreach (Transform child in circuit.transform) { children[n++] = child; } Array.Sort(children, new TransformNameComparer()); circuit.waypointList.items = new Transform[children.Length]; for (n = 0; n < children.Length; ++n) { circuit.waypointList.items[n] = children[n]; } } y += lineHeight + spacing; // rename all button var renameButtonRect = new Rect(x, y, inspectorWidth, lineHeight); if (GUI.Button(renameButtonRect, "Auto Rename numerically from this order")) { var circuit = property.FindPropertyRelative("circuit").objectReferenceValue as WaypointCircuit; int n = 0; foreach (Transform child in circuit.waypointList.items) { child.name = "Waypoint " + (n++).ToString("000"); } } y += lineHeight + spacing; // Set indent back to what it was EditorGUI.indentLevel = indent; EditorGUI.EndProperty(); } public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { SerializedProperty items = property.FindPropertyRelative("items"); float lineAndSpace = lineHeight + spacing; return 40 + (items.arraySize*lineAndSpace) + lineAndSpace; } // comparer for check distances in ray cast hits public class TransformNameComparer : IComparer { public int Compare(object x, object y) { return ((Transform) x).name.CompareTo(((Transform) y).name); } } } #endif }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using System.Collections; using UnityEngine; using UnityEngine.EventSystems; public class EventSystemChecker : MonoBehaviour { //public GameObject eventSystem; // Use this for initialization void Awake () { if(!FindObjectOfType<EventSystem>()) { //Instantiate(eventSystem); GameObject obj = new GameObject("EventSystem"); obj.AddComponent<EventSystem>(); obj.AddComponent<StandaloneInputModule>().forceModuleActive = true; } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; namespace UnityStandardAssets.Utility { public class ObjectResetter : MonoBehaviour { private Vector3 originalPosition; private Quaternion originalRotation; private List<Transform> originalStructure; private Rigidbody Rigidbody; // Use this for initialization private void Start() { originalStructure = new List<Transform>(GetComponentsInChildren<Transform>()); originalPosition = transform.position; originalRotation = transform.rotation; Rigidbody = GetComponent<Rigidbody>(); } public void DelayedReset(float delay) { StartCoroutine(ResetCoroutine(delay)); } public IEnumerator ResetCoroutine(float delay) { yield return new WaitForSeconds(delay); // remove any gameobjects added (fire, skid trails, etc) foreach (var t in GetComponentsInChildren<Transform>()) { if (!originalStructure.Contains(t)) { t.parent = null; } } transform.position = originalPosition; transform.rotation = originalRotation; if (Rigidbody) { Rigidbody.velocity = Vector3.zero; Rigidbody.angularVelocity = Vector3.zero; } SendMessage("Reset"); } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; namespace UnityStandardAssets.Utility { [Serializable] public class CurveControlledBob { public float HorizontalBobRange = 0.33f; public float VerticalBobRange = 0.33f; public AnimationCurve Bobcurve = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(0.5f, 1f), new Keyframe(1f, 0f), new Keyframe(1.5f, -1f), new Keyframe(2f, 0f)); // sin curve for head bob public float VerticaltoHorizontalRatio = 1f; private float m_CyclePositionX; private float m_CyclePositionY; private float m_BobBaseInterval; private Vector3 m_OriginalCameraPosition; private float m_Time; public void Setup(Camera camera, float bobBaseInterval) { m_BobBaseInterval = bobBaseInterval; m_OriginalCameraPosition = camera.transform.localPosition; // get the length of the curve in time m_Time = Bobcurve[Bobcurve.length - 1].time; } public Vector3 DoHeadBob(float speed) { float xPos = m_OriginalCameraPosition.x + (Bobcurve.Evaluate(m_CyclePositionX)*HorizontalBobRange); float yPos = m_OriginalCameraPosition.y + (Bobcurve.Evaluate(m_CyclePositionY)*VerticalBobRange); m_CyclePositionX += (speed*Time.deltaTime)/m_BobBaseInterval; m_CyclePositionY += ((speed*Time.deltaTime)/m_BobBaseInterval)*VerticaltoHorizontalRatio; if (m_CyclePositionX > m_Time) { m_CyclePositionX = m_CyclePositionX - m_Time; } if (m_CyclePositionY > m_Time) { m_CyclePositionY = m_CyclePositionY - m_Time; } return new Vector3(xPos, yPos, 0f); } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; using UnityStandardAssets.CrossPlatformInput; namespace UnityStandardAssets.Utility { public class SimpleMouseRotator : MonoBehaviour { // A mouselook behaviour with constraints which operate relative to // this gameobject's initial rotation. // Only rotates around local X and Y. // Works in local coordinates, so if this object is parented // to another moving gameobject, its local constraints will // operate correctly // (Think: looking out the side window of a car, or a gun turret // on a moving spaceship with a limited angular range) // to have no constraints on an axis, set the rotationRange to 360 or greater. public Vector2 rotationRange = new Vector3(70, 70); public float rotationSpeed = 10; public float dampingTime = 0.2f; public bool autoZeroVerticalOnMobile = true; public bool autoZeroHorizontalOnMobile = false; public bool relative = true; private Vector3 m_TargetAngles; private Vector3 m_FollowAngles; private Vector3 m_FollowVelocity; private Quaternion m_OriginalRotation; private void Start() { m_OriginalRotation = transform.localRotation; } private void Update() { // we make initial calculations from the original local rotation transform.localRotation = m_OriginalRotation; // read input from mouse or mobile controls float inputH; float inputV; if (relative) { inputH = CrossPlatformInputManager.GetAxis("Mouse X"); inputV = CrossPlatformInputManager.GetAxis("Mouse Y"); // wrap values to avoid springing quickly the wrong way from positive to negative if (m_TargetAngles.y > 180) { m_TargetAngles.y -= 360; m_FollowAngles.y -= 360; } if (m_TargetAngles.x > 180) { m_TargetAngles.x -= 360; m_FollowAngles.x -= 360; } if (m_TargetAngles.y < -180) { m_TargetAngles.y += 360; m_FollowAngles.y += 360; } if (m_TargetAngles.x < -180) { m_TargetAngles.x += 360; m_FollowAngles.x += 360; } #if MOBILE_INPUT // on mobile, sometimes we want input mapped directly to tilt value, // so it springs back automatically when the look input is released. if (autoZeroHorizontalOnMobile) { m_TargetAngles.y = Mathf.Lerp (-rotationRange.y * 0.5f, rotationRange.y * 0.5f, inputH * .5f + .5f); } else { m_TargetAngles.y += inputH * rotationSpeed; } if (autoZeroVerticalOnMobile) { m_TargetAngles.x = Mathf.Lerp (-rotationRange.x * 0.5f, rotationRange.x * 0.5f, inputV * .5f + .5f); } else { m_TargetAngles.x += inputV * rotationSpeed; } #else // with mouse input, we have direct control with no springback required. m_TargetAngles.y += inputH*rotationSpeed; m_TargetAngles.x += inputV*rotationSpeed; #endif // clamp values to allowed range m_TargetAngles.y = Mathf.Clamp(m_TargetAngles.y, -rotationRange.y*0.5f, rotationRange.y*0.5f); m_TargetAngles.x = Mathf.Clamp(m_TargetAngles.x, -rotationRange.x*0.5f, rotationRange.x*0.5f); } else { inputH = Input.mousePosition.x; inputV = Input.mousePosition.y; // set values to allowed range m_TargetAngles.y = Mathf.Lerp(-rotationRange.y*0.5f, rotationRange.y*0.5f, inputH/Screen.width); m_TargetAngles.x = Mathf.Lerp(-rotationRange.x*0.5f, rotationRange.x*0.5f, inputV/Screen.height); } // smoothly interpolate current values to target angles m_FollowAngles = Vector3.SmoothDamp(m_FollowAngles, m_TargetAngles, ref m_FollowVelocity, dampingTime); // update the actual gameobject's rotation transform.localRotation = m_OriginalRotation*Quaternion.Euler(-m_FollowAngles.x, m_FollowAngles.y, 0); } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; using UnityEngine.UI; namespace UnityStandardAssets.Utility { [RequireComponent(typeof (Text))] public class FPSCounter : MonoBehaviour { const float fpsMeasurePeriod = 0.5f; private int m_FpsAccumulator = 0; private float m_FpsNextPeriod = 0; private int m_CurrentFps; const string display = "{0} FPS"; private Text m_Text; private void Start() { m_FpsNextPeriod = Time.realtimeSinceStartup + fpsMeasurePeriod; m_Text = GetComponent<Text>(); } private void Update() { // measure average frames per second m_FpsAccumulator++; if (Time.realtimeSinceStartup > m_FpsNextPeriod) { m_CurrentFps = (int) (m_FpsAccumulator/fpsMeasurePeriod); m_FpsAccumulator = 0; m_FpsNextPeriod += fpsMeasurePeriod; m_Text.text = string.Format(display, m_CurrentFps); } } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using System.Collections; using UnityEngine; namespace UnityStandardAssets.Utility { [Serializable] public class LerpControlledBob { public float BobDuration; public float BobAmount; private float m_Offset = 0f; // provides the offset that can be used public float Offset() { return m_Offset; } public IEnumerator DoBobCycle() { // make the camera move down slightly float t = 0f; while (t < BobDuration) { m_Offset = Mathf.Lerp(0f, BobAmount, t/BobDuration); t += Time.deltaTime; yield return new WaitForFixedUpdate(); } // make it move back to neutral t = 0f; while (t < BobDuration) { m_Offset = Mathf.Lerp(BobAmount, 0f, t/BobDuration); t += Time.deltaTime; yield return new WaitForFixedUpdate(); } m_Offset = 0f; } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using System.Collections; using UnityEngine; namespace UnityStandardAssets.Utility { [Serializable] public class FOVKick { public Camera Camera; // optional camera setup, if null the main camera will be used [HideInInspector] public float originalFov; // the original fov public float FOVIncrease = 3f; // the amount the field of view increases when going into a run public float TimeToIncrease = 1f; // the amount of time the field of view will increase over public float TimeToDecrease = 1f; // the amount of time the field of view will take to return to its original size public AnimationCurve IncreaseCurve; public void Setup(Camera camera) { CheckStatus(camera); Camera = camera; originalFov = camera.fieldOfView; } private void CheckStatus(Camera camera) { if (camera == null) { throw new Exception("FOVKick camera is null, please supply the camera to the constructor"); } if (IncreaseCurve == null) { throw new Exception( "FOVKick Increase curve is null, please define the curve for the field of view kicks"); } } public void ChangeCamera(Camera camera) { Camera = camera; } public IEnumerator FOVKickUp() { float t = Mathf.Abs((Camera.fieldOfView - originalFov)/FOVIncrease); while (t < TimeToIncrease) { Camera.fieldOfView = originalFov + (IncreaseCurve.Evaluate(t/TimeToIncrease)*FOVIncrease); t += Time.deltaTime; yield return new WaitForEndOfFrame(); } } public IEnumerator FOVKickDown() { float t = Mathf.Abs((Camera.fieldOfView - originalFov)/FOVIncrease); while (t > 0) { Camera.fieldOfView = originalFov + (IncreaseCurve.Evaluate(t/TimeToDecrease)*FOVIncrease); t -= Time.deltaTime; yield return new WaitForEndOfFrame(); } //make sure that fov returns to the original size Camera.fieldOfView = originalFov; } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 58650e15a2607e44daa0f150e0061d89 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 70852dc981465ea48bb527b9e33a87fd MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; namespace UnityStandardAssets.Utility { public class CameraRefocus { public Camera Camera; public Vector3 Lookatpoint; public Transform Parent; private Vector3 m_OrigCameraPos; private bool m_Refocus; public CameraRefocus(Camera camera, Transform parent, Vector3 origCameraPos) { m_OrigCameraPos = origCameraPos; Camera = camera; Parent = parent; } public void ChangeCamera(Camera camera) { Camera = camera; } public void ChangeParent(Transform parent) { Parent = parent; } public void GetFocusPoint() { RaycastHit hitInfo; if (Physics.Raycast(Parent.transform.position + m_OrigCameraPos, Parent.transform.forward, out hitInfo, 100f)) { Lookatpoint = hitInfo.point; m_Refocus = true; return; } m_Refocus = false; } public void SetFocusPoint() { if (m_Refocus) { Camera.transform.LookAt(Lookatpoint); } } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: b27507c5d0efbbd47ac8c1de9a1a0a35 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: cadd54e4832aeef4b9359f44cbe335cd MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 246cc59c7a84ea44f87f6b70acfe30c5 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 6045a93fb05b9c74884821030da2c46c MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; namespace UnityStandardAssets.Utility { public class TimedObjectDestructor : MonoBehaviour { [SerializeField] private float m_TimeOut = 1.0f; [SerializeField] private bool m_DetachChildren = false; private void Awake() { Invoke("DestroyNow", m_TimeOut); } private void DestroyNow() { if (m_DetachChildren) { transform.DetachChildren(); } DestroyObject(gameObject); } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 9b886447cba80f74e820adb3c9e70c76 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 643c971818f68d3439e84b5d8bdafe07 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: f76806479d916a64aa03f8e3eba7912f MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 22bbf57ec543cee42a5aa0ec2dd9e457 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; namespace UnityStandardAssets.Utility { public class FollowTarget : MonoBehaviour { public Transform target; public Vector3 offset = new Vector3(0f, 7.5f, 0f); private void LateUpdate() { transform.position = target.position + offset; } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; namespace UnityStandardAssets.Utility { public class SimpleActivatorMenu : MonoBehaviour { // An incredibly simple menu which, when given references // to gameobjects in the scene public GUIText camSwitchButton; public GameObject[] objects; private int m_CurrentActiveObject; private void OnEnable() { // active object starts from first in array m_CurrentActiveObject = 0; camSwitchButton.text = objects[m_CurrentActiveObject].name; } public void NextCamera() { int nextactiveobject = m_CurrentActiveObject + 1 >= objects.Length ? 0 : m_CurrentActiveObject + 1; for (int i = 0; i < objects.Length; i++) { objects[i].SetActive(i == nextactiveobject); } m_CurrentActiveObject = nextactiveobject; camSwitchButton.text = objects[m_CurrentActiveObject].name; } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 69b69a5b0e0a85b4aa97a7edc40c37d1 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using System.Collections; using UnityEngine; namespace UnityStandardAssets.Utility { public class DragRigidbody : MonoBehaviour { const float k_Spring = 50.0f; const float k_Damper = 5.0f; const float k_Drag = 10.0f; const float k_AngularDrag = 5.0f; const float k_Distance = 0.2f; const bool k_AttachToCenterOfMass = false; private SpringJoint m_SpringJoint; private void Update() { // Make sure the user pressed the mouse down if (!Input.GetMouseButtonDown(0)) { return; } var mainCamera = FindCamera(); // We need to actually hit an object RaycastHit hit = new RaycastHit(); if ( !Physics.Raycast(mainCamera.ScreenPointToRay(Input.mousePosition).origin, mainCamera.ScreenPointToRay(Input.mousePosition).direction, out hit, 100, Physics.DefaultRaycastLayers)) { return; } // We need to hit a rigidbody that is not kinematic if (!hit.rigidbody || hit.rigidbody.isKinematic) { return; } if (!m_SpringJoint) { var go = new GameObject("Rigidbody dragger"); Rigidbody body = go.AddComponent<Rigidbody>(); m_SpringJoint = go.AddComponent<SpringJoint>(); body.isKinematic = true; } m_SpringJoint.transform.position = hit.point; m_SpringJoint.anchor = Vector3.zero; m_SpringJoint.spring = k_Spring; m_SpringJoint.damper = k_Damper; m_SpringJoint.maxDistance = k_Distance; m_SpringJoint.connectedBody = hit.rigidbody; StartCoroutine("DragObject", hit.distance); } private IEnumerator DragObject(float distance) { var oldDrag = m_SpringJoint.connectedBody.drag; var oldAngularDrag = m_SpringJoint.connectedBody.angularDrag; m_SpringJoint.connectedBody.drag = k_Drag; m_SpringJoint.connectedBody.angularDrag = k_AngularDrag; var mainCamera = FindCamera(); while (Input.GetMouseButton(0)) { var ray = mainCamera.ScreenPointToRay(Input.mousePosition); m_SpringJoint.transform.position = ray.GetPoint(distance); yield return null; } if (m_SpringJoint.connectedBody) { m_SpringJoint.connectedBody.drag = oldDrag; m_SpringJoint.connectedBody.angularDrag = oldAngularDrag; m_SpringJoint.connectedBody = null; } } private Camera FindCamera() { if (GetComponent<Camera>()) { return GetComponent<Camera>(); } return Camera.main; } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; using Object = UnityEngine.Object; namespace UnityStandardAssets.Utility { public class ActivateTrigger : MonoBehaviour { // A multi-purpose script which causes an action to occur when // a trigger collider is entered. public enum Mode { Trigger = 0, // Just broadcast the action on to the target Replace = 1, // replace target with source Activate = 2, // Activate the target GameObject Enable = 3, // Enable a component Animate = 4, // Start animation on target Deactivate = 5 // Decativate target GameObject } public Mode action = Mode.Activate; // The action to accomplish public Object target; // The game object to affect. If none, the trigger work on this game object public GameObject source; public int triggerCount = 1; public bool repeatTrigger = false; private void DoActivateTrigger() { triggerCount--; if (triggerCount == 0 || repeatTrigger) { Object currentTarget = target ?? gameObject; Behaviour targetBehaviour = currentTarget as Behaviour; GameObject targetGameObject = currentTarget as GameObject; if (targetBehaviour != null) { targetGameObject = targetBehaviour.gameObject; } switch (action) { case Mode.Trigger: if (targetGameObject != null) { targetGameObject.BroadcastMessage("DoActivateTrigger"); } break; case Mode.Replace: if (source != null) { if (targetGameObject != null) { Instantiate(source, targetGameObject.transform.position, targetGameObject.transform.rotation); DestroyObject(targetGameObject); } } break; case Mode.Activate: if (targetGameObject != null) { targetGameObject.SetActive(true); } break; case Mode.Enable: if (targetBehaviour != null) { targetBehaviour.enabled = true; } break; case Mode.Animate: if (targetGameObject != null) { targetGameObject.GetComponent<Animation>().Play(); } break; case Mode.Deactivate: if (targetGameObject != null) { targetGameObject.SetActive(false); } break; } } } private void OnTriggerEnter(Collider other) { DoActivateTrigger(); } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: d1e2e7a54dcc8694ab1eca46d072f264 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 9c0578910bbe00d43919a92c7b9893fe MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; #if UNITY_EDITOR using UnityEditor; #endif namespace UnityStandardAssets.Utility { #if UNITY_EDITOR [ExecuteInEditMode] #endif public class PlatformSpecificContent : MonoBehaviour { private enum BuildTargetGroup { Standalone, Mobile } [SerializeField] private BuildTargetGroup m_BuildTargetGroup; [SerializeField] private GameObject[] m_Content = new GameObject[0]; [SerializeField] private MonoBehaviour[] m_MonoBehaviours = new MonoBehaviour[0]; [SerializeField] private bool m_ChildrenOfThisObject; #if !UNITY_EDITOR void OnEnable() { CheckEnableContent(); } #endif #if UNITY_EDITOR private void OnEnable() { EditorUserBuildSettings.activeBuildTargetChanged += Update; EditorApplication.update += Update; } private void OnDisable() { EditorUserBuildSettings.activeBuildTargetChanged -= Update; EditorApplication.update -= Update; } private void Update() { CheckEnableContent(); } #endif private void CheckEnableContent() { #if (UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_BLACKBERRY ) if (m_BuildTargetGroup == BuildTargetGroup.Mobile) { EnableContent(true); } else { EnableContent(false); } #endif #if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_BLACKBERRY ) if (m_BuildTargetGroup == BuildTargetGroup.Mobile) { EnableContent(false); } else { EnableContent(true); } #endif } private void EnableContent(bool enabled) { if (m_Content.Length > 0) { foreach (var g in m_Content) { if (g != null) { g.SetActive(enabled); } } } if (m_ChildrenOfThisObject) { foreach (Transform t in transform) { t.gameObject.SetActive(enabled); } } if (m_MonoBehaviours.Length > 0) { foreach (var monoBehaviour in m_MonoBehaviours) { monoBehaviour.enabled = enabled; } } } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using UnityEngine; namespace UnityStandardAssets.Utility { public class SmoothFollow : MonoBehaviour { // The target we are following [SerializeField] private Transform target; // The distance in the x-z plane to the target [SerializeField] private float distance = 10.0f; // the height we want the camera to be above the target [SerializeField] private float height = 5.0f; [SerializeField] private float rotationDamping; [SerializeField] private float heightDamping; // Use this for initialization void Start() { } // Update is called once per frame void LateUpdate() { // Early out if we don't have a target if (!target) return; // Calculate the current rotation angles var wantedRotationAngle = target.eulerAngles.y; var wantedHeight = target.position.y + height; var currentRotationAngle = transform.eulerAngles.y; var currentHeight = transform.position.y; // Damp the rotation around the y-axis currentRotationAngle = Mathf.LerpAngle(currentRotationAngle, wantedRotationAngle, rotationDamping * Time.deltaTime); // Damp the height currentHeight = Mathf.Lerp(currentHeight, wantedHeight, heightDamping * Time.deltaTime); // Convert the angle into a rotation var currentRotation = Quaternion.Euler(0, currentRotationAngle, 0); // Set the position of the camera on the x-z plane to: // distance meters behind the target transform.position = target.position; transform.position -= currentRotation * Vector3.forward * distance; // Set the height of the camera transform.position = new Vector3(transform.position.x ,currentHeight , transform.position.z); // Always look at the target transform.LookAt(target); } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 492f54f4accf00440828ffcb9e4fcc19 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 81154777d5417884981849c5243f6c01 NativeFormatImporter: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
%YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!1 &100000 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 4 m_Component: - 224: {fileID: 22409990} - 223: {fileID: 22323452} - 114: {fileID: 11403178} - 114: {fileID: 11448042} m_Layer: 5 m_Name: FramerateCounter m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!1 &167734 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 4 m_Component: - 224: {fileID: 22488988} - 222: {fileID: 22250932} - 114: {fileID: 11410038} - 114: {fileID: 11400482} m_Layer: 5 m_Name: Text m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!114 &11400482 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 167734} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 22bbf57ec543cee42a5aa0ec2dd9e457, type: 3} m_Name: m_EditorClassIdentifier: --- !u!114 &11403178 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 100000} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: m_UiScaleMode: 0 m_ReferencePixelsPerUnit: 100 m_ScaleFactor: 1 m_ReferenceResolution: {x: 800, y: 600} m_ScreenMatchMode: 0 m_MatchWidthOrHeight: 0 m_PhysicalUnit: 3 m_FallbackScreenDPI: 96 m_DefaultSpriteDPI: 96 m_DynamicPixelsPerUnit: 1 --- !u!114 &11410038 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 167734} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: .196078435, g: .196078435, b: .196078435, a: 1} m_FontData: m_Font: {fileID: 12800000, guid: b51a3e520f9164da198dc59c8acfccd6, type: 3} m_FontSize: 18 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 10 m_MaxSize: 40 m_Alignment: 4 m_RichText: 0 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 m_Text: 'FPS ' --- !u!114 &11448042 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 100000} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: m_IgnoreReversedGraphics: 1 m_BlockingObjects: 0 m_BlockingMask: serializedVersion: 2 m_Bits: 4294967295 --- !u!222 &22250932 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 167734} --- !u!223 &22323452 Canvas: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 100000} m_Enabled: 1 serializedVersion: 2 m_RenderMode: 0 m_Camera: {fileID: 0} m_PlaneDistance: 100 m_PixelPerfect: 0 m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingLayerID: 0 m_SortingOrder: 0 --- !u!224 &22409990 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 100000} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} m_Children: - {fileID: 22488988} m_Father: {fileID: 0} m_RootOrder: 0 m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0} --- !u!224 &22488988 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 167734} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 22409990} m_RootOrder: 0 m_AnchorMin: {x: .5, y: 1} m_AnchorMax: {x: .5, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 160, y: 30} m_Pivot: {x: .5, y: 1} --- !u!1001 &100100000 Prefab: m_ObjectHideFlags: 1 serializedVersion: 2 m_Modification: m_TransformParent: {fileID: 0} m_Modifications: [] m_RemovedComponents: [] m_ParentPrefab: {fileID: 0} m_RootGameObject: {fileID: 100000} m_IsPrefabParent: 1
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: ec897f9ee2210c749ad1898ea59326f9 folderAsset: yes DefaultImporter: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 11fa60a4f5bdba144a008a674f32eb19 folderAsset: yes DefaultImporter: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
%YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!21 &2100000 Material: serializedVersion: 4 m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_Name: PinkGrid m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0} m_ShaderKeywords: _EMISSION _EMISSIONMAP _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME _UVSEC_UV1 m_CustomRenderQueue: -1 m_SavedProperties: serializedVersion: 2 m_TexEnvs: data: first: name: _MainTex second: m_Texture: {fileID: 2800000, guid: 580615edf5e29d245af58fc5fe2b06ac, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _BumpMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _DetailNormalMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _EmissionMap second: m_Texture: {fileID: 2800000, guid: a196fd6788131ec459bfb26012466fc1, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _ParallaxMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _SpecGlossMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _DetailMask second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _DetailAlbedoMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _Occlusion second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _OcclusionMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _MetallicGlossMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: data: first: name: _AlphaTestRef second: .5 data: first: name: _Lightmapping second: 1 data: first: name: _SrcBlend second: 1 data: first: name: _DstBlend second: 0 data: first: name: _Parallax second: .0199999996 data: first: name: _ZWrite second: 1 data: first: name: _Glossiness second: .100000001 data: first: name: _BumpScale second: 1 data: first: name: _OcclusionStrength second: 1 data: first: name: _DetailNormalMapScale second: 1 data: first: name: _UVSec second: 0 data: first: name: _Mode second: 0 data: first: name: _EmissionScaleUI second: 2 data: first: name: _Metallic second: .100000001 m_Colors: data: first: name: _EmissionColor second: {r: 1.33483374, g: 1.33483374, b: 1.33483374, a: 1.33483374} data: first: name: _Color second: {r: 1, g: 1, b: 1, a: 1} data: first: name: _SpecularColor second: {r: .156862751, g: .156862751, b: .156862751, a: 1} data: first: name: _EmissionColorUI second: {r: 0, g: 0, b: 0, a: 1} data: first: name: _EmissionColorWithMapUI second: {r: 1, g: 1, b: 1, a: 1} data: first: name: _SpecColor second: {r: .117647059, g: .117647059, b: .117647059, a: 1}
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
%YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!21 &2100000 Material: serializedVersion: 4 m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_Name: YellowGrid m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0} m_ShaderKeywords: _EMISSION _EMISSIONMAP _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME _UVSEC_UV1 m_CustomRenderQueue: -1 m_SavedProperties: serializedVersion: 2 m_TexEnvs: data: first: name: _MainTex second: m_Texture: {fileID: 2800000, guid: b4646ae63b0bcca40b1bdde3b87e01bf, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _BumpMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _DetailNormalMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _EmissionMap second: m_Texture: {fileID: 2800000, guid: a196fd6788131ec459bfb26012466fc1, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _ParallaxMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _SpecGlossMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _DetailMask second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _DetailAlbedoMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _Occlusion second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _OcclusionMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _MetallicGlossMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: data: first: name: _AlphaTestRef second: .5 data: first: name: _Lightmapping second: 1 data: first: name: _SrcBlend second: 1 data: first: name: _DstBlend second: 0 data: first: name: _Parallax second: .0199999996 data: first: name: _ZWrite second: 1 data: first: name: _Glossiness second: .100000001 data: first: name: _BumpScale second: 1 data: first: name: _OcclusionStrength second: 1 data: first: name: _DetailNormalMapScale second: 1 data: first: name: _UVSec second: 0 data: first: name: _Mode second: 0 data: first: name: _EmissionScaleUI second: 2 data: first: name: _Metallic second: .100000001 m_Colors: data: first: name: _EmissionColor second: {r: 1.33483374, g: 1.33483374, b: 1.33483374, a: 1.33483374} data: first: name: _Color second: {r: 1, g: 1, b: 1, a: 1} data: first: name: _SpecularColor second: {r: .156862751, g: .156862751, b: .156862751, a: 1} data: first: name: _EmissionColorUI second: {r: 0, g: 0, b: 0, a: 1} data: first: name: _EmissionColorWithMapUI second: {r: 1, g: 1, b: 1, a: 1} data: first: name: _SpecColor second: {r: .117647059, g: .117647059, b: .117647059, a: 1}
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
%YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!21 &2100000 Material: serializedVersion: 6 m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_Name: NavyGrid m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0} m_ShaderKeywords: _EMISSION _EMISSIONMAP _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME _UVSEC_UV1 m_LightmapFlags: 1 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] m_SavedProperties: serializedVersion: 3 m_TexEnvs: - _BumpMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _DetailAlbedoMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _DetailMask: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _DetailNormalMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _EmissionMap: m_Texture: {fileID: 2800000, guid: a196fd6788131ec459bfb26012466fc1, type: 3} m_Scale: {x: 20, y: 20} m_Offset: {x: 0, y: 0} - _MainTex: m_Texture: {fileID: 2800000, guid: 86e4aa9207c9e2740b6ace599d659c05, type: 3} m_Scale: {x: 20, y: 20} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _Occlusion: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _OcclusionMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _ParallaxMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _SpecGlossMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: - _AlphaTestRef: 0.5 - _BumpScale: 1 - _Cutoff: 0.5 - _DetailNormalMapScale: 1 - _DstBlend: 0 - _EmissionScaleUI: 2 - _GlossMapScale: 1 - _Glossiness: 0.068 - _GlossyReflections: 1 - _Lightmapping: 1 - _Metallic: 0.1 - _Mode: 0 - _OcclusionStrength: 1 - _Parallax: 0.02 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - _SrcBlend: 1 - _UVSec: 0 - _ZWrite: 1 m_Colors: - _Color: {r: 0.20588237, g: 0.20588237, b: 0.20588237, a: 1} - _EmissionColor: {r: 1.3348337, g: 1.3348337, b: 1.3348337, a: 1.3348337} - _EmissionColorUI: {r: 0, g: 0, b: 0, a: 1} - _EmissionColorWithMapUI: {r: 1, g: 1, b: 1, a: 1} - _SpecColor: {r: 0.11764706, g: 0.11764706, b: 0.11764706, a: 1} - _SpecularColor: {r: 0.15686275, g: 0.15686275, b: 0.15686275, a: 1}
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
%YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!21 &2100000 Material: serializedVersion: 4 m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_Name: YellowSmooth m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0} m_ShaderKeywords: _EMISSIONMAP _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME _UVSEC_UV1 m_CustomRenderQueue: -1 m_SavedProperties: serializedVersion: 2 m_TexEnvs: data: first: name: _MainTex second: m_Texture: {fileID: 2800000, guid: b4646ae63b0bcca40b1bdde3b87e01bf, type: 3} m_Scale: {x: 4, y: 4} m_Offset: {x: 0, y: 0} data: first: name: _BumpMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _DetailNormalMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _EmissionMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _ParallaxMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _SpecGlossMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _DetailMask second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _DetailAlbedoMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _Occlusion second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _OcclusionMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _MetallicGlossMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: data: first: name: _AlphaTestRef second: .5 data: first: name: _Lightmapping second: 1 data: first: name: _SrcBlend second: 1 data: first: name: _DstBlend second: 0 data: first: name: _Parallax second: .0199999996 data: first: name: _ZWrite second: 1 data: first: name: _Glossiness second: .100000001 data: first: name: _BumpScale second: 1 data: first: name: _OcclusionStrength second: 1 data: first: name: _DetailNormalMapScale second: 1 data: first: name: _UVSec second: 0 data: first: name: _Mode second: 0 data: first: name: _EmissionScaleUI second: 2 data: first: name: _Metallic second: .100000001 m_Colors: data: first: name: _EmissionColor second: {r: 0, g: 0, b: 0, a: 1.33483374} data: first: name: _Color second: {r: 1, g: 1, b: 1, a: 1} data: first: name: _SpecularColor second: {r: .156862751, g: .156862751, b: .156862751, a: 1} data: first: name: _EmissionColorUI second: {r: 0, g: 0, b: 0, a: 1} data: first: name: _EmissionColorWithMapUI second: {r: 1, g: 1, b: 1, a: 1} data: first: name: _SpecColor second: {r: .117647059, g: .117647059, b: .117647059, a: 1}
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
%YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!21 &2100000 Material: serializedVersion: 6 m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_Name: NavySmooth m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0} m_ShaderKeywords: _EMISSION _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME _UVSEC_UV1 m_LightmapFlags: 1 m_CustomRenderQueue: -1 stringTagMap: {} m_SavedProperties: serializedVersion: 2 m_TexEnvs: - first: name: _BumpMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - first: name: _DetailAlbedoMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - first: name: _DetailMask second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - first: name: _DetailNormalMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - first: name: _EmissionMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - first: name: _MainTex second: m_Texture: {fileID: 2800000, guid: 86e4aa9207c9e2740b6ace599d659c05, type: 3} m_Scale: {x: 4, y: 4} m_Offset: {x: 0, y: 0} - first: name: _MetallicGlossMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - first: name: _Occlusion second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - first: name: _OcclusionMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - first: name: _ParallaxMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - first: name: _SpecGlossMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: - first: name: _AlphaTestRef second: 0.5 - first: name: _BumpScale second: 1 - first: name: _Cutoff second: 0.5 - first: name: _DetailNormalMapScale second: 1 - first: name: _DstBlend second: 0 - first: name: _EmissionScaleUI second: 0 - first: name: _GlossMapScale second: 1 - first: name: _Glossiness second: 0.1 - first: name: _GlossyReflections second: 1 - first: name: _Lightmapping second: 1 - first: name: _Metallic second: 0.1 - first: name: _Mode second: 0 - first: name: _OcclusionStrength second: 1 - first: name: _Parallax second: 0.02 - first: name: _SmoothnessTextureChannel second: 0 - first: name: _SpecularHighlights second: 1 - first: name: _SrcBlend second: 1 - first: name: _UVSec second: 0 - first: name: _ZWrite second: 1 m_Colors: - first: name: _Color second: {r: 1, g: 1, b: 1, a: 1} - first: name: _EmissionColor second: {r: 0, g: 0, b: 0, a: 0} - first: name: _EmissionColorUI second: {r: 0, g: 0, b: 0, a: 1} - first: name: _EmissionColorWithMapUI second: {r: 1, g: 1, b: 1, a: 1} - first: name: _SpecColor second: {r: 0.11764706, g: 0.11764706, b: 0.11764706, a: 1} - first: name: _SpecularColor second: {r: 0.15686275, g: 0.15686275, b: 0.15686275, a: 1}
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 76ff537c8e1a84345868e6aeee938ab3 NativeFormatImporter: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 6e1d36c4bbd37d54f9ea183e4f5fd656 NativeFormatImporter: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 82096aab38f01cb40a1cbf8629a810ba NativeFormatImporter: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
%YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!21 &2100000 Material: serializedVersion: 6 m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_Name: PinkSmooth m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0} m_ShaderKeywords: _EMISSION _EMISSIONMAP _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME _UVSEC_UV1 m_LightmapFlags: 1 m_CustomRenderQueue: -1 stringTagMap: {} m_SavedProperties: serializedVersion: 2 m_TexEnvs: - first: name: _BumpMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - first: name: _DetailAlbedoMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - first: name: _DetailMask second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - first: name: _DetailNormalMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - first: name: _EmissionMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - first: name: _MainTex second: m_Texture: {fileID: 2800000, guid: 580615edf5e29d245af58fc5fe2b06ac, type: 3} m_Scale: {x: 4, y: 4} m_Offset: {x: 0, y: 0} - first: name: _MetallicGlossMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - first: name: _Occlusion second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - first: name: _OcclusionMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - first: name: _ParallaxMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - first: name: _SpecGlossMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: - first: name: _AlphaTestRef second: 0.5 - first: name: _BumpScale second: 1 - first: name: _Cutoff second: 0.5 - first: name: _DetailNormalMapScale second: 1 - first: name: _DstBlend second: 0 - first: name: _EmissionScaleUI second: 2 - first: name: _GlossMapScale second: 1 - first: name: _Glossiness second: 0.1 - first: name: _GlossyReflections second: 1 - first: name: _Lightmapping second: 1 - first: name: _Metallic second: 0.1 - first: name: _Mode second: 0 - first: name: _OcclusionStrength second: 1 - first: name: _Parallax second: 0.02 - first: name: _SmoothnessTextureChannel second: 0 - first: name: _SpecularHighlights second: 1 - first: name: _SrcBlend second: 1 - first: name: _UVSec second: 0 - first: name: _ZWrite second: 1 m_Colors: - first: name: _Color second: {r: 1, g: 1, b: 1, a: 1} - first: name: _EmissionColor second: {r: 0, g: 0, b: 0, a: 1.3348337} - first: name: _EmissionColorUI second: {r: 0, g: 0, b: 0, a: 1} - first: name: _EmissionColorWithMapUI second: {r: 1, g: 1, b: 1, a: 1} - first: name: _SpecColor second: {r: 0.11764706, g: 0.11764706, b: 0.11764706, a: 1} - first: name: _SpecularColor second: {r: 0.15686275, g: 0.15686275, b: 0.15686275, a: 1}
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 1032d41f900276c40a9dd24f55b7d420 NativeFormatImporter: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: fed4e78bda2b3de45954637fee164b8c NativeFormatImporter: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 8c19a618a0bd9844583b91dca0875a34 NativeFormatImporter: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 590546bcbd472d94e874f6e0c76cc266 TextureImporter: fileIDToRecycleName: {} serializedVersion: 2 mipmaps: mipMapMode: 0 enableMipMap: 1 linearTexture: 0 correctGamma: 0 fadeOut: 0 borderMipMap: 0 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: convertToNormalMap: 0 externalNormalMap: 0 heightScale: .25 normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 cubemapConvolution: 0 cubemapConvolutionSteps: 8 cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 2048 textureSettings: filterMode: -1 aniso: -1 mipBias: -1 wrapMode: -1 nPOTScale: 1 lightmap: 0 rGBM: 0 compressionQuality: 50 spriteMode: 0 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 spritePivot: {x: .5, y: .5} spriteBorder: {x: 0, y: 0, z: 0, w: 0} spritePixelsToUnits: 100 alphaIsTransparency: 0 textureType: -1 buildTargetSettings: [] spriteSheet: sprites: [] spritePackingTag: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: a336ccf90791f9841b7e680c010d1e88 TextureImporter: fileIDToRecycleName: {} serializedVersion: 2 mipmaps: mipMapMode: 0 enableMipMap: 1 linearTexture: 0 correctGamma: 0 fadeOut: 0 borderMipMap: 0 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: convertToNormalMap: 0 externalNormalMap: 0 heightScale: .25 normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 cubemapConvolution: 0 cubemapConvolutionSteps: 8 cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 2048 textureSettings: filterMode: -1 aniso: -1 mipBias: -1 wrapMode: -1 nPOTScale: 1 lightmap: 0 rGBM: 0 compressionQuality: 50 spriteMode: 0 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 spritePivot: {x: .5, y: .5} spriteBorder: {x: 0, y: 0, z: 0, w: 0} spritePixelsToUnits: 100 alphaIsTransparency: 0 textureType: -1 buildTargetSettings: [] spriteSheet: sprites: [] spritePackingTag: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: c3edc74ae8207fd45a93c4ed8ee27567 TextureImporter: fileIDToRecycleName: {} serializedVersion: 2 mipmaps: mipMapMode: 0 enableMipMap: 1 linearTexture: 0 correctGamma: 0 fadeOut: 0 borderMipMap: 0 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: convertToNormalMap: 0 externalNormalMap: 0 heightScale: .25 normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 cubemapConvolution: 0 cubemapConvolutionSteps: 8 cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 2048 textureSettings: filterMode: -1 aniso: -1 mipBias: -1 wrapMode: -1 nPOTScale: 1 lightmap: 0 rGBM: 0 compressionQuality: 50 spriteMode: 0 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 spritePivot: {x: .5, y: .5} spriteBorder: {x: 0, y: 0, z: 0, w: 0} spritePixelsToUnits: 100 alphaIsTransparency: 0 textureType: -1 buildTargetSettings: [] spriteSheet: sprites: [] spritePackingTag: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: a196fd6788131ec459bfb26012466fc1 TextureImporter: fileIDToRecycleName: {} serializedVersion: 2 mipmaps: mipMapMode: 0 enableMipMap: 1 linearTexture: 0 correctGamma: 0 fadeOut: 0 borderMipMap: 0 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: convertToNormalMap: 0 externalNormalMap: 0 heightScale: .25 normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 cubemapConvolution: 0 cubemapConvolutionSteps: 8 cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 2048 textureSettings: filterMode: 2 aniso: 4 mipBias: -1 wrapMode: -1 nPOTScale: 1 lightmap: 0 rGBM: 0 compressionQuality: 50 spriteMode: 0 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 spritePivot: {x: .5, y: .5} spriteBorder: {x: 0, y: 0, z: 0, w: 0} spritePixelsToUnits: 100 alphaIsTransparency: 0 textureType: -1 buildTargetSettings: [] spriteSheet: sprites: [] spritePackingTag: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: b4646ae63b0bcca40b1bdde3b87e01bf TextureImporter: fileIDToRecycleName: {} serializedVersion: 2 mipmaps: mipMapMode: 0 enableMipMap: 1 linearTexture: 0 correctGamma: 0 fadeOut: 0 borderMipMap: 0 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: convertToNormalMap: 0 externalNormalMap: 0 heightScale: .25 normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 cubemapConvolution: 0 cubemapConvolutionSteps: 8 cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 32 textureSettings: filterMode: -1 aniso: 0 mipBias: -1 wrapMode: -1 nPOTScale: 1 lightmap: 0 rGBM: 0 compressionQuality: 50 spriteMode: 0 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 spritePivot: {x: .5, y: .5} spriteBorder: {x: 0, y: 0, z: 0, w: 0} spritePixelsToUnits: 100 alphaIsTransparency: 0 textureType: -1 buildTargetSettings: [] spriteSheet: sprites: [] spritePackingTag: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 9c4d7ee42c7d4f944b2ce9d370fa265c TextureImporter: fileIDToRecycleName: {} serializedVersion: 2 mipmaps: mipMapMode: 0 enableMipMap: 1 linearTexture: 0 correctGamma: 0 fadeOut: 0 borderMipMap: 0 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: convertToNormalMap: 0 externalNormalMap: 0 heightScale: .25 normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 cubemapConvolution: 0 cubemapConvolutionSteps: 8 cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 32 textureSettings: filterMode: -1 aniso: 0 mipBias: -1 wrapMode: -1 nPOTScale: 1 lightmap: 0 rGBM: 0 compressionQuality: 50 spriteMode: 0 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 spritePivot: {x: .5, y: .5} spriteBorder: {x: 0, y: 0, z: 0, w: 0} spritePixelsToUnits: 100 alphaIsTransparency: 0 textureType: -1 buildTargetSettings: [] spriteSheet: sprites: [] spritePackingTag: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 580615edf5e29d245af58fc5fe2b06ac TextureImporter: fileIDToRecycleName: {} serializedVersion: 2 mipmaps: mipMapMode: 0 enableMipMap: 1 linearTexture: 0 correctGamma: 0 fadeOut: 0 borderMipMap: 0 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: convertToNormalMap: 0 externalNormalMap: 0 heightScale: .25 normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 cubemapConvolution: 0 cubemapConvolutionSteps: 8 cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 32 textureSettings: filterMode: -1 aniso: 0 mipBias: -1 wrapMode: -1 nPOTScale: 1 lightmap: 0 rGBM: 0 compressionQuality: 50 spriteMode: 0 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 spritePivot: {x: .5, y: .5} spriteBorder: {x: 0, y: 0, z: 0, w: 0} spritePixelsToUnits: 100 alphaIsTransparency: 0 textureType: -1 buildTargetSettings: [] spriteSheet: sprites: [] spritePackingTag: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 9d0b29cecf2678b41982d2173d3670ff TextureImporter: fileIDToRecycleName: {} serializedVersion: 2 mipmaps: mipMapMode: 0 enableMipMap: 1 linearTexture: 0 correctGamma: 0 fadeOut: 0 borderMipMap: 0 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: convertToNormalMap: 0 externalNormalMap: 0 heightScale: .25 normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 cubemapConvolution: 0 cubemapConvolutionSteps: 8 cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 2048 textureSettings: filterMode: -1 aniso: -1 mipBias: -1 wrapMode: -1 nPOTScale: 1 lightmap: 0 rGBM: 0 compressionQuality: 50 spriteMode: 0 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 spritePivot: {x: .5, y: .5} spriteBorder: {x: 0, y: 0, z: 0, w: 0} spritePixelsToUnits: 100 alphaIsTransparency: 0 textureType: -1 buildTargetSettings: [] spriteSheet: sprites: [] spritePackingTag: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 8b939c5b46fae7e49af7d85f731ba4ec TextureImporter: fileIDToRecycleName: {} serializedVersion: 2 mipmaps: mipMapMode: 0 enableMipMap: 1 linearTexture: 0 correctGamma: 0 fadeOut: 0 borderMipMap: 0 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: convertToNormalMap: 0 externalNormalMap: 0 heightScale: .25 normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 cubemapConvolution: 0 cubemapConvolutionSteps: 8 cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 2048 textureSettings: filterMode: -1 aniso: -1 mipBias: -1 wrapMode: -1 nPOTScale: 1 lightmap: 0 rGBM: 0 compressionQuality: 50 spriteMode: 0 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 spritePivot: {x: .5, y: .5} spriteBorder: {x: 0, y: 0, z: 0, w: 0} spritePixelsToUnits: 100 alphaIsTransparency: 0 textureType: -1 buildTargetSettings: [] spriteSheet: sprites: [] spritePackingTag: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 86e4aa9207c9e2740b6ace599d659c05 TextureImporter: fileIDToRecycleName: {} serializedVersion: 2 mipmaps: mipMapMode: 0 enableMipMap: 1 linearTexture: 0 correctGamma: 0 fadeOut: 0 borderMipMap: 0 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: convertToNormalMap: 0 externalNormalMap: 0 heightScale: .25 normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 cubemapConvolution: 0 cubemapConvolutionSteps: 8 cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 32 textureSettings: filterMode: -1 aniso: 0 mipBias: -1 wrapMode: -1 nPOTScale: 1 lightmap: 0 rGBM: 0 compressionQuality: 50 spriteMode: 0 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 spritePivot: {x: .5, y: .5} spriteBorder: {x: 0, y: 0, z: 0, w: 0} spritePixelsToUnits: 100 alphaIsTransparency: 0 textureType: -1 buildTargetSettings: [] spriteSheet: sprites: [] spritePackingTag: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 943e057eaae705e43b9e9b2e53d6adb0 folderAsset: yes DefaultImporter: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 8293540fc63bc8e478af80925582960a folderAsset: yes timeCreated: 1490754458 licenseType: Free DefaultImporter: userData: assetBundleName: assetBundleVariant:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
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. The simplest way to get started with the First Person Character is to follow these steps: 1) Start with a suitable scene. There ought to be enough flat ground to walk around on. 2) Place the "FirstPersonCharacter" prefab in the scene. 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. 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. 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. 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. The Character script also requires references to "zero friction" and "max friction" physics materials. These are provided already set-up for you.
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: bc9b000e9b8028247bd816e159382646 TextScriptImporter: userData: assetBundleName:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 847c5f5e5581e6c40817c1f84662e65f folderAsset: yes timeCreated: 1490754261 licenseType: Free DefaultImporter: userData: assetBundleName: assetBundleVariant:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 52d9391c2aceb3844b6d1e8b49a26379 folderAsset: yes timeCreated: 1490754284 licenseType: Free DefaultImporter: userData: assetBundleName: assetBundleVariant:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 278bea01e1f628548b6cd7919b069b0f MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 500e489b376fe69428506b27cd769489 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: ae6b5f30b76d38d4e9869a7c041dc5f7 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; using UnityStandardAssets.CrossPlatformInput; using UnityStandardAssets.Utility; using Random = UnityEngine.Random; namespace UnityStandardAssets.Characters.FirstPerson { [RequireComponent(typeof (CharacterController))] [RequireComponent(typeof (AudioSource))] public class FirstPersonController : MonoBehaviour { [SerializeField] private bool m_IsWalking; [SerializeField] private float m_WalkSpeed; [SerializeField] private float m_RunSpeed; [SerializeField] [Range(0f, 1f)] private float m_RunstepLenghten; [SerializeField] private float m_JumpSpeed; [SerializeField] private float m_StickToGroundForce; [SerializeField] private float m_GravityMultiplier; [SerializeField] private MouseLook m_MouseLook; [SerializeField] private bool m_UseFovKick; [SerializeField] private FOVKick m_FovKick = new FOVKick(); [SerializeField] private bool m_UseHeadBob; [SerializeField] private CurveControlledBob m_HeadBob = new CurveControlledBob(); [SerializeField] private LerpControlledBob m_JumpBob = new LerpControlledBob(); [SerializeField] private float m_StepInterval; [SerializeField] private AudioClip[] m_FootstepSounds; // an array of footstep sounds that will be randomly selected from. [SerializeField] private AudioClip m_JumpSound; // the sound played when character leaves the ground. [SerializeField] private AudioClip m_LandSound; // the sound played when character touches back on ground. private Camera m_Camera; private bool m_Jump; private float m_YRotation; private Vector2 m_Input; private Vector3 m_MoveDir = Vector3.zero; private CharacterController m_CharacterController; private CollisionFlags m_CollisionFlags; private bool m_PreviouslyGrounded; private Vector3 m_OriginalCameraPosition; private float m_StepCycle; private float m_NextStep; private bool m_Jumping; private AudioSource m_AudioSource; // Use this for initialization private void Start() { m_CharacterController = GetComponent<CharacterController>(); m_Camera = Camera.main; m_OriginalCameraPosition = m_Camera.transform.localPosition; m_FovKick.Setup(m_Camera); m_HeadBob.Setup(m_Camera, m_StepInterval); m_StepCycle = 0f; m_NextStep = m_StepCycle/2f; m_Jumping = false; m_AudioSource = GetComponent<AudioSource>(); m_MouseLook.Init(transform , m_Camera.transform); } // Update is called once per frame private void Update() { RotateView(); // the jump state needs to read here to make sure it is not missed if (!m_Jump) { m_Jump = CrossPlatformInputManager.GetButtonDown("Jump"); } if (!m_PreviouslyGrounded && m_CharacterController.isGrounded) { StartCoroutine(m_JumpBob.DoBobCycle()); PlayLandingSound(); m_MoveDir.y = 0f; m_Jumping = false; } if (!m_CharacterController.isGrounded && !m_Jumping && m_PreviouslyGrounded) { m_MoveDir.y = 0f; } m_PreviouslyGrounded = m_CharacterController.isGrounded; } private void PlayLandingSound() { m_AudioSource.clip = m_LandSound; m_AudioSource.Play(); m_NextStep = m_StepCycle + .5f; } private void FixedUpdate() { float speed; GetInput(out speed); // always move along the camera forward as it is the direction that it being aimed at Vector3 desiredMove = transform.forward*m_Input.y + transform.right*m_Input.x; // get a normal for the surface that is being touched to move along it RaycastHit hitInfo; Physics.SphereCast(transform.position, m_CharacterController.radius, Vector3.down, out hitInfo, m_CharacterController.height/2f, ~0, QueryTriggerInteraction.Ignore); desiredMove = Vector3.ProjectOnPlane(desiredMove, hitInfo.normal).normalized; m_MoveDir.x = desiredMove.x*speed; m_MoveDir.z = desiredMove.z*speed; if (m_CharacterController.isGrounded) { m_MoveDir.y = -m_StickToGroundForce; if (m_Jump) { m_MoveDir.y = m_JumpSpeed; PlayJumpSound(); m_Jump = false; m_Jumping = true; } } else { m_MoveDir += Physics.gravity*m_GravityMultiplier*Time.fixedDeltaTime; } m_CollisionFlags = m_CharacterController.Move(m_MoveDir*Time.fixedDeltaTime); ProgressStepCycle(speed); UpdateCameraPosition(speed); m_MouseLook.UpdateCursorLock(); } private void PlayJumpSound() { m_AudioSource.clip = m_JumpSound; m_AudioSource.Play(); } private void ProgressStepCycle(float speed) { if (m_CharacterController.velocity.sqrMagnitude > 0 && (m_Input.x != 0 || m_Input.y != 0)) { m_StepCycle += (m_CharacterController.velocity.magnitude + (speed*(m_IsWalking ? 1f : m_RunstepLenghten)))* Time.fixedDeltaTime; } if (!(m_StepCycle > m_NextStep)) { return; } m_NextStep = m_StepCycle + m_StepInterval; PlayFootStepAudio(); } private void PlayFootStepAudio() { if (!m_CharacterController.isGrounded) { return; } // pick & play a random footstep sound from the array, // excluding sound at index 0 int n = Random.Range(1, m_FootstepSounds.Length); m_AudioSource.clip = m_FootstepSounds[n]; m_AudioSource.PlayOneShot(m_AudioSource.clip); // move picked sound to index 0 so it's not picked next time m_FootstepSounds[n] = m_FootstepSounds[0]; m_FootstepSounds[0] = m_AudioSource.clip; } private void UpdateCameraPosition(float speed) { Vector3 newCameraPosition; if (!m_UseHeadBob) { return; } if (m_CharacterController.velocity.magnitude > 0 && m_CharacterController.isGrounded) { m_Camera.transform.localPosition = m_HeadBob.DoHeadBob(m_CharacterController.velocity.magnitude + (speed*(m_IsWalking ? 1f : m_RunstepLenghten))); newCameraPosition = m_Camera.transform.localPosition; newCameraPosition.y = m_Camera.transform.localPosition.y - m_JumpBob.Offset(); } else { newCameraPosition = m_Camera.transform.localPosition; newCameraPosition.y = m_OriginalCameraPosition.y - m_JumpBob.Offset(); } m_Camera.transform.localPosition = newCameraPosition; } private void GetInput(out float speed) { // Read input float horizontal = CrossPlatformInputManager.GetAxis("Horizontal"); float vertical = CrossPlatformInputManager.GetAxis("Vertical"); bool waswalking = m_IsWalking; #if !MOBILE_INPUT // On standalone builds, walk/run speed is modified by a key press. // keep track of whether or not the character is walking or running m_IsWalking = !Input.GetKey(KeyCode.LeftShift); #endif // set the desired speed to be walking or running speed = m_IsWalking ? m_WalkSpeed : m_RunSpeed; m_Input = new Vector2(horizontal, vertical); // normalize input if it exceeds 1 in combined length: if (m_Input.sqrMagnitude > 1) { m_Input.Normalize(); } // handle speed change to give an fov kick // only if the player is going to a run, is running and the fovkick is to be used if (m_IsWalking != waswalking && m_UseFovKick && m_CharacterController.velocity.sqrMagnitude > 0) { StopAllCoroutines(); StartCoroutine(!m_IsWalking ? m_FovKick.FOVKickUp() : m_FovKick.FOVKickDown()); } } private void RotateView() { m_MouseLook.LookRotation (transform, m_Camera.transform); } private void OnControllerColliderHit(ControllerColliderHit hit) { Rigidbody body = hit.collider.attachedRigidbody; //dont move the rigidbody if the character is on top of it if (m_CollisionFlags == CollisionFlags.Below) { return; } if (body == null || body.isKinematic) { return; } body.AddForceAtPosition(m_CharacterController.velocity*0.1f, hit.point, ForceMode.Impulse); } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; using UnityStandardAssets.Utility; namespace UnityStandardAssets.Characters.FirstPerson { public class HeadBob : MonoBehaviour { public Camera Camera; public CurveControlledBob motionBob = new CurveControlledBob(); public LerpControlledBob jumpAndLandingBob = new LerpControlledBob(); public RigidbodyFirstPersonController rigidbodyFirstPersonController; public float StrideInterval; [Range(0f, 1f)] public float RunningStrideLengthen; // private CameraRefocus m_CameraRefocus; private bool m_PreviouslyGrounded; private Vector3 m_OriginalCameraPosition; private void Start() { motionBob.Setup(Camera, StrideInterval); m_OriginalCameraPosition = Camera.transform.localPosition; // m_CameraRefocus = new CameraRefocus(Camera, transform.root.transform, Camera.transform.localPosition); } private void Update() { // m_CameraRefocus.GetFocusPoint(); Vector3 newCameraPosition; if (rigidbodyFirstPersonController.Velocity.magnitude > 0 && rigidbodyFirstPersonController.Grounded) { Camera.transform.localPosition = motionBob.DoHeadBob(rigidbodyFirstPersonController.Velocity.magnitude*(rigidbodyFirstPersonController.Running ? RunningStrideLengthen : 1f)); newCameraPosition = Camera.transform.localPosition; newCameraPosition.y = Camera.transform.localPosition.y - jumpAndLandingBob.Offset(); } else { newCameraPosition = Camera.transform.localPosition; newCameraPosition.y = m_OriginalCameraPosition.y - jumpAndLandingBob.Offset(); } Camera.transform.localPosition = newCameraPosition; if (!m_PreviouslyGrounded && rigidbodyFirstPersonController.Grounded) { StartCoroutine(jumpAndLandingBob.DoBobCycle()); } m_PreviouslyGrounded = rigidbodyFirstPersonController.Grounded; // m_CameraRefocus.SetFocusPoint(); } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
fileFormatVersion: 2 guid: 32540d66b78b5484d9e840eafc089a58 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant:
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }
using System; using UnityEngine; using UnityStandardAssets.CrossPlatformInput; namespace UnityStandardAssets.Characters.FirstPerson { [Serializable] public class MouseLook { public float XSensitivity = 2f; public float YSensitivity = 2f; public bool clampVerticalRotation = true; public float MinimumX = -90F; public float MaximumX = 90F; public bool smooth; public float smoothTime = 5f; public bool lockCursor = true; private Quaternion m_CharacterTargetRot; private Quaternion m_CameraTargetRot; private bool m_cursorIsLocked = true; public void Init(Transform character, Transform camera) { m_CharacterTargetRot = character.localRotation; m_CameraTargetRot = camera.localRotation; } public void LookRotation(Transform character, Transform camera) { float yRot = CrossPlatformInputManager.GetAxis("Mouse X") * XSensitivity; float xRot = CrossPlatformInputManager.GetAxis("Mouse Y") * YSensitivity; m_CharacterTargetRot *= Quaternion.Euler (0f, yRot, 0f); m_CameraTargetRot *= Quaternion.Euler (-xRot, 0f, 0f); if(clampVerticalRotation) m_CameraTargetRot = ClampRotationAroundXAxis (m_CameraTargetRot); if(smooth) { character.localRotation = Quaternion.Slerp (character.localRotation, m_CharacterTargetRot, smoothTime * Time.deltaTime); camera.localRotation = Quaternion.Slerp (camera.localRotation, m_CameraTargetRot, smoothTime * Time.deltaTime); } else { character.localRotation = m_CharacterTargetRot; camera.localRotation = m_CameraTargetRot; } UpdateCursorLock(); } public void SetCursorLock(bool value) { lockCursor = value; if(!lockCursor) {//we force unlock the cursor if the user disable the cursor locking helper Cursor.lockState = CursorLockMode.None; Cursor.visible = true; } } public void UpdateCursorLock() { //if the user set "lockCursor" we check & properly lock the cursos if (lockCursor) InternalLockUpdate(); } private void InternalLockUpdate() { if(Input.GetKeyUp(KeyCode.Escape)) { m_cursorIsLocked = false; } else if(Input.GetMouseButtonUp(0)) { m_cursorIsLocked = true; } if (m_cursorIsLocked) { Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; } else if (!m_cursorIsLocked) { Cursor.lockState = CursorLockMode.None; Cursor.visible = true; } } Quaternion ClampRotationAroundXAxis(Quaternion q) { q.x /= q.w; q.y /= q.w; q.z /= q.w; q.w = 1.0f; float angleX = 2.0f * Mathf.Rad2Deg * Mathf.Atan (q.x); angleX = Mathf.Clamp (angleX, MinimumX, MaximumX); q.x = Mathf.Tan (0.5f * Mathf.Deg2Rad * angleX); return q; } } }
{ "repo_name": "PrinzEugn/Scatterplot_Standalone", "stars": "63", "repo_language": "C#", "file_name": "Footstep01.wav.meta", "mime_type": "text/plain" }