Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public sealed class CSGModel : CSGNode
{
public const float CurrentVersion = 1.1f;

public static ModelSettingsFlags DefaultSettings = ((ModelSettingsFlags)UnityEngine.Rendering.ShadowCastingMode.On) | ModelSettingsFlags.PreserveUVs;
public static ModelSettingsFlags DefaultSettings = ((ModelSettingsFlags)UnityEngine.Rendering.ShadowCastingMode.On) | ModelSettingsFlags.PreserveUVs | ModelSettingsFlags.AutoUpdateRigidBody;

/// <value>The version number of this instance of a <see cref="CSGModel" /></value>
[HideInInspector] public float Version = CurrentVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,20 @@ static public bool DefaultPreserveUVs
}
}
static public bool SnapNonCSGObjects = true;
static public bool AutoRigidbody
{
get
{
return (CSGModel.DefaultSettings & ModelSettingsFlags.AutoUpdateRigidBody) == ModelSettingsFlags.AutoUpdateRigidBody;
}
set
{
if (value)
CSGModel.DefaultSettings |= ModelSettingsFlags.AutoUpdateRigidBody;
else
CSGModel.DefaultSettings &= ~ModelSettingsFlags.AutoUpdateRigidBody;
}
}

static public Vector3 DefaultMoveOffset = Vector3.zero;
static public Vector3 DefaultRotateOffset = Vector3.zero;
Expand Down Expand Up @@ -609,6 +623,7 @@ public static void Reload()
HiddenSurfacesNotSelectable = EditorPrefs.GetBool("HiddenSurfacesNotSelectable", true);
// HiddenSurfacesOrthoSelectable = EditorPrefs.GetBool("HiddenSurfacesOrthoSelectable", true);
ShowTooltips = EditorPrefs.GetBool("ShowTooltips", true);
AutoRigidbody = EditorPrefs.GetBool("AutoRigidbody", (CSGModel.DefaultSettings & ModelSettingsFlags.AutoUpdateRigidBody) == ModelSettingsFlags.AutoUpdateRigidBody);
DefaultPreserveUVs = EditorPrefs.GetBool("DefaultPreserveUVs", (CSGModel.DefaultSettings & ModelSettingsFlags.PreserveUVs) == ModelSettingsFlags.PreserveUVs);
SnapNonCSGObjects = EditorPrefs.GetBool("SnapNonCSGObjects", true);

Expand Down Expand Up @@ -696,6 +711,7 @@ public static void Save()
// EditorPrefs.SetBool("HiddenSurfacesOrthoSelectable", RealtimeCSG.CSGSettings.HiddenSurfacesOrthoSelectable);

EditorPrefs.SetBool("ShowTooltips", RealtimeCSG.CSGSettings.ShowTooltips);
EditorPrefs.SetBool("AutoRigidbody", (CSGModel.DefaultSettings & ModelSettingsFlags.AutoUpdateRigidBody) == ModelSettingsFlags.AutoUpdateRigidBody);
EditorPrefs.SetBool("DefaultPreserveUVs", (CSGModel.DefaultSettings & ModelSettingsFlags.PreserveUVs) == ModelSettingsFlags.PreserveUVs);
EditorPrefs.SetBool("SnapNonCSGObjects", RealtimeCSG.CSGSettings.SnapNonCSGObjects);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public static void PreferenceWindow()
{
CSGSettings.ShowTooltips = EditorGUILayout.ToggleLeft("Show Tool-Tips", CSGSettings.ShowTooltips);
CSGSettings.SnapNonCSGObjects = EditorGUILayout.ToggleLeft("Snap Non-CSG Objects to the grid", CSGSettings.SnapNonCSGObjects);
CSGSettings.AutoRigidbody = EditorGUILayout.ToggleLeft("Disable auto add rigidbodies", CSGSettings.AutoRigidbody);
CSGSettings.DefaultPreserveUVs = EditorGUILayout.ToggleLeft("Preserve UVs (Default)", CSGSettings.DefaultPreserveUVs);
EditorGUILayout.Space();
CSGSettings.MaxCircleSides = EditorGUILayout.IntField("Max Circle Sides", CSGSettings.MaxCircleSides);
Expand Down