This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stages: | |
- test | |
- build | |
- deploy | |
test: | |
scripts: | |
- "echo testing..." | |
build: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Textures { | |
public static string AsBase64(Texture2D texture) { | |
SetTextureImporterFormat(texture, true); | |
var textureCopy = new Texture2D(texture.width, texture.height); | |
var colors = texture.GetPixels(); | |
textureCopy.SetPixels(colors); | |
return Convert.ToBase64String(textureCopy.EncodeToPNG()); | |
} | |
private static void SetTextureImporterFormat(Texture2D texture, bool isReadable) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEngine; | |
public class ApplicationSettingsMenuItem | |
{ | |
private const string FileDirectoryPath = "Resources/ApplicationSettings/"; | |
private const string File = "ApplicationSettings.asset"; | |
[MenuItem("Application Settings/Create")] | |
public static void CreateApplicationSettingsFile() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class ScriptableObjectDemo02 : MonoBehaviour | |
{ | |
public ScriptableApplicationSettings ApplicationSettings; | |
void Start () | |
{ | |
Debug.Log(ApplicationSettings.MyString); | |
Debug.Log(ApplicationSettings.MyInt); | |
Debug.Log(ApplicationSettings.MyFloat); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class ScriptableObjectDemo : MonoBehaviour | |
{ | |
private const string ApplicationSettingsPath = "ApplicationSettings/ApplicationSettings"; | |
void Start () | |
{ | |
var applicationSettings = | |
Resources.Load<ScriptableApplicationSettings>(ApplicationSettingsPath); | |
Debug.Log(applicationSettings.MyString); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using UnityEngine; | |
[CreateAssetMenu(fileName = "ApplicationSettings", menuName = "ApplicationSettings/Create")] | |
public class ScriptableApplicationSettings : ScriptableObject | |
{ | |
public string MyString; | |
public int MyInt; | |
public float MyFloat; | |
public List<int> MyList; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEngine; | |
public class ApplicationSettingsMenuItem | |
{ | |
private const string FileDirectoryPath = "Resources/ApplicationSettings/"; | |
private const string File = "ApplicationSettings.asset"; | |
[MenuItem("Application Settings/Create")] | |
public static void CreateApplicationSettingsFile() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
System.IO.Directory.CreateDirectory(System.IO.Path.Combine(Application.dataPath, "Resources/ApplicationSettings")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
[CreateAssetMenu(fileName = "ApplicationSettings", menuName = "ApplicationSettings/Create")] | |
public class ScriptableApplicationSettings : ScriptableObject { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class ScriptableApplicationSettings : ScriptableObject { | |
} |