public override void OnInspectorGUI() { base.OnInspectorGUI(); if (Application.isPlaying) { EditorGUILayout.HelpBox("Editing is disabled in play mode.", MessageType.Info); return; } PhotonRigidbody2DView view = (PhotonRigidbody2DView)target; view.m_TeleportEnabled = PhotonGUI.ContainerHeaderToggle("Enable teleport for large distances", view.m_TeleportEnabled); if (view.m_TeleportEnabled) { Rect rect = PhotonGUI.ContainerBody(20.0f); view.m_TeleportIfDistanceGreaterThan = EditorGUI.FloatField(rect, "Teleport if distance greater than", view.m_TeleportIfDistanceGreaterThan); } view.m_SynchronizeVelocity = PhotonGUI.ContainerHeaderToggle("Synchronize Velocity", view.m_SynchronizeVelocity); view.m_SynchronizeAngularVelocity = PhotonGUI.ContainerHeaderToggle("Synchronize Angular Velocity", view.m_SynchronizeAngularVelocity); if (GUI.changed) { EditorUtility.SetDirty(view); } }
public override void OnInspectorGUI() { if (Application.isPlaying) { EditorGUILayout.HelpBox("Editing is disabled in play mode.", MessageType.Info); return; } PhotonRigidbody2DView view = (PhotonRigidbody2DView)target; view.m_SynchronizeVelocity = PhotonGUI.ContainerHeaderToggle("Synchronize Velocity", view.m_SynchronizeVelocity); view.m_SynchronizeAngularVelocity = PhotonGUI.ContainerHeaderToggle("Synchronize Angular Velocity", view.m_SynchronizeAngularVelocity); }
public override void OnInspectorGUI() { if (Application.isPlaying) { EditorGUILayout.HelpBox("Editing is disabled in play mode.", MessageType.Info); return; } PhotonTransformView view = (PhotonTransformView)target; view.m_SynchronizePosition = PhotonGUI.ContainerHeaderToggle("Synchronize Position", view.m_SynchronizePosition); view.m_SynchronizeRotation = PhotonGUI.ContainerHeaderToggle("Synchronize Rotation", view.m_SynchronizeRotation); view.m_SynchronizeScale = PhotonGUI.ContainerHeaderToggle("Synchronize Scale", view.m_SynchronizeScale); }
private void DrawHeader(string label, SerializedProperty property) { if (property == null) { return; } bool newValue = PhotonGUI.ContainerHeaderToggle(label, property.boolValue); if (newValue != property.boolValue) { property.boolValue = newValue; property.serializedObject.ApplyModifiedProperties(); } }