mirror of
https://github.com/maxartz15/TextureCombiner.git
synced 2025-06-27 12:46:05 +02:00
Init.
P4 -> GitHub sync.
This commit is contained in:
47
Assets/Scripts/Options/AddOptions.cs
Normal file
47
Assets/Scripts/Options/AddOptions.cs
Normal file
@ -0,0 +1,47 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace TextureCombiner
|
||||
{
|
||||
public class AddOptions : Options
|
||||
{
|
||||
[SerializeField]
|
||||
private Slider inputFieldR = null;
|
||||
[SerializeField]
|
||||
private Slider inputFieldG = null;
|
||||
[SerializeField]
|
||||
private Slider inputFieldB = null;
|
||||
[SerializeField]
|
||||
private Slider inputFieldA = null;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
inputFieldR.value = PlayerPrefs.GetFloat("addR", 0);
|
||||
inputFieldG.value = PlayerPrefs.GetFloat("addG", 0);
|
||||
inputFieldB.value = PlayerPrefs.GetFloat("addB", 0);
|
||||
inputFieldA.value = PlayerPrefs.GetFloat("addA", 0);
|
||||
}
|
||||
|
||||
protected override void OnDisable()
|
||||
{
|
||||
PlayerPrefs.SetFloat("addR", inputFieldR.value);
|
||||
PlayerPrefs.SetFloat("addG", inputFieldG.value);
|
||||
PlayerPrefs.SetFloat("addB", inputFieldB.value);
|
||||
PlayerPrefs.SetFloat("addA", inputFieldA.value);
|
||||
|
||||
base.OnDisable();
|
||||
}
|
||||
|
||||
public Vector4 GetAddValues()
|
||||
{
|
||||
return new Vector4(
|
||||
inputFieldR.value,
|
||||
inputFieldG.value,
|
||||
inputFieldB.value,
|
||||
inputFieldA.value
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Options/AddOptions.cs.meta
Normal file
11
Assets/Scripts/Options/AddOptions.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cfd2b97d613d4f04f8b3b11e66ad23e2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
30
Assets/Scripts/Options/CombineOptions.cs
Normal file
30
Assets/Scripts/Options/CombineOptions.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace TextureCombiner
|
||||
{
|
||||
public class CombineOptions : Options
|
||||
{
|
||||
[SerializeField]
|
||||
private Toggle autoCombineToggle = null;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
autoCombineToggle.isOn = PlayerPrefs.GetInt("autoCombine", 1) != 0;
|
||||
}
|
||||
|
||||
protected override void OnDisable()
|
||||
{
|
||||
PlayerPrefs.SetInt("autoCombine", autoCombineToggle.isOn ? 1 : 0);
|
||||
|
||||
base.OnDisable();
|
||||
}
|
||||
|
||||
public bool GetAutoCombine()
|
||||
{
|
||||
return autoCombineToggle.isOn;
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Options/CombineOptions.cs.meta
Normal file
11
Assets/Scripts/Options/CombineOptions.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2d913ba40069e249affef31f3f9ed72
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
30
Assets/Scripts/Options/SaveOptions.cs
Normal file
30
Assets/Scripts/Options/SaveOptions.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace TextureCombiner
|
||||
{
|
||||
public class SaveOptions : Options
|
||||
{
|
||||
[SerializeField]
|
||||
private InputField inputFieldName = null;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
inputFieldName.text = PlayerPrefs.GetString("outputName", "_RMAH");
|
||||
}
|
||||
|
||||
protected override void OnDisable()
|
||||
{
|
||||
PlayerPrefs.SetString("outputName", inputFieldName.text);
|
||||
|
||||
base.OnDisable();
|
||||
}
|
||||
|
||||
public string GetOutputName()
|
||||
{
|
||||
return inputFieldName.text + ".png";
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Options/SaveOptions.cs.meta
Normal file
11
Assets/Scripts/Options/SaveOptions.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f3d24c2bb90ddd24fa229a7f3429b868
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
48
Assets/Scripts/Options/SizeOptions.cs
Normal file
48
Assets/Scripts/Options/SizeOptions.cs
Normal file
@ -0,0 +1,48 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Options/SizeOptions.cs.meta
Normal file
11
Assets/Scripts/Options/SizeOptions.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8eaea5168b73e1a4790b4a86e6bc5aac
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user