a15.5.1f1ţ˙˙˙˙˙Č0ĹňĂôL.`?^Ů0D7€˙˙˙˙€Ś€˛€ЀŚ€Ś€Ś€#Ś€+H€3˙˙˙˙€1€1€˙˙˙˙@ހ€ Q€j€ ™€< Ś€H H€Z˙˙˙˙ €1€1€˙˙˙˙@ހ€Q€j€ЀgŚ€Ś€Ś€#Ś€+v~ € €– €Ÿ €¨ €ą €ş €Ă €Ě €Ő €Ţ  €ç! €ń" €ű# €$ €% €&Ő€#˙˙˙˙'€1€1€˙˙˙˙(€ހ€)H€j€˙˙˙˙*€1€1€˙˙˙˙+@ހ€,Q€j€-™€*.ހ8/AssetMetaDataguiddata[0]data[1]data[2]data[3]pathNametimeCreatedoriginalChangesetoriginalNameoriginalParentHash128originalDigestbytes[0]bytes[1]bytes[2]bytes[3]bytes[4]bytes[5]bytes[6]bytes[7]bytes[8]bytes[9]bytes[10]bytes[11]bytes[12]bytes[13]bytes[14]bytes[15]labelsassetStoreReflicenseType ˙˙z{ď@îČă5^(H'7€˙˙˙˙€Ś€˛€ Ő€ ހ#.€,†€Ä€ ހ#.€,H€Ť€˙˙˙˙€1€1€˙˙˙˙ @ހ€ Q€j€ Ő€5˙˙˙˙ €1€1€˙˙˙˙ €ހ€€j€˙˙˙˙€H€›€˙˙˙˙€1€1€˙˙˙˙@ހ€Q€j€y€ € ހ#.€, €I@ž€X @ހ#.€,H€]˙˙˙˙€1€1€˙˙˙˙@ހ€Q€j€H€h˙˙˙˙€1€1€˙˙˙˙ @ހ€!Q€j€"H€z˙˙˙˙#€1€1€˙˙˙˙$@ހ€%Q€j€&MonoImporterPPtrm_FileIDm_PathIDm_DefaultReferencesexecutionOrdericonm_UserDatam_AssetBundleNamem_AssetBundleVariants˙˙˙8-l'€Łć„hŒÎA,Œ€7€˙˙˙˙€Ś€˛€Ő€ ހ.€†€Ä€ ހ.€H€Ť€˙˙˙˙€1€1€˙˙˙˙ @ހ€ Q€j€ H€ę€˙˙˙˙ €1€1€˙˙˙˙ @ހ€Q€j€ń€(˙˙˙˙€1€1€˙˙˙˙€ހ€€j€˙˙˙˙€H€›€˙˙˙˙€1€1€˙˙˙˙@ހ€Q€j€y€ € ހ.€y€< ހ.€ހCH€T˙˙˙˙€1€1€˙˙˙˙ @ހ€!Q€j€"H€`˙˙˙˙#€1€1€˙˙˙˙$@ހ€%Q€j€&H€l˙˙˙˙'€1€1€˙˙˙˙(@ހ€)Q€j€*L€{+PPtrm_FileIDm_PathIDm_DefaultReferencesm_Iconm_ExecutionOrderm_ClassNamem_Namespacem_AssemblyNamem_IsEditorScript˜˜@ŕyŻŘY <ŒV‡2tOą6…ż´„=Assets/Standard Assets/CrossPlatformInput/Scripts/Joystick.csJoystickź using System; using UnityEngine; using UnityEngine.EventSystems; namespace UnityStandardAssets.CrossPlatformInput { public class Joystick : MonoBehaviour, IPointerDownHandler, IPointerUpHandler, IDragHandler { public enum AxisOption { // Options for which axes to use Both, // Use both OnlyHorizontal, // Only horizontal OnlyVertical // Only vertical } public int MovementRange = 100; public AxisOption axesToUse = AxisOption.Both; // The options for the axes that the still will use public string horizontalAxisName = "Horizontal"; // The name given to the horizontal axis for the cross platform input public string verticalAxisName = "Vertical"; // The name given to the vertical axis for the cross platform input Vector3 m_StartPos; bool m_UseX; // Toggle for using the x axis bool m_UseY; // Toggle for using the Y axis CrossPlatformInputManager.VirtualAxis m_HorizontalVirtualAxis; // Reference to the joystick in the cross platform input CrossPlatformInputManager.VirtualAxis m_VerticalVirtualAxis; // Reference to the joystick in the cross platform input void OnEnable() { CreateVirtualAxes(); } void Start() { m_StartPos = transform.position; } void UpdateVirtualAxes(Vector3 value) { var delta = m_StartPos - value; delta.y = -delta.y; delta /= MovementRange; if (m_UseX) { m_HorizontalVirtualAxis.Update(-delta.x); } if (m_UseY) { m_VerticalVirtualAxis.Update(delta.y); } } void CreateVirtualAxes() { // set axes to use m_UseX = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyHorizontal); m_UseY = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyVertical); // create new axes based on axes to use if (m_UseX) { m_HorizontalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(horizontalAxisName); CrossPlatformInputManager.RegisterVirtualAxis(m_HorizontalVirtualAxis); } if (m_UseY) { m_VerticalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(verticalAxisName); CrossPlatformInputManager.RegisterVirtualAxis(m_VerticalVirtualAxis); } } public void OnDrag(PointerEventData data) { Vector3 newPos = Vector3.zero; if (m_UseX) { int delta = (int)(data.position.x - m_StartPos.x); delta = Mathf.Clamp(delta, - MovementRange, MovementRange); newPos.x = delta; } if (m_UseY) { int delta = (int)(data.position.y - m_StartPos.y); delta = Mathf.Clamp(delta, -MovementRange, MovementRange); newPos.y = delta; } transform.position = new Vector3(m_StartPos.x + newPos.x, m_StartPos.y + newPos.y, m_StartPos.z + newPos.z); UpdateVirtualAxes(transform.position); } public void OnPointerUp(PointerEventData data) { transform.position = m_StartPos; UpdateVirtualAxes(m_StartPos); } public void OnPointerDown(PointerEventData data) { } void OnDisable() { // remove the joysticks from the cross platform input if (m_UseX) { m_HorizontalVirtualAxis.Remove(); } if (m_UseY) { m_VerticalVirtualAxis.Remove(); } } } }Joystick&UnityStandardAssets.CrossPlatformInputAssembly-CSharp-firstpass.dll