You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
954 B
C#
46 lines
954 B
C#
|
4 years ago
|
using System.Collections;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
using UnityEngine;
|
||
|
|
using UnityEngine.UI;
|
||
|
|
using SiegeSong;
|
||
|
|
|
||
|
|
namespace SiegeSong
|
||
|
|
{
|
||
|
|
public class SliderButton : MonoBehaviour
|
||
|
|
{
|
||
|
|
public Slider Target;
|
||
|
|
public CharacterCreator Character;
|
||
|
|
public float Step = 0.1f;
|
||
|
|
public float MaxValue = 1.0f;
|
||
|
|
public float MinValue = 0.0f;
|
||
|
|
|
||
|
|
void Start()
|
||
|
|
{
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
void Update()
|
||
|
|
{
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
public void RightButtonPress()
|
||
|
|
{
|
||
|
|
if (Target.value + Step <= MaxValue)
|
||
|
|
Target.value += Step;
|
||
|
|
else
|
||
|
|
Target.value = MaxValue;
|
||
|
|
Character.UpdateValue();
|
||
|
|
}
|
||
|
|
|
||
|
|
public void LeftButtonPress()
|
||
|
|
{
|
||
|
|
if (Target.value - Step >= MinValue)
|
||
|
|
Target.value -= Step;
|
||
|
|
else
|
||
|
|
Target.value = MinValue;
|
||
|
|
Character.UpdateValue();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|