Chris Gregan
9 years ago
3 changed files with 55 additions and 1 deletions
@ -0,0 +1,42 @@
|
||||
using UnityEngine; |
||||
using UnityEngine.UI; |
||||
using System.Collections; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
|
||||
[CommandInfo("UI", |
||||
"Set Slider Value", |
||||
"Sets the value property of a slider object")] |
||||
public class SetSliderValue : Command |
||||
{ |
||||
[Tooltip("Target slider object to set the value on")] |
||||
public Slider slider; |
||||
|
||||
[Tooltip("Float value to set the slider value to.")] |
||||
public FloatData value; |
||||
|
||||
public override void OnEnter() |
||||
{ |
||||
slider.value = value; |
||||
|
||||
Continue(); |
||||
} |
||||
|
||||
public override Color GetButtonColor() |
||||
{ |
||||
return new Color32(235, 191, 217, 255); |
||||
} |
||||
|
||||
public override string GetSummary() |
||||
{ |
||||
if (slider == null) |
||||
{ |
||||
return "Error: Slider object not selected"; |
||||
} |
||||
|
||||
return slider.name + " = " + value.GetDescription(); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 2d82f2f1b848347c19a48abd65541523 |
||||
timeCreated: 1444656241 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
Loading…
Reference in new issue