mirror of
https://github.com/maxartz15/TextureCombiner.git
synced 2024-11-13 00:35:30 +01:00
1165a4e4a8
P4 -> GitHub sync.
48 lines
1.1 KiB
C#
48 lines
1.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace TextureCombiner
|
|
{
|
|
public class SizeOptions : Options
|
|
{
|
|
public int width = 512;
|
|
public int height = 512;
|
|
|
|
[SerializeField]
|
|
private InputField inputFieldWidth = null;
|
|
[SerializeField]
|
|
private InputField inputFieldHeight = null;
|
|
|
|
private void OnEnable()
|
|
{
|
|
width = PlayerPrefs.GetInt("width", 512);
|
|
height = PlayerPrefs.GetInt("height", 512);
|
|
|
|
inputFieldWidth.text = width.ToString();
|
|
inputFieldHeight.text = height.ToString();
|
|
|
|
inputFieldWidth.onValueChanged.AddListener(UpdateWidth);
|
|
inputFieldHeight.onValueChanged.AddListener(UpdateHeight);
|
|
}
|
|
|
|
protected override void OnDisable()
|
|
{
|
|
PlayerPrefs.SetInt("width", width);
|
|
PlayerPrefs.SetInt("height", height);
|
|
|
|
base.OnDisable();
|
|
}
|
|
|
|
private void UpdateWidth(string _width)
|
|
{
|
|
int.TryParse(_width, out width);
|
|
}
|
|
|
|
private void UpdateHeight(string _height)
|
|
{
|
|
int.TryParse(_height, out height);
|
|
}
|
|
}
|
|
} |