diff --git a/Assets/Fungus/Scripts/Commands/SetSprite.cs b/Assets/Fungus/Scripts/Commands/SetSprite.cs index dc0c08a6..8a2d7cdd 100644 --- a/Assets/Fungus/Scripts/Commands/SetSprite.cs +++ b/Assets/Fungus/Scripts/Commands/SetSprite.cs @@ -13,24 +13,24 @@ namespace Fungus /// [CommandInfo("Sprite", "Set Sprite", - "Changes the sprite of a SpriteRenderer.")] + "Changes the sprite property of a list of Sprite Renderers.")] [AddComponentMenu("")] public class SetSprite : Command { [Tooltip("List of sprites to set the sprite property on")] - [SerializeField] protected List targetSprites = new List(); + [SerializeField] protected List spriteRenderers = new List(); - [Tooltip("The sprite set on the target sprites")] - [SerializeField] protected Sprite spriteRendererSprite; + [Tooltip("The sprite set on the target sprite renderers")] + [SerializeField] protected Sprite sprite; #region Public members public override void OnEnter() { - for (int i = 0; i < targetSprites.Count; i++) + for (int i = 0; i < spriteRenderers.Count; i++) { - var spriteRenderer = targetSprites[i]; - spriteRenderer.sprite = spriteRendererSprite; + var spriteRenderer = spriteRenderers[i]; + spriteRenderer.sprite = sprite; } Continue(); @@ -39,9 +39,9 @@ namespace Fungus public override string GetSummary() { string summary = ""; - for (int i = 0; i < targetSprites.Count; i++) + for (int i = 0; i < spriteRenderers.Count; i++) { - var spriteRenderer = targetSprites[i]; + var spriteRenderer = spriteRenderers[i]; if (spriteRenderer == null) { continue; @@ -55,10 +55,10 @@ namespace Fungus if (summary.Length == 0) { - return "Error: No cursor sprite selected"; + return "Error: No sprite selected"; } - return summary + " = " + spriteRendererSprite; + return summary + " = " + sprite; } public override Color GetButtonColor() @@ -68,7 +68,7 @@ namespace Fungus public override bool IsReorderableArray(string propertyName) { - if (propertyName == "targetSprites") + if (propertyName == "spriteRenderers") { return true; } @@ -79,7 +79,7 @@ namespace Fungus public override void OnCommandAdded(Block parentBlock) { // Add a default empty entry - targetSprites.Add(null); + spriteRenderers.Add(null); } #endregion diff --git a/Assets/Fungus/Scripts/Commands/SetUIImage.cs b/Assets/Fungus/Scripts/Commands/SetUIImage.cs index 0fbe96dd..b30939e1 100644 --- a/Assets/Fungus/Scripts/Commands/SetUIImage.cs +++ b/Assets/Fungus/Scripts/Commands/SetUIImage.cs @@ -8,28 +8,28 @@ using UnityEngine.UI; namespace Fungus { /// - /// Changes the Image on a UI-element. + /// Changes the Image property on a UI element. /// [CommandInfo("UI", - "Set UI-Image", - "Changes the Image of a UI-Element.")] + "Set UI Image", + "Changes the Image property of a list of UI Images.")] [AddComponentMenu("")] public class SetUIImage : Command { - [Tooltip("List of UI-objects to set the image property on")] - [SerializeField] protected List targetImages = new List(); + [Tooltip("List of UI Images to set the source image property on")] + [SerializeField] protected List images = new List(); - [Tooltip("The sprite set on the target Image")] - [SerializeField] protected Sprite imageSprite; + [Tooltip("The sprite set on the source image property")] + [SerializeField] protected Sprite sprite; #region Public members public override void OnEnter() { - for (int i = 0; i < targetImages.Count; i++) + for (int i = 0; i < images.Count; i++) { - var targetImage = targetImages[i]; - targetImage.sprite = imageSprite; + var image = images[i]; + image.sprite = sprite; } Continue(); @@ -38,9 +38,9 @@ namespace Fungus public override string GetSummary() { string summary = ""; - for (int i = 0; i < targetImages.Count; i++) + for (int i = 0; i < images.Count; i++) { - var targetImage = targetImages[i]; + var targetImage = images[i]; if (targetImage == null) { continue; @@ -54,10 +54,10 @@ namespace Fungus if (summary.Length == 0) { - return "Error: No cursor sprite selected"; + return "Error: No sprite selected"; } - return summary + " = " + imageSprite; + return summary + " = " + sprite; } public override Color GetButtonColor() @@ -67,7 +67,7 @@ namespace Fungus public override bool IsReorderableArray(string propertyName) { - if (propertyName == "targetImages") + if (propertyName == "images") { return true; } @@ -78,7 +78,7 @@ namespace Fungus public override void OnCommandAdded(Block parentBlock) { // Add a default empty entry - targetImages.Add(null); + images.Add(null); } #endregion