DestinationMarker DrawDestinationPopup(IList <DestinationMarker> destinationMarkers) { var popupIndex = 0; var destinationMarkerIndex = destinationMarkers.IndexOf(m_DestinationMarker.objectReferenceValue as DestinationMarker); if (destinationMarkerIndex != -1) { popupIndex = destinationMarkerIndex + 1; } DestinationMarker destinationMarker = null; using (var changeScope = new EditorGUI.ChangeCheckScope()) { var newIndex = EditorGUILayout.Popup(k_JumpTo, popupIndex, GeneratePopupOptions(destinationMarkers).ToArray()); if (newIndex > 0) { destinationMarker = destinationMarkers.ElementAt(newIndex - 1); } if (changeScope.changed) { m_DestinationMarker.objectReferenceValue = destinationMarker; } } return(destinationMarker); }
// Use this for initialization void Start() { m_playerBody = GetComponent <Rigidbody2D>(); m_marker = GetComponent <DestinationMarker>(); m_boostEffect = transform.Find("BoostEffect").GetComponent <ParticleSystem>(); m_cameraTarget = transform.FindChild("CameraTarget"); }
static void DrawTimeLabel(DestinationMarker destinationMarker) { if (destinationMarker != null) { if (destinationMarker.active) { EditorGUILayout.HelpBox(string.Format(k_TimeLabel, destinationMarker.time.ToString("0.##")), MessageType.Info); } else { EditorGUILayout.HelpBox(string.Format(k_NoJumpLabel, destinationMarker.name), MessageType.Warning); } } }
// Use this for initialization void Start() { m_playerBody = GetComponent<Rigidbody2D>(); m_marker = GetComponent<DestinationMarker>(); m_boostEffect = transform.Find("BoostEffect").GetComponent<ParticleSystem>(); m_cameraTarget = transform.FindChild("CameraTarget"); }