72 lines
2.0 KiB
C#
72 lines
2.0 KiB
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
// Token: 0x020000EB RID: 235
|
|
public class DrawSettingController : MonoBehaviour
|
|
{
|
|
// Token: 0x06001520 RID: 5408 RVA: 0x00197A0C File Offset: 0x00195C0C
|
|
private void Start()
|
|
{
|
|
this.lineWidthSlider.value = (float)this.drawViewController.GetDrawLineWidth();
|
|
this.lineWidthSlider.onValueChanged.AddListener(delegate
|
|
{
|
|
this.LineWidthChanged();
|
|
});
|
|
this.transparencySlider.value = this.drawViewController.GetDrawTransparency();
|
|
this.transparencySlider.onValueChanged.AddListener(delegate
|
|
{
|
|
this.TransparencyChanged();
|
|
});
|
|
this.drawColorInputField.text = "#" + ColorUtility.ToHtmlStringRGB(this.drawViewController.GetDrawColor());
|
|
this.drawColorInputField.onEndEdit.AddListener(delegate
|
|
{
|
|
this.DrawColorChanged();
|
|
});
|
|
}
|
|
|
|
// Token: 0x06001521 RID: 5409 RVA: 0x00197AC0 File Offset: 0x00195CC0
|
|
private void LineWidthChanged()
|
|
{
|
|
this.lineWidthText.text = this.lineWidthSlider.value.ToString();
|
|
this.drawViewController.SetDrawLineWidth((int)this.lineWidthSlider.value);
|
|
}
|
|
|
|
// Token: 0x06001522 RID: 5410 RVA: 0x00197B04 File Offset: 0x00195D04
|
|
private void TransparencyChanged()
|
|
{
|
|
this.transparencyText.text = this.transparencySlider.value.ToString();
|
|
this.drawViewController.SetDrawTransparency(this.transparencySlider.value);
|
|
}
|
|
|
|
// Token: 0x06001523 RID: 5411 RVA: 0x00197B48 File Offset: 0x00195D48
|
|
private void DrawColorChanged()
|
|
{
|
|
Color color;
|
|
if (ColorUtility.TryParseHtmlString(this.drawColorInputField.text, out color))
|
|
{
|
|
this.drawViewController.SetDrawColor(color);
|
|
return;
|
|
}
|
|
Debug.Log("invalid color input");
|
|
}
|
|
|
|
// Token: 0x04002506 RID: 9478
|
|
public Slider lineWidthSlider;
|
|
|
|
// Token: 0x04002507 RID: 9479
|
|
public Text lineWidthText;
|
|
|
|
// Token: 0x04002508 RID: 9480
|
|
public Slider transparencySlider;
|
|
|
|
// Token: 0x04002509 RID: 9481
|
|
public Text transparencyText;
|
|
|
|
// Token: 0x0400250A RID: 9482
|
|
public InputField drawColorInputField;
|
|
|
|
// Token: 0x0400250B RID: 9483
|
|
public DrawViewController drawViewController;
|
|
}
|