Skip to content
Snippets Groups Projects
Commit a5661f1e authored by William MacDonald SE2014's avatar William MacDonald SE2014
Browse files

Merge branch 'peripheral-settings' into 'master'

Peripheral settings

See merge request !2
parents e0c5ed25 8104d6b8
No related branches found
No related tags found
1 merge request!2Peripheral settings
Showing
with 478 additions and 341 deletions
File added
......@@ -2,7 +2,7 @@
using UnityEngine.UI;
using System;
public class PlayerController : MonoBehaviour {
public class PlayerBallController : MonoBehaviour {
public float speed;
public Rigidbody rigidBody;
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RenderSettingPreset : IRenderSettingPreset {
[SerializeField]
private string name;
[SerializeField]
private HashSet<VisualBlueprint> visualBlueprints;
public RenderSettingPreset() {
visualBlueprints = new HashSet<VisualBlueprint>();
}
public string GetName() {
return name;
}
public void SetName(string name) {
this.name = name;
}
public void AddVisualBlueprint(VisualBlueprint blueprint) {
visualBlueprints.Add(blueprint);
}
public void RemoveVisualBlueprint(VisualBlueprint blueprint) {
visualBlueprints.Remove(blueprint);
}
public HashSet<VisualBlueprint> GetVisualBlueprints() {
return visualBlueprints;
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RenderSettingPresetBuilder : IRenderSettingPresetBuilder {
public IRenderSettingPreset Build(string name) {
IRenderSettingPreset preset = new RenderSettingPreset();
preset.SetName(name);
return preset;
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class RenderSettingsWindow : EditorWindow {
private static HashSet<IRenderSettingPreset> presets = new HashSet<IRenderSettingPreset>();
private static Dictionary<IRenderSettingPreset, bool> presetCollapsedDict = new Dictionary<IRenderSettingPreset, bool>();
private IRenderSettingPresetBuilder presetBuilder = new RenderSettingPresetBuilder();
private RenderSettingApplier settingApplier = new RenderSettingApplier();
private ISettingsSaver settingsSaver = new SettingsSaver();
private SettingsLoader settingsLoader = new SettingsLoader();
private const bool isNotCollapsed = true;
Vector2 scrollPosition;
private bool isCreatingVisualBlueprint = false;
private IRenderSettingPreset focusedPreset;
private bool isCreatingPreset = false;
private bool UserWantsToOverwritePreset(string name) {
return EditorUtility.DisplayDialog("Overwrite existing preset?",
"A preset called " + name + " exists. Are you sure you want to overwrite it?", "Overwrite", "Do Not Overwrite");
}
private void RemovePresetWithName(string name) {
foreach (IRenderSettingPreset p in presets) {
if (p.GetName().Equals(name)) {
presets.Remove(p);
break;
}
}
}
void LoadPreset() {
IRenderSettingPreset preset = settingsLoader.GetLoadedPreset();
if (CheckPresetNameInUse(preset.GetName())) {
if (UserWantsToOverwritePreset(preset.GetName())) {
RemovePresetWithName(preset.GetName());
presets.Add(preset);
presetCollapsedDict.Add(preset, isNotCollapsed);
}
} else {
presets.Add(preset);
presetCollapsedDict.Add(preset, isNotCollapsed);
}
}
void OnGUI() {
scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
if (presets.Count == 0) {
EditorGUILayout.LabelField("No presets available");
} else {
foreach (IRenderSettingPreset preset in presets) {
DrawPreset(preset);
}
}
if(isCreatingPreset) {
DrawPresetCreator();
} else if(GUILayout.Button("Create new preset")) {
isCreatingPreset = true;
} else if (GUILayout.Button("Load preset")) {
if (settingsLoader.Load()){
LoadPreset();
}
}
EditorGUILayout.EndScrollView();
}
private string presetName;
private void DrawPresetCreator() {
GUILayout.BeginHorizontal();
const string nameLabel = "Name: ";
EditorGUIUtility.labelWidth = CalcSmallestLabelWidth(nameLabel);
presetName = EditorGUILayout.TextField(nameLabel, presetName);
EditorGUIUtility.labelWidth = 0;
bool createButtonPressed = GUILayout.Button("Create", GUILayout.Width(100));
bool nameInUse = CheckPresetNameInUse(presetName);
if (createButtonPressed) {
bool validName = !nameInUse && !string.IsNullOrEmpty(presetName);
if (validName) {
IRenderSettingPreset preset = presetBuilder.Build(presetName);
presets.Add(preset);
presetCollapsedDict.Add(preset, isNotCollapsed);
isCreatingPreset = false;
presetName = null;
}
}
GUILayout.EndHorizontal();
DisplayCreatePresetErrorMessages(nameInUse, presetName);
}
private bool CheckPresetNameInUse(string name) {
foreach (IRenderSettingPreset p in presets) {
if (p.GetName().Equals(name)) {
return true;
}
}
return false;
}
private void DisplayCreatePresetErrorMessages(bool nameInUse, string name) {
if (nameInUse) {
EditorGUILayout.LabelField("Error Name \'" + name + "\' already in use for a preset");
}
if (string.IsNullOrEmpty(name)) {
EditorGUILayout.LabelField("Error Name cannot be empty");
}
}
private void RemovePreset(object o) {
presets.Remove((IRenderSettingPreset)o);
}
private void DrawPreset(IRenderSettingPreset preset) {
GUILayout.BeginHorizontal();
bool foldoutOpen = EditorGUILayout.Foldout(presetCollapsedDict[preset],
preset.GetName(),
EditorStyles.foldout);
GUILayout.FlexibleSpace();
if (preset.GetVisualBlueprints().Count > 0) {
if (GUILayout.Button("Apply All", GUILayout.Width(100))) {
settingApplier.Apply(preset);
}
if (GUILayout.Button("Save", GUILayout.Width(100))) {
SavePreset(preset);
}
}
GUILayout.FlexibleSpace();
if (AddDropdownSettingsButton(FocusType.Keyboard)) {
GenericMenu presetMenu = new GenericMenu();
presetMenu.AddItem(new GUIContent("Remove Preset"), false, RemovePreset, preset);
presetMenu.ShowAsContext();
}
GUILayout.EndHorizontal();
presetCollapsedDict[preset] = foldoutOpen;
if (foldoutOpen) {
EditorGUI.indentLevel++;
foreach (VisualBlueprint blueprint in preset.GetVisualBlueprints()) {
DrawVisualBlueprint(blueprint, preset);
}
EditorGUI.indentLevel--;
if (isCreatingVisualBlueprint && focusedPreset == preset) {
DrawVisualBlueprintCreator();
} else {
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
if (GUILayout.Button("Add Blueprint", GUILayout.Width(150))) {
isCreatingVisualBlueprint = true;
focusedPreset = preset;
}
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
}
}
}
private void SavePreset(IRenderSettingPreset preset) {
settingsSaver.Save(preset);
}
private bool AddDropdownSettingsButton(FocusType type) {
GUIStyle iconButtonStyle = GUI.skin.FindStyle("IconButton") ?? EditorGUIUtility.GetBuiltinSkin(EditorSkin.Inspector).FindStyle("IconButton");
GUIContent content = new GUIContent(EditorGUIUtility.Load("icons/_Popup.png") as Texture2D);
return EditorGUILayout.DropdownButton(content, FocusType.Keyboard, iconButtonStyle);
}
private void DrawVisualBlueprint(VisualBlueprint blueprint, IRenderSettingPreset preset) {
GUILayout.BeginHorizontal();
EditorGUILayout.LabelField(blueprint.GetName());
GameObject o = (GameObject) EditorGUILayout.ObjectField(blueprint.GetBlueprintObject(), typeof(GameObject), false);
blueprint.SetBlueprintObject(o);
if (GUILayout.Button("Apply", GUILayout.Width(50))) {
settingApplier.Apply(blueprint);
}
GUILayout.FlexibleSpace();
if (AddDropdownSettingsButton(FocusType.Keyboard)) {
GenericMenu presetMenu = new GenericMenu();
focusedPreset = preset; // Need to put the preset into a field because it is not possible to pass 2 arguments to a Menu Item callback method.
presetMenu.AddItem(new GUIContent("Remove Blueprin"), false, RemoveVisualBlueprint, blueprint);
presetMenu.ShowAsContext();
}
GUILayout.EndHorizontal();
}
private void RemoveVisualBlueprint(object blueprint) {
focusedPreset.RemoveVisualBlueprint((VisualBlueprint)blueprint);
}
/**
Calculates the smallest width for a label that allows the given message to be displayed
**/
private float CalcSmallestLabelWidth(string message) {
return GUI.skin.label.CalcSize(new GUIContent(message)).x;
}
private string blueprintName;
private GameObject blueprintObject;
private void DrawVisualBlueprintCreator() {
GUILayout.BeginHorizontal();
const string nameLabel = "Name: ";
const string templateLabel = "Template: ";
EditorGUIUtility.labelWidth = CalcSmallestLabelWidth(nameLabel);
blueprintName = EditorGUILayout.TextField(nameLabel, blueprintName);
EditorGUIUtility.labelWidth = CalcSmallestLabelWidth(templateLabel);
blueprintObject = (GameObject)EditorGUILayout.ObjectField(templateLabel , blueprintObject, typeof(GameObject), false);
EditorGUIUtility.labelWidth = 0; //Reset the label width to its default size
bool createButtonPressed = GUILayout.Button("Create", GUILayout.Width(100));
bool nameInUse = CheckBlueprintNameInUse(blueprintName);
bool validObject = blueprintObject != null;
if (createButtonPressed) {
bool validName = !nameInUse && !string.IsNullOrEmpty(blueprintName);
if (validName && validObject) {
focusedPreset.AddVisualBlueprint(new VisualBlueprint(blueprintName, blueprintObject));
isCreatingVisualBlueprint = false;
blueprintName = null;
blueprintObject = null;
}
}
GUILayout.EndHorizontal();
DisplayCreateBlueprintErrorMessages(nameInUse, blueprintName, validObject);
}
private void DisplayCreateBlueprintErrorMessages(bool nameInUse, string name, bool validObject) {
if (nameInUse) {
EditorGUILayout.LabelField("Error Name \'" + name + "\' already in use in this preset");
}
if (string.IsNullOrEmpty(name)) {
EditorGUILayout.LabelField("Error Name cannot be empty");
}
if (!validObject) {
EditorGUILayout.LabelField("Error: Game Object cannot be None. You need to set a game object");
}
}
private bool CheckBlueprintNameInUse(string name) {
foreach (VisualBlueprint blueprint in focusedPreset.GetVisualBlueprints()) {
if (blueprint.GetName().Equals(name)) {
return true;
}
}
return false;
}
}
public interface ISettingsLoader {
bool Load();
}
......@@ -7,11 +7,18 @@ using UnityEngine;
public class SettingsLoader {
private IRenderSettingPreset loadedPreset;
private IRenderSettingPresetBuilder presetBuilder;
private IVisualBlueprintBuilder visualBlueprintBuilder;
public IRenderSettingPreset GetLoadedPreset() {
return loadedPreset;
}
public SettingsLoader(IRenderSettingPresetBuilder presetBuilder, IVisualBlueprintBuilder visualBlueprintBuilder) {
this.presetBuilder = presetBuilder;
this.visualBlueprintBuilder = visualBlueprintBuilder;
}
public bool Load() {
string path = EditorUtility.OpenFilePanel("Choose file to load", "","json");
......@@ -21,8 +28,7 @@ public class SettingsLoader {
Debug.Log("Loaded JSON: " + dataAsJson);
PresetReferenceData presetData = JsonUtility.FromJson<PresetReferenceData>(dataAsJson);
RenderSettingPreset preset = new RenderSettingPreset();
preset.SetName(presetData.GetName());
IRenderSettingPreset preset = presetBuilder.Build(presetData.GetName());
string relativePath = CalculateRelativePath(Directory.GetParent(path).Name);
......@@ -43,7 +49,7 @@ public class SettingsLoader {
return "Assets/RenderPresets/" + path + "/";
}
private VisualBlueprint LoadVisualBlueprint(string presetDirectory , VisualBlueprintReferenceData data) {
private IVisualBlueprint LoadVisualBlueprint(string presetDirectory , VisualBlueprintReferenceData data) {
string name = data.GetName();
Debug.Log("Preset Directory name: " + presetDirectory);
......@@ -54,7 +60,7 @@ public class SettingsLoader {
GameObject blueprintObject = LoadBlueprintObject(presetDirectory + data.GetBlueprintObjectPath());
return new VisualBlueprint(name, blueprintObject);
return visualBlueprintBuilder.Build(name, blueprintObject);
}
private GameObject LoadBlueprintObject(string path) {
......
using UnityEditor;
using UnityEngine;
using System.Collections.Generic;
using System;
public class RenderSettingsWindow : EditorWindow, IObserver<IRenderPresetManager> {
private IRenderPresetManager presetManager;
private ISettingsSaver settingsSaver;
private SettingsLoader settingsLoader;
private RenderSettingCreatorPanel renderSettingCreatorPanel;
private RenderSettingPanel renderSettingPanel;
private bool isCreatingPreset = false;
public RenderSettingsWindow() {
ObservableRenderPresetManager presetManager = new ObservableRenderPresetManager();
renderSettingPanel = new RenderSettingPanel(presetManager);
renderSettingCreatorPanel = new RenderSettingCreatorPanel(new ObservableRenderPresetBuilder(renderSettingPanel));
IDisposable disposable = presetManager.Subscribe(this);
this.presetManager = presetManager;
settingsSaver = new SettingsSaver();
settingsLoader = new SettingsLoader(new ObservableRenderPresetBuilder(renderSettingPanel), new VisualBlueprintBuilder());
}
public void OnCompleted () {
}
public void OnError (Exception error) {
EditorUtility.DisplayDialog("Error",
error.Message, "Okay", "Cancel");
}
public void OnNext (IRenderPresetManager value) {
isCreatingPreset = false;
presetManager = value;
Debug.Log("RenderPresetManager OnNext");
}
private Vector2 scrollPosition;
void OnGUI() {
scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
if (presetManager.GetRenderSettingPresets().Count == 0) {
EditorGUILayout.LabelField("No presets available");
} else {
renderSettingPanel.SetPresetManager(presetManager);
foreach (IRenderSettingPreset preset in presetManager.GetRenderSettingPresets()) {
renderSettingPanel.DrawGUI(preset);
}
}
if(isCreatingPreset) {
renderSettingCreatorPanel.DrawGUI(presetManager);
if (GUILayout.Button("Cancel", GUILayout.Width(150))) {
isCreatingPreset = false;
}
} else if(GUILayout.Button("Create new preset")) {
isCreatingPreset = true;
} else if (GUILayout.Button("Load preset")) {
if (settingsLoader.Load()){
LoadPreset();
}
}
EditorGUILayout.EndScrollView();
}
private bool UserWantsToOverwritePreset(string name) {
return EditorUtility.DisplayDialog("Overwrite existing preset?",
"A preset called " + name + " exists. Are you sure you want to overwrite it?", "Overwrite", "Do Not Overwrite");
}
void LoadPreset() {
IRenderSettingPreset preset = settingsLoader.GetLoadedPreset();
if (presetManager.GetRenderSettingPresets().Contains(preset)) {
if (UserWantsToOverwritePreset(preset.GetName())) {
presetManager.UpdateRenderSettingPreset(preset);
}
} else {
presetManager.AddRenderSettingPreset(preset);
}
}
private void SavePreset(IRenderSettingPreset preset) {
settingsSaver.Save(preset);
}
/**
Calculates the smallest width for a label that allows the given message to be displayed
**/
private float CalcSmallestLabelWidth(string message) {
return GUI.skin.label.CalcSize(new GUIContent(message)).x;
}
}
using System;
public interface IObservable<out T> {
IDisposable Subscribe (IObserver<T> observer);
}
using System;
public interface IObserver<in T> {
void OnCompleted ();
void OnError (Exception error);
void OnNext (T value);
}
using System;
using System.Collections.Generic;
public class Unsubscriber<T>: IDisposable {
private List<IObserver<T>> _observers;
private IObserver<T> _observer;
public Unsubscriber(List<IObserver<T>> observers, IObserver<T> observer) {
this._observers = observers;
this._observer = observer;
}
public void Dispose() {
if (_observer != null && _observers.Contains(_observer)) {
_observers.Remove(_observer);
}
}
}
public interface IPeripheralSettings {
bool GetRotationEnabled();
void SetRotationEnabled(bool enabled);
bool GetTranslationEnabled();
void SetTranslationEnabled(bool enabled);
}
using System;
public class PeripheralSettings: IPeripheralSettings {
public bool translationEnabled;
public bool rotationEnabled;
public PeripheralSettings() {
rotationEnabled = true;
translationEnabled = true;
}
public bool GetRotationEnabled() {
return rotationEnabled;
}
public void SetRotationEnabled(bool enabled) {
rotationEnabled = enabled;
}
public bool GetTranslationEnabled() {
return translationEnabled;
}
public void SetTranslationEnabled(bool enabled) {
translationEnabled = enabled;
}
}
public interface IPeripheralSettingsPanel {
void DrawGUI(IPeripheralSettings peripheralSettings);
IPeripheralSettings GetPeripheralSettings();
}
using UnityEngine;
using UnityEditor;
public class PeripheralSettingsPanel : IPeripheralSettingsPanel {
IPeripheralSettings peripheralSettings;
IPeripheralSettingsApplier peripheralSettingsApplier;
public PeripheralSettingsPanel(IPeripheralSettingsApplier peripheralSettingsApplier) {
peripheralSettings = new PeripheralSettings();
this.peripheralSettingsApplier = peripheralSettingsApplier;
}
public void DrawGUI(IPeripheralSettings peripheralSettings) {
this.peripheralSettings = peripheralSettings;
GUILayout.BeginHorizontal();
EditorGUILayout.LabelField("Peripheral Settings: ");
if (peripheralSettingsApplier.DevicePresent()) {
if (GUILayout.Button("Apply", GUILayout.Width(50))) {
peripheralSettingsApplier.Apply(peripheralSettings);
}
GUILayout.EndHorizontal();
EditorGUI.indentLevel++;
EditorGUILayout.LabelField("Connected Device: " + peripheralSettingsApplier.DeviceName());
DrawSettings();
EditorGUI.indentLevel--;
} else {
GUILayout.EndHorizontal();
EditorGUI.indentLevel++;
EditorGUILayout.LabelField("No headset connected");
EditorGUI.indentLevel--;
}
}
private void DrawSettings() {
this.peripheralSettings.SetRotationEnabled(EditorGUILayout.Toggle("Headset Rotation", this.peripheralSettings.GetRotationEnabled()));
this.peripheralSettings.SetTranslationEnabled(EditorGUILayout.Toggle("Headset Translation", this.peripheralSettings.GetTranslationEnabled()));
}
public IPeripheralSettings GetPeripheralSettings() {
return peripheralSettings;
}
}
using System;
using System.Collections.Generic;
using UnityEngine;
public class ObservableRenderPreset: IRenderSettingPreset, IObservable<IRenderSettingPreset> {
[SerializeField]
private string name;
[SerializeField]
private HashSet<IVisualBlueprint> visualBlueprints;
[SerializeField]
private IPeripheralSettings peripheralSettings;
private List<IObserver<IRenderSettingPreset>> observers;
public ObservableRenderPreset(string name) {
visualBlueprints = new HashSet<IVisualBlueprint>();
peripheralSettings = new PeripheralSettings();
observers = new List<IObserver<IRenderSettingPreset>>();
this.name = name;
}
public IDisposable Subscribe (IObserver<IRenderSettingPreset> observer) {
if (! observers.Contains(observer)) {
observers.Add(observer);
}
return new Unsubscriber<IRenderSettingPreset>(observers, observer);
}
private void OnNextAll() {
foreach (IObserver<IRenderSettingPreset> o in observers) {
o.OnNext(this);
}
}
private void OnErrorAll(Exception e) {
foreach (IObserver<IRenderSettingPreset> o in observers) {
o.OnError(e);
}
}
public string GetName() {
return name;
}
public void SetName(string name) {
this.name = name;
OnNextAll();
}
public void AddVisualBlueprint(IVisualBlueprint blueprint) {
visualBlueprints.Add(blueprint);
OnNextAll();
}
public void RemoveVisualBlueprint(IVisualBlueprint blueprint) {
visualBlueprints.Remove(blueprint);
OnNextAll();
}
public void UpdateVisualBlueprintName(IVisualBlueprint blueprint, string newName) {
//If the name of the visual blueprint to change and the name passed in are the same,then there is no point in continuing since no change will be made
if (blueprint.GetName() == newName) {
return;
}
bool validNameChange = false;
string currentBlueprintName;
foreach (IVisualBlueprint currentBlueprint in visualBlueprints)
{
currentBlueprintName = currentBlueprint.GetName();
if (currentBlueprintName == blueprint.GetName())
{
validNameChange = true;
}
else if (currentBlueprintName == newName)
{
validNameChange = false;
break;
}
}
if (validNameChange) {
blueprint.SetName(newName);
OnNextAll();
} else {
OnErrorAll(new ArgumentException(string.Format("Blueprint {0} already exists. Choose a different name", newName)));
}
}
public HashSet<IVisualBlueprint> GetVisualBlueprints() {
return visualBlueprints;
}
public void SetPeripheralSettings(IPeripheralSettings peripheralSettings) {
this.peripheralSettings = peripheralSettings;
OnNextAll();
}
public IPeripheralSettings GetPeripheralSettings() {
return peripheralSettings;
}
public override bool Equals(object obj) {
return (obj is IRenderSettingPreset) && ((IRenderSettingPreset)obj).GetName() == this.name;
}
public override int GetHashCode() {
return this.name.GetHashCode();
}
}
using System;
using System.Collections.Generic;
using UnityEngine;
public class ObservableRenderPresetManager: IRenderPresetManager, IObservable<IRenderPresetManager> {
private List<IRenderSettingPreset> renderSettingPresets;
private List<IObserver<IRenderPresetManager>> observers;
public ObservableRenderPresetManager() {
renderSettingPresets = new List<IRenderSettingPreset>();
observers = new List<IObserver<IRenderPresetManager>>();
}
public IDisposable Subscribe (IObserver<IRenderPresetManager> observer) {
if (! observers.Contains(observer)) {
observers.Add(observer);
}
return new Unsubscriber<IRenderPresetManager>(observers, observer);
}
private void OnNextAll() {
foreach (IObserver<IRenderPresetManager> o in observers) {
o.OnNext(this);
}
}
private void OnErrorAll(Exception e) {
foreach (IObserver<IRenderPresetManager> o in observers) {
o.OnError(e);
}
}
public List<IRenderSettingPreset> GetRenderSettingPresets() {
return renderSettingPresets;
}
public void AddRenderSettingPreset(IRenderSettingPreset preset) {
if (string.IsNullOrEmpty(preset.GetName())) {
OnErrorAll(new ArgumentException("Name cannot be empty"));
} else if (renderSettingPresets.Contains(preset)) {
OnErrorAll(new ArgumentException(String.Format("Preset {0} already exists. Choose a different name", preset.GetName())));
} else {
renderSettingPresets.Add(preset);
OnNextAll();
}
}
private bool PresetNameExists(string name)
{
foreach (IRenderSettingPreset preset in renderSettingPresets) {
if (preset.GetName() == name) {
return true;
}
}
return false;
}
void IRenderPresetManager.SetRenderSettingPresetName(IRenderSettingPreset preset, string name)
{
//If the name of the preset to change and the name passed in are the same,
//then there is no point in continuing since no change will be made
if (preset.GetName() == name) {
return;
}
bool validNameChange = false;
string currentPresetName;
for (int i = 0; i < renderSettingPresets.Count; i++)
{
currentPresetName = renderSettingPresets[i].GetName();
if (currentPresetName == preset.GetName())
{
validNameChange = true;
}
else if (currentPresetName == name)
{
validNameChange = false;
break;
}
}
if (validNameChange) {
preset.SetName(name);
OnNextAll();
} else {
OnErrorAll(new ArgumentException(string.Format("Preset {0} already exists. Choose a different name", name)));
}
}
//In order for this to be successful, there must be a preset with the given name that exists
public void UpdateRenderSettingPreset(IRenderSettingPreset preset) {
bool updated = false;
for (int i=0; i < renderSettingPresets.Count; i++) {
if (renderSettingPresets[i].GetName() == preset.GetName()) {
renderSettingPresets[i] = preset;
Debug.Log(String.Format("Blueprint count: {0}", renderSettingPresets[i].GetVisualBlueprints().Count));
updated = true;
}
}
if (updated) {
Debug.Log("Updated");
OnNextAll();
}
}
public void RemoveRenderSettingPreset(IRenderSettingPreset preset) {
renderSettingPresets.Remove(preset);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment