From e4451a54a068e610a84d5116ce4a8b8e9e5f1e3b Mon Sep 17 00:00:00 2001 From: Christopher Date: Tue, 23 Aug 2016 13:32:23 +0100 Subject: [PATCH] Refactored comments and layout --- .../Scripts/Commands/PlayAnimState.cs | 5 ++- .../Scripts/Commands/ResetAnimTrigger.cs | 5 ++- .../Animation/Scripts/Commands/SetAnimBool.cs | 5 ++- .../Scripts/Commands/SetAnimFloat.cs | 5 ++- .../Scripts/Commands/SetAnimInteger.cs | 5 ++- .../Scripts/Commands/SetAnimTrigger.cs | 5 ++- .../Audio/Scripts/Commands/ControlAudio.cs | 4 +- .../Audio/Scripts/Commands/PlayMusic.cs | 4 +- .../Audio/Scripts/Commands/PlaySound.cs | 4 +- .../Audio/Scripts/Commands/PlayUsfxrSound.cs | 40 ++++++++++++------- .../Audio/Scripts/Commands/SetAudioPitch.cs | 4 +- .../Audio/Scripts/Commands/SetAudioVolume.cs | 4 +- .../Audio/Scripts/Commands/StopMusic.cs | 4 +- Assets/Fungus/Camera/Editor/ViewEditor.cs | 8 ++-- .../Fungus/Camera/Scripts/CameraController.cs | 40 +++++++------------ .../Camera/Scripts/Commands/FadeScreen.cs | 6 ++- .../Camera/Scripts/Commands/FadeToView.cs | 6 +-- .../Camera/Scripts/Commands/Fullscreen.cs | 5 ++- .../Camera/Scripts/Commands/MoveToView.cs | 8 ++-- .../Camera/Scripts/Commands/ShakeCamera.cs | 4 +- .../Camera/Scripts/Commands/StartSwipe.cs | 5 ++- .../Camera/Scripts/Commands/StopSwipe.cs | 5 ++- Assets/Fungus/Camera/Scripts/View.cs | 39 +++++++++--------- 23 files changed, 122 insertions(+), 98 deletions(-) diff --git a/Assets/Fungus/Animation/Scripts/Commands/PlayAnimState.cs b/Assets/Fungus/Animation/Scripts/Commands/PlayAnimState.cs index f34bacd3..e389a74e 100644 --- a/Assets/Fungus/Animation/Scripts/Commands/PlayAnimState.cs +++ b/Assets/Fungus/Animation/Scripts/Commands/PlayAnimState.cs @@ -4,11 +4,12 @@ */ using UnityEngine; -using System; -using System.Collections; namespace Fungus { + /// + /// Plays a state of an animator according to the state name. + /// [CommandInfo("Animation", "Play Anim State", "Plays a state of an animator according to the state name")] diff --git a/Assets/Fungus/Animation/Scripts/Commands/ResetAnimTrigger.cs b/Assets/Fungus/Animation/Scripts/Commands/ResetAnimTrigger.cs index 27a270fd..b0138a80 100644 --- a/Assets/Fungus/Animation/Scripts/Commands/ResetAnimTrigger.cs +++ b/Assets/Fungus/Animation/Scripts/Commands/ResetAnimTrigger.cs @@ -5,11 +5,12 @@ using UnityEngine; using UnityEngine.Serialization; -using System; -using System.Collections; namespace Fungus { + /// + /// Resets a trigger parameter on an Animator component. + /// [CommandInfo("Animation", "Reset Anim Trigger", "Resets a trigger parameter on an Animator component.")] diff --git a/Assets/Fungus/Animation/Scripts/Commands/SetAnimBool.cs b/Assets/Fungus/Animation/Scripts/Commands/SetAnimBool.cs index b7ef6dd4..f6875fa1 100644 --- a/Assets/Fungus/Animation/Scripts/Commands/SetAnimBool.cs +++ b/Assets/Fungus/Animation/Scripts/Commands/SetAnimBool.cs @@ -5,11 +5,12 @@ using UnityEngine; using UnityEngine.Serialization; -using System; -using System.Collections; namespace Fungus { + /// + /// Sets a boolean parameter on an Animator component to control a Unity animation" + /// [CommandInfo("Animation", "Set Anim Bool", "Sets a boolean parameter on an Animator component to control a Unity animation")] diff --git a/Assets/Fungus/Animation/Scripts/Commands/SetAnimFloat.cs b/Assets/Fungus/Animation/Scripts/Commands/SetAnimFloat.cs index 3b4ca2af..04648db6 100644 --- a/Assets/Fungus/Animation/Scripts/Commands/SetAnimFloat.cs +++ b/Assets/Fungus/Animation/Scripts/Commands/SetAnimFloat.cs @@ -5,11 +5,12 @@ using UnityEngine; using UnityEngine.Serialization; -using System; -using System.Collections; namespace Fungus { + /// + /// Sets a float parameter on an Animator component to control a Unity animation. + /// [CommandInfo("Animation", "Set Anim Float", "Sets a float parameter on an Animator component to control a Unity animation")] diff --git a/Assets/Fungus/Animation/Scripts/Commands/SetAnimInteger.cs b/Assets/Fungus/Animation/Scripts/Commands/SetAnimInteger.cs index 39e77e5e..19cdcec1 100644 --- a/Assets/Fungus/Animation/Scripts/Commands/SetAnimInteger.cs +++ b/Assets/Fungus/Animation/Scripts/Commands/SetAnimInteger.cs @@ -5,11 +5,12 @@ using UnityEngine; using UnityEngine.Serialization; -using System; -using System.Collections; namespace Fungus { + /// + /// Sets an integer parameter on an Animator component to control a Unity animation. + /// [CommandInfo("Animation", "Set Anim Integer", "Sets an integer parameter on an Animator component to control a Unity animation")] diff --git a/Assets/Fungus/Animation/Scripts/Commands/SetAnimTrigger.cs b/Assets/Fungus/Animation/Scripts/Commands/SetAnimTrigger.cs index 6b9f9cca..5a10a93b 100644 --- a/Assets/Fungus/Animation/Scripts/Commands/SetAnimTrigger.cs +++ b/Assets/Fungus/Animation/Scripts/Commands/SetAnimTrigger.cs @@ -5,11 +5,12 @@ using UnityEngine; using UnityEngine.Serialization; -using System; -using System.Collections; namespace Fungus { + /// + /// Sets a trigger parameter on an Animator component to control a Unity animation. + /// [CommandInfo("Animation", "Set Anim Trigger", "Sets a trigger parameter on an Animator component to control a Unity animation")] diff --git a/Assets/Fungus/Audio/Scripts/Commands/ControlAudio.cs b/Assets/Fungus/Audio/Scripts/Commands/ControlAudio.cs index a23236f1..c741a01c 100644 --- a/Assets/Fungus/Audio/Scripts/Commands/ControlAudio.cs +++ b/Assets/Fungus/Audio/Scripts/Commands/ControlAudio.cs @@ -9,6 +9,9 @@ using System.Collections; namespace Fungus { + /// + /// Plays, loops, or stops an audiosource. Any AudioSources with the same tag as the target Audio Source will automatically be stoped. + /// [CommandInfo("Audio", "Control Audio", "Plays, loops, or stops an audiosource. Any AudioSources with the same tag as the target Audio Source will automatically be stoped.")] @@ -26,7 +29,6 @@ namespace Fungus [Tooltip("What to do to audio")] [SerializeField] protected controlType control; - public controlType Control { get { return control; } } [Tooltip("Audio clip to play")] diff --git a/Assets/Fungus/Audio/Scripts/Commands/PlayMusic.cs b/Assets/Fungus/Audio/Scripts/Commands/PlayMusic.cs index a2a124af..174fdce7 100644 --- a/Assets/Fungus/Audio/Scripts/Commands/PlayMusic.cs +++ b/Assets/Fungus/Audio/Scripts/Commands/PlayMusic.cs @@ -4,10 +4,12 @@ */ using UnityEngine; -using System.Collections; namespace Fungus { + /// + /// Plays looping game music. If any game music is already playing, it is stopped. Game music will continue playing across scene loads. + /// [CommandInfo("Audio", "Play Music", "Plays looping game music. If any game music is already playing, it is stopped. Game music will continue playing across scene loads.")] diff --git a/Assets/Fungus/Audio/Scripts/Commands/PlaySound.cs b/Assets/Fungus/Audio/Scripts/Commands/PlaySound.cs index a5c0f6b0..d1c0d42a 100644 --- a/Assets/Fungus/Audio/Scripts/Commands/PlaySound.cs +++ b/Assets/Fungus/Audio/Scripts/Commands/PlaySound.cs @@ -4,10 +4,12 @@ */ using UnityEngine; -using System.Collections; namespace Fungus { + /// + /// Plays a once-off sound effect. Multiple sound effects can be played at the same time. + /// [CommandInfo("Audio", "Play Sound", "Plays a once-off sound effect. Multiple sound effects can be played at the same time.")] diff --git a/Assets/Fungus/Audio/Scripts/Commands/PlayUsfxrSound.cs b/Assets/Fungus/Audio/Scripts/Commands/PlayUsfxrSound.cs index 86bbe13e..dba5efef 100644 --- a/Assets/Fungus/Audio/Scripts/Commands/PlayUsfxrSound.cs +++ b/Assets/Fungus/Audio/Scripts/Commands/PlayUsfxrSound.cs @@ -3,11 +3,15 @@ * It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) */ -namespace Fungus { - using System; - using UnityEngine; - using UnityEngine.Serialization; +using System; +using UnityEngine; +using UnityEngine.Serialization; +namespace Fungus +{ + /// + /// Plays a usfxr synth sound. Use the usfxr editor [Tools > Fungus > Utilities > Generate usfxr Sound Effects] to create the SettingsString. Set a ParentTransform if using positional sound. See https://github.com/zeh/usfxr for more information about usfxr. + /// [CommandInfo("Audio", "Play Usfxr Sound", "Plays a usfxr synth sound. Use the usfxr editor [Tools > Fungus > Utilities > Generate usfxr Sound Effects] to create the SettingsString. Set a ParentTransform if using positional sound. See https://github.com/zeh/usfxr for more information about usfxr.")] @@ -15,8 +19,6 @@ [ExecuteInEditMode] public class PlayUsfxrSound : Command { - protected SfxrSynth _synth = new SfxrSynth(); - [Tooltip("Transform to use for positional audio")] [SerializeField] protected Transform ParentTransform = null; @@ -26,20 +28,26 @@ [Tooltip("Time to wait before executing the next command")] [SerializeField] protected float waitDuration = 0; + protected SfxrSynth _synth = new SfxrSynth(); + //Call this if the settings have changed - protected void UpdateCache() { - if (_SettingsString.Value != null) { + protected void UpdateCache() + { + if (_SettingsString.Value != null) + { _synth.parameters.SetSettingsString(_SettingsString.Value); _synth.CacheSound(); } } - public void Awake() { + public void Awake() + { //Always build the cache on awake UpdateCache(); } - public override void OnEnter() { + public override void OnEnter() + { _synth.SetParentTransform(ParentTransform); _synth.Play(); if (waitDuration == 0f) @@ -57,17 +65,21 @@ Continue(); } - public override string GetSummary() { - if (String.IsNullOrEmpty(_SettingsString.Value)) { + public override string GetSummary() + { + if (String.IsNullOrEmpty(_SettingsString.Value)) + { return "Settings String hasn't been set!"; } - if (ParentTransform != null) { + if (ParentTransform != null) + { return "" + ParentTransform.name + ": " + _SettingsString.Value; } return "Camera.main: " + _SettingsString.Value; } - public override Color GetButtonColor() { + public override Color GetButtonColor() + { return new Color32(128, 200, 200, 255); } diff --git a/Assets/Fungus/Audio/Scripts/Commands/SetAudioPitch.cs b/Assets/Fungus/Audio/Scripts/Commands/SetAudioPitch.cs index 0adc2cf9..56154133 100644 --- a/Assets/Fungus/Audio/Scripts/Commands/SetAudioPitch.cs +++ b/Assets/Fungus/Audio/Scripts/Commands/SetAudioPitch.cs @@ -4,10 +4,12 @@ */ using UnityEngine; -using System.Collections; namespace Fungus { + /// + /// Sets the global pitch level for audio played with Play Music and Play Sound commands. + /// [CommandInfo("Audio", "Set Audio Pitch", "Sets the global pitch level for audio played with Play Music and Play Sound commands.")] diff --git a/Assets/Fungus/Audio/Scripts/Commands/SetAudioVolume.cs b/Assets/Fungus/Audio/Scripts/Commands/SetAudioVolume.cs index ccdd9d4a..69ad71ae 100644 --- a/Assets/Fungus/Audio/Scripts/Commands/SetAudioVolume.cs +++ b/Assets/Fungus/Audio/Scripts/Commands/SetAudioVolume.cs @@ -4,10 +4,12 @@ */ using UnityEngine; -using System.Collections; namespace Fungus { + /// + /// Sets the global volume level for audio played with Play Music and Play Sound commands. + /// [CommandInfo("Audio", "Set Audio Volume", "Sets the global volume level for audio played with Play Music and Play Sound commands.")] diff --git a/Assets/Fungus/Audio/Scripts/Commands/StopMusic.cs b/Assets/Fungus/Audio/Scripts/Commands/StopMusic.cs index c1beb15f..ff961bb1 100644 --- a/Assets/Fungus/Audio/Scripts/Commands/StopMusic.cs +++ b/Assets/Fungus/Audio/Scripts/Commands/StopMusic.cs @@ -4,10 +4,12 @@ */ using UnityEngine; -using System.Collections; namespace Fungus { + /// + /// Stops the currently playing game music. + /// [CommandInfo("Audio", "Stop Music", "Stops the currently playing game music.")] diff --git a/Assets/Fungus/Camera/Editor/ViewEditor.cs b/Assets/Fungus/Camera/Editor/ViewEditor.cs index 550386ca..91233d27 100644 --- a/Assets/Fungus/Camera/Editor/ViewEditor.cs +++ b/Assets/Fungus/Camera/Editor/ViewEditor.cs @@ -154,7 +154,7 @@ namespace Fungus if (newPos != handles[i]) { Undo.RecordObject(view, "Set View Size"); - view.viewSize = (newPos - pos).magnitude; + view.ViewSize = (newPos - pos).magnitude; EditorUtility.SetDirty(view); break; } @@ -164,8 +164,8 @@ namespace Fungus public static void DrawView(View view, bool drawInterior) { float height = CalculateLocalViewSize(view); - float widthA = height * (view.primaryAspectRatio.x / view.primaryAspectRatio.y); - float widthB = height * (view.secondaryAspectRatio.x / view.secondaryAspectRatio.y); + float widthA = height * (view.PrimaryAspectRatio.x / view.PrimaryAspectRatio.y); + float widthB = height * (view.SecondaryAspectRatio.x / view.SecondaryAspectRatio.y); Color transparent = new Color(1,1,1,0f); Color fill = viewColor; @@ -260,7 +260,7 @@ namespace Fungus // Kinda expensive, but accurate and only called in editor. static float CalculateLocalViewSize(View view) { - return view.transform.InverseTransformPoint(view.transform.position + new Vector3(0, view.viewSize, 0)).magnitude; + return view.transform.InverseTransformPoint(view.transform.position + new Vector3(0, view.ViewSize, 0)).magnitude; } } diff --git a/Assets/Fungus/Camera/Scripts/CameraController.cs b/Assets/Fungus/Camera/Scripts/CameraController.cs index 59e3551d..93e3b21f 100644 --- a/Assets/Fungus/Camera/Scripts/CameraController.cs +++ b/Assets/Fungus/Camera/Scripts/CameraController.cs @@ -11,40 +11,28 @@ using Fungus; namespace Fungus { - /** - * Controller for main camera. - * Supports several types of camera transition including snap, pan & fade. - */ + /// + /// Controller for main camera.Supports several types of camera transition including snap, pan & fade. + /// public class CameraController : MonoBehaviour { - /** - * Full screen texture used for screen fade effect. - */ + [Tooltip("Full screen texture used for screen fade effect.")] [SerializeField] protected Texture2D screenFadeTexture; - public Texture2D ScreenFadeTexture { set { screenFadeTexture = value; } } - /** - * Icon to display when swipe pan mode is active. - */ + [Tooltip("Icon to display when swipe pan mode is active.")] [SerializeField] protected Texture2D swipePanIcon; - - /** - * Position of continue and swipe icons in normalized screen space coords. - * (0,0) = top left, (1,1) = bottom right - */ + + [Tooltip("Position of continue and swipe icons in normalized screen space coords. (0,0) = top left, (1,1) = bottom right")] [SerializeField] protected Vector2 swipeIconPosition = new Vector2(1,0); - /** - * Set the camera z coordinate to a fixed value every frame. - */ + [Tooltip("Set the camera z coordinate to a fixed value every frame.")] [SerializeField] protected bool setCameraZ = true; - /** - * Fixed Z coordinate of main camera. - */ + [Tooltip("Fixed Z coordinate of main camera.")] [SerializeField] protected float cameraZ = -10f; + [Tooltip("Camera to use when in swipe mode")] [SerializeField] protected Camera swipeCamera; protected float fadeAlpha = 0f; @@ -165,7 +153,7 @@ namespace Fungus Fade(1f, outDuration, delegate { // Snap to new view - PanToPosition(camera, view.transform.position, view.transform.rotation, view.viewSize, 0f, null); + PanToPosition(camera, view.transform.position, view.transform.rotation, view.ViewSize, 0f, null); // Fade in Fade(0f, inDuration, delegate { @@ -242,7 +230,7 @@ namespace Fungus public virtual void PanToView(Camera camera, View view, float duration, Action arriveAction) { - PanToPosition(camera, view.transform.position, view.transform.rotation, view.viewSize, duration, arriveAction); + PanToPosition(camera, view.transform.position, view.transform.rotation, view.ViewSize, duration, arriveAction); } /** @@ -422,7 +410,7 @@ namespace Fungus Vector3 viewPos = new Vector3(view.transform.position.x, view.transform.position.y, - view.viewSize); + view.ViewSize); pathList.Add(viewPos); } @@ -597,7 +585,7 @@ namespace Fungus float t = Vector3.Dot(toViewB, localPos); t = Mathf.Clamp01(t); // Not really necessary but no harm - float cameraSize = Mathf.Lerp(viewA.viewSize, viewB.viewSize, t); + float cameraSize = Mathf.Lerp(viewA.ViewSize, viewB.ViewSize, t); return cameraSize; } diff --git a/Assets/Fungus/Camera/Scripts/Commands/FadeScreen.cs b/Assets/Fungus/Camera/Scripts/Commands/FadeScreen.cs index 113aae4e..558f0da9 100644 --- a/Assets/Fungus/Camera/Scripts/Commands/FadeScreen.cs +++ b/Assets/Fungus/Camera/Scripts/Commands/FadeScreen.cs @@ -4,11 +4,13 @@ */ using UnityEngine; -using System; -using System.Collections; namespace Fungus { + /// + /// Draws a fullscreen texture over the scene to give a fade effect. Setting Target Alpha to 1 will obscure the screen, alpha 0 will reveal the screen. + /// If no Fade Texture is provided then a default flat color texture is used. + /// [CommandInfo("Camera", "Fade Screen", "Draws a fullscreen texture over the scene to give a fade effect. Setting Target Alpha to 1 will obscure the screen, alpha 0 will reveal the screen. " + diff --git a/Assets/Fungus/Camera/Scripts/Commands/FadeToView.cs b/Assets/Fungus/Camera/Scripts/Commands/FadeToView.cs index 301eca89..cd93d827 100644 --- a/Assets/Fungus/Camera/Scripts/Commands/FadeToView.cs +++ b/Assets/Fungus/Camera/Scripts/Commands/FadeToView.cs @@ -4,11 +4,12 @@ */ using UnityEngine; -using System; -using System.Collections; namespace Fungus { + /// + /// Fades the camera out and in again at a position specified by a View object. + /// [CommandInfo("Camera", "Fade To View", "Fades the camera out and in again at a position specified by a View object.")] @@ -23,7 +24,6 @@ namespace Fungus [Tooltip("View to transition to when Fade is complete")] [SerializeField] protected View targetView; - public View TargetView { get { return targetView; } } [Tooltip("Wait until the fade has finished before executing next command")] diff --git a/Assets/Fungus/Camera/Scripts/Commands/Fullscreen.cs b/Assets/Fungus/Camera/Scripts/Commands/Fullscreen.cs index ff1741ff..77beb9f1 100644 --- a/Assets/Fungus/Camera/Scripts/Commands/Fullscreen.cs +++ b/Assets/Fungus/Camera/Scripts/Commands/Fullscreen.cs @@ -4,11 +4,12 @@ */ using UnityEngine; -using System; -using System.Collections; namespace Fungus { + /// + /// Sets the application to fullscreen, windowed or toggles the current state. + /// [CommandInfo("Camera", "Fullscreen", "Sets the application to fullscreen, windowed or toggles the current state.")] diff --git a/Assets/Fungus/Camera/Scripts/Commands/MoveToView.cs b/Assets/Fungus/Camera/Scripts/Commands/MoveToView.cs index 8ef41774..e9e2656d 100644 --- a/Assets/Fungus/Camera/Scripts/Commands/MoveToView.cs +++ b/Assets/Fungus/Camera/Scripts/Commands/MoveToView.cs @@ -4,11 +4,12 @@ */ using UnityEngine; -using System; -using System.Collections; namespace Fungus { + /// + /// Moves the camera to a location specified by a View object. + /// [CommandInfo("Camera", "Move To View", "Moves the camera to a location specified by a View object.")] @@ -20,7 +21,6 @@ namespace Fungus [Tooltip("View to transition to when move is complete")] [SerializeField] protected View targetView; - public View TargetView { get { return targetView; } } [Tooltip("Wait until the fade has finished before executing next command")] @@ -62,7 +62,7 @@ namespace Fungus Vector3 targetPosition = targetView.transform.position; Quaternion targetRotation = targetView.transform.rotation; - float targetSize = targetView.viewSize; + float targetSize = targetView.ViewSize; cameraController.PanToPosition(targetCamera, targetPosition, targetRotation, targetSize, duration, delegate { if (waitUntilFinished) diff --git a/Assets/Fungus/Camera/Scripts/Commands/ShakeCamera.cs b/Assets/Fungus/Camera/Scripts/Commands/ShakeCamera.cs index ac4ef411..e8bf8124 100644 --- a/Assets/Fungus/Camera/Scripts/Commands/ShakeCamera.cs +++ b/Assets/Fungus/Camera/Scripts/Commands/ShakeCamera.cs @@ -4,11 +4,13 @@ */ using UnityEngine; -using System; using System.Collections; namespace Fungus { + /// + /// Applies a camera shake effect to the main camera. + /// [CommandInfo("Camera", "Shake Camera", "Applies a camera shake effect to the main camera.")] diff --git a/Assets/Fungus/Camera/Scripts/Commands/StartSwipe.cs b/Assets/Fungus/Camera/Scripts/Commands/StartSwipe.cs index 02297cda..97325bb7 100644 --- a/Assets/Fungus/Camera/Scripts/Commands/StartSwipe.cs +++ b/Assets/Fungus/Camera/Scripts/Commands/StartSwipe.cs @@ -4,11 +4,12 @@ */ using UnityEngine; -using System; -using System.Collections; namespace Fungus { + /// + /// Activates swipe panning mode where the player can pan the camera within the area between viewA & viewB. + /// [CommandInfo("Camera", "Start Swipe", "Activates swipe panning mode where the player can pan the camera within the area between viewA & viewB.")] diff --git a/Assets/Fungus/Camera/Scripts/Commands/StopSwipe.cs b/Assets/Fungus/Camera/Scripts/Commands/StopSwipe.cs index 75748d26..2f0622d7 100644 --- a/Assets/Fungus/Camera/Scripts/Commands/StopSwipe.cs +++ b/Assets/Fungus/Camera/Scripts/Commands/StopSwipe.cs @@ -4,11 +4,12 @@ */ using UnityEngine; -using System; -using System.Collections; namespace Fungus { + /// + /// Deactivates swipe panning mode. + /// [CommandInfo("Camera", "Stop Swipe", "Deactivates swipe panning mode.")] diff --git a/Assets/Fungus/Camera/Scripts/View.cs b/Assets/Fungus/Camera/Scripts/View.cs index b466dd13..fef06da8 100644 --- a/Assets/Fungus/Camera/Scripts/View.cs +++ b/Assets/Fungus/Camera/Scripts/View.cs @@ -4,37 +4,36 @@ */ using UnityEngine; -using System.Collections; namespace Fungus { - /** - * Defines a camera view point. - * The position and rotation are specified using the game object's transform, so this class - * only needs to specify the ortographic view size. - */ + /// + /// Defines a camera view point. + /// The position and rotation are specified using the game object's transform, so this class only needs to specify the ortographic view size. + /// [ExecuteInEditMode] public class View : MonoBehaviour { - /** - * Orthographic size of the camera view in world units. - */ + /// + /// Orthographic size of the camera view in world units. + /// [Tooltip("Orthographic size of the camera view in world units.")] - public float viewSize = 0.5f; + [SerializeField] protected float viewSize = 0.5f; + public float ViewSize { get { return viewSize; } set { viewSize = value; } } - /** - * Aspect ratio of the primary view rectangle. - * e.g. a 4:3 aspect ratio = 1.333 - */ + /// + /// Aspect ratio of the primary view rectangle. e.g. a 4:3 aspect ratio = 1.333. + /// [Tooltip("Aspect ratio of the primary view rectangle. (e.g. 4:3 aspect ratio = 1.333)")] - public Vector2 primaryAspectRatio = new Vector2(4, 3); + [SerializeField] protected Vector2 primaryAspectRatio = new Vector2(4, 3); + public Vector2 PrimaryAspectRatio { get { return primaryAspectRatio; } set { primaryAspectRatio = value; } } - /** - * Aspect ratio of the secondary view rectangle. - * e.g. a 2:1 aspect ratio = 2/1 = 2.0 - */ + /// + /// Aspect ratio of the secondary view rectangle. e.g. a 2:1 aspect ratio = 2/1 = 2.0. + /// [Tooltip("Aspect ratio of the secondary view rectangle. (e.g. 2:1 aspect ratio = 2.0)")] - public Vector2 secondaryAspectRatio = new Vector2(2, 1); + [SerializeField] protected Vector2 secondaryAspectRatio = new Vector2(2, 1); + public Vector2 SecondaryAspectRatio { get { return secondaryAspectRatio; } set { secondaryAspectRatio = value; } } protected virtual void Update() {