Compare commits

..

4 Commits

115 changed files with 7700 additions and 261467 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,23 +1,20 @@
using BestHTTP;
using System.Collections.Generic; using System.Collections.Generic;
using TMPro; using TMPro;
using UnityEngine; using UnityEngine;
using UnityEngine.UI;
public class Common : MonoBehaviour public class Common : MonoBehaviour
{ {
[SerializeField] TMP_Dropdown sAnimal; [SerializeField] TMP_Dropdown dAnimal;
[SerializeField] TMP_Dropdown sSuitStyle; [SerializeField] TMP_Dropdown dSuitStyle;
[SerializeField] TMP_Dropdown sSuitType; [SerializeField] TMP_Dropdown dSuitType;
[SerializeField] TMP_Dropdown sRegion; [SerializeField] TMP_Dropdown dRegion;
// TODO 내부 저장 기능 만들기
[SerializeField] TMP_Dropdown fAnimal; // TODO 버전 기능 까지 만들어서 버전 체크후 새로 다운받아오게 만들기.
[SerializeField] TMP_Dropdown fSuitStyle;
[SerializeField] TMP_Dropdown fSuitType;
[SerializeField] TMP_Dropdown fRegion;
void Start() void Start()
{ {
HTTPRequest httpAnimal = NetworkManager.Instance.CreateRequest<List<CommonData>>("common/animalTypes", new object(), (data) => NetworkManager.Instance.CreateRequest<List<CommonData>>("common/animalTypes", new object(), (data) =>
{ {
GameManager.Instance.animalTypes = data; GameManager.Instance.animalTypes = data;
List<string> strings = new List<string>(); List<string> strings = new List<string>();
@ -25,11 +22,9 @@ public class Common : MonoBehaviour
{ {
strings.Add(data[n].code_nm); strings.Add(data[n].code_nm);
} }
sAnimal.AddOptions(strings); dAnimal.AddOptions(strings);
fAnimal.AddOptions(strings); }, null, BestHTTP.HTTPMethods.Get);
NetworkManager.Instance.CreateRequest<List<CommonData>>("common/suitStyle", new object(), (data) =>
}, null, HTTPMethods.Get);
HTTPRequest httpSuitStyle = NetworkManager.Instance.CreateRequest<List<CommonData>>("common/suitStyle", new object(), (data) =>
{ {
GameManager.Instance.suitStyle = data; GameManager.Instance.suitStyle = data;
List<string> strings = new List<string>(); List<string> strings = new List<string>();
@ -37,10 +32,9 @@ public class Common : MonoBehaviour
{ {
strings.Add(data[n].code_nm); strings.Add(data[n].code_nm);
} }
sSuitStyle.AddOptions(strings); dSuitStyle.AddOptions(strings);
fSuitStyle.AddOptions(strings); }, null, BestHTTP.HTTPMethods.Get);
}, null, HTTPMethods.Get); NetworkManager.Instance.CreateRequest<List<CommonData>>("common/suitType", new object(), (data) =>
HTTPRequest httpSuitType = NetworkManager.Instance.CreateRequest<List<CommonData>>("common/suitType", new object(), (data) =>
{ {
GameManager.Instance.suitType = data; GameManager.Instance.suitType = data;
List<string> strings = new List<string>(); List<string> strings = new List<string>();
@ -48,10 +42,9 @@ public class Common : MonoBehaviour
{ {
strings.Add(data[n].code_nm); strings.Add(data[n].code_nm);
} }
sSuitType.AddOptions(strings); dSuitType.AddOptions(strings);
fSuitType.AddOptions(strings); }, null, BestHTTP.HTTPMethods.Get);
}, null, HTTPMethods.Get); NetworkManager.Instance.CreateRequest<List<CommonData>>("common/region", new object(), (data) =>
HTTPRequest httpRegion = NetworkManager.Instance.CreateRequest<List<CommonData>>("common/region", new object(), (data) =>
{ {
GameManager.Instance.region = data; GameManager.Instance.region = data;
List<string> strings = new List<string>(); List<string> strings = new List<string>();
@ -59,13 +52,8 @@ public class Common : MonoBehaviour
{ {
strings.Add(data[n].code_nm); strings.Add(data[n].code_nm);
} }
sRegion.AddOptions(strings); dRegion.AddOptions(strings);
fRegion.AddOptions(strings); }, null, BestHTTP.HTTPMethods.Get);
}, null, HTTPMethods.Get);
httpAnimal.Send();
httpSuitStyle.Send();
httpSuitType.Send();
httpRegion.Send();
} }
public class CommonData public class CommonData

View File

@ -1,4 +1,8 @@
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine; using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI; using UnityEngine.UI;
public class DropdownCtrl : MonoBehaviour public class DropdownCtrl : MonoBehaviour
@ -6,22 +10,12 @@ public class DropdownCtrl : MonoBehaviour
[SerializeField] Sprite on; [SerializeField] Sprite on;
[SerializeField] Sprite off; [SerializeField] Sprite off;
[SerializeField] Image image; [SerializeField] Image image;
[SerializeField] bool isPixels;
[SerializeField] float[] pixels;
private void OnEnable() private void OnEnable()
{ {
image.sprite = on; image.sprite = on;
if (isPixels)
{
image.pixelsPerUnitMultiplier = pixels[1];
}
} }
private void OnDestroy() private void OnDestroy()
{ {
image.sprite = off; image.sprite = off;
if (isPixels)
{
image.pixelsPerUnitMultiplier = pixels[0];
}
} }
} }

View File

@ -1,216 +0,0 @@
using BestHTTP;
using System;
using System.Collections.Generic;
using System.Globalization;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class FursuitAddCtrl : SingletonMonoBehaviour<FursuitAddCtrl>
{
[SerializeField] Image setImage;
[SerializeField] GameObject[] stepMenus;
[SerializeField] TMP_Text xid;
[SerializeField] TMP_InputField owner;
[SerializeField] TMP_InputField introeuce;
[SerializeField] TMP_InputField characterName;
[SerializeField] TMP_InputField makerName;
[SerializeField] TMP_Dropdown animalType;
[SerializeField] TMP_Dropdown suitType;
[SerializeField] TMP_Dropdown suitStyle;
[SerializeField] TMP_Dropdown region;
[SerializeField] TMP_InputField productionDate;
[SerializeField] Toggle[] colors;
[SerializeField] Sprite[] isOnSprite;
[SerializeField] TMP_Text sXid;
[SerializeField] TMP_Text sOwner;
[SerializeField] TMP_Text sCharacterName;
[SerializeField] TMP_Text sMmakerName;
[SerializeField] TMP_Text sAnimalType;
[SerializeField] TMP_Text sSuitType;
[SerializeField] TMP_Text sSuitStyle;
[SerializeField] TMP_Text sRegion;
[SerializeField] TMP_Text sProductionDate;
[SerializeField] GameObject[] sColors;
[SerializeField] GameObject infoUI;
[SerializeField] GameObject successUI;
[SerializeField] ScreenMove screenMove;
private byte[] image;
private void OnEnable()
{
WebGl.Instance.isOn = true;
image = null;
setImage.gameObject.SetActive(false);
UIReset();
xid.text = GameManager.Instance.xid;
sXid.text = GameManager.Instance.xid;
owner.text = GameManager.Instance.xname;
sOwner.text = GameManager.Instance.xname;
}
private void OnDisable()
{
WebGl.Instance.isOn = false;
}
public void SetImage(byte[] image)
{
this.image = image;
Texture2D texture = new Texture2D(2, 2);
if (texture.LoadImage(image))
{
setImage.sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f));
setImage.gameObject.SetActive(true);
}
else
{
Debug.LogError("이미지 로드 실패!");
}
}
private void UIReset()
{
stepMenus[0].SetActive(false);
stepMenus[1].SetActive(false);
infoUI.SetActive(true);
successUI.SetActive(false);
xid.text = string.Empty;
owner.text = string.Empty;
introeuce.text = string.Empty;
characterName.text = string.Empty;
makerName.text = string.Empty;
animalType.value = 0;
suitType.value = 0;
suitStyle.value = 0;
region.value = 0;
productionDate.text = DateTime.Now.ToString("yyyy-MM-dd");
for (int n = 0; n < colors.Length; n++)
{
colors[n].isOn = false;
colors[n].image.sprite = isOnSprite[0];
}
}
private bool DateTimeCheck(string dateString, out DateTime date)
{
return DateTime.TryParseExact(dateString, "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.None, out date);
}
public void SuccessButton()
{
if (xid.text == string.Empty)
{
GameManager.Instance.infoPageUI.SetError(InfoMessage.NotLogin);
return;
}
if (owner.text == string.Empty)
{
GameManager.Instance.infoPageUI.SetError(InfoMessage.NotOwner);
return;
}
if (characterName.text == string.Empty)
{
GameManager.Instance.infoPageUI.SetError(InfoMessage.NotName);
return;
}
if (animalType.value == 0)
{
GameManager.Instance.infoPageUI.SetError(InfoMessage.NotAnimalType);
return;
}
if (suitType.value == 0)
{
GameManager.Instance.infoPageUI.SetError(InfoMessage.NotSuitType);
return;
}
if (suitStyle.value == 0)
{
GameManager.Instance.infoPageUI.SetError(InfoMessage.NotSuitStyle);
return;
}
if (region.value == 0)
{
GameManager.Instance.infoPageUI.SetError(InfoMessage.NotRegion);
return;
}
DateTime date;
if (!DateTimeCheck(productionDate.text, out date))
{
GameManager.Instance.infoPageUI.SetError(InfoMessage.NotProductionDate);
return;
}
sXid.text = xid.text;
sOwner.text = owner.text;
sCharacterName.text = characterName.text;
sMmakerName.text = makerName.text;
sAnimalType.text = GameManager.Instance.animalTypes[animalType.value - 1].code_nm;
sSuitType.text = GameManager.Instance.suitType[suitType.value - 1].code_nm;
sSuitStyle.text = GameManager.Instance.suitStyle[suitStyle.value - 1].code_nm;
sRegion.text = GameManager.Instance.region[region.value - 1].code_nm;
sProductionDate.text = productionDate.text;
for(int n = 0; n < colors.Length; n++)
{
sColors[n].SetActive(colors[n].isOn);
}
if (image == null)
{
GameManager.Instance.infoPageUI.SetError(InfoMessage.NotImageSet);
return;
}
infoUI.SetActive(false);
successUI.SetActive(true);
}
public void OnToggle(int velue)
{
colors[velue].image.sprite = isOnSprite[(colors[velue].isOn ? 1 : 0)];
}
public void FursuitAdd()
{
RegSuitInfo regSuitInfo = new RegSuitInfo();
regSuitInfo.ownerName = owner.text;
regSuitInfo.charName = characterName.text;
regSuitInfo.suitAnimalType = GameManager.Instance.animalTypes[animalType.value - 1].code_id;
regSuitInfo.suitStyle = GameManager.Instance.suitStyle[suitStyle.value - 1].code_id;
regSuitInfo.suitType = GameManager.Instance.suitType[suitType.value - 1].code_id;
regSuitInfo.suitRegion = GameManager.Instance.region[region.value - 1].code_id;
regSuitInfo.suitMaker = makerName.text;
regSuitInfo.colorList = new List<string>();
regSuitInfo.suitImg = image;
regSuitInfo.userInfo = introeuce.text;
regSuitInfo.productionDate = productionDate.text;
for (int n = 0; n < colors.Length; n++)
{
if (colors[n].isOn)
{
GameManager.eColor color = GameManager.eColor. + n;
regSuitInfo.colorList.Add(((int)color).ToString());
}
}
HTTPRequest httpFursuitAdd = NetworkManager.Instance.CreateRequest<object>("register/regFursuiterInfo", regSuitInfo, (data) =>
{
GameManager.Instance.infoPageUI.Set(InfoMessage.FursuitAdd, () => { screenMove.SearchView(); });
}, null, HTTPMethods.Post);
httpFursuitAdd.Send();
}
public class RegSuitInfo
{
public string ownerName;
public string charName;
public string suitAnimalType;
public string suitStyle;
public string suitType;
public string suitRegion;
public string suitMaker;
public List<string> colorList;
public byte[] suitImg;
public string userInfo;
public string productionDate;
}
}

View File

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: fef2c46c5ce9b124bbaf48ad0f128730

View File

@ -0,0 +1,3 @@
public interface IEquatable
{
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ebbb76260c4e15c49801eac3455162de
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,39 +0,0 @@
using System;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class InfoPageCtrl : MonoBehaviour
{
[SerializeField] TMP_Text message;
[SerializeField] Image outLine;
[SerializeField] Image button;
[SerializeField] Color success;
[SerializeField] Color fail;
private Action action;
public void Set(string message, Action action = null)
{
outLine.color = success;
button.color = success;
this.message.text = message;
this.action = action;
gameObject.SetActive(true);
}
public void SetError(string message, Action action = null)
{
outLine.color = fail;
button.color = fail;
this.message.text = message;
this.action = action;
gameObject.SetActive(true);
}
public void okButton()
{
action?.Invoke();
gameObject.SetActive(false);
}
}

View File

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 5fbc49285d6699848b5befdb66a6ba82

View File

@ -1,42 +1,24 @@
using Cysharp.Threading.Tasks;
using TMPro; using TMPro;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
public class ItemPrefab : MonoBehaviour, System.IEquatable<ItemPrefab> public class ItemPrefab : MonoBehaviour, System.IEquatable<ItemPrefab>
{ {
[SerializeField] public Library Library;
Library _library;
public Library library { get { return _library; } }
[SerializeField] TMP_Text suitName; [SerializeField] TMP_Text suitName;
[SerializeField] TMP_Text ownerName; [SerializeField] TMP_Text ownerName;
[SerializeField] RawImage suitImage; [SerializeField] RawImage suitImage;
[SerializeField] GameObject loading;
public void Set(Library library) public void Set(Library library)
{ {
this._library = library; this.Library = library;
suitName.text = library.suit_name; suitName.text = library.suit_name;
ownerName.text = library.owner_name; ownerName.text = library.owner_name;
if(library._suit_image == null)
{
loading.SetActive(true);
suitImage.texture = null;
}
} }
private void Update()
{
if (loading.activeSelf)
{
loading.transform.rotation *= Quaternion.Euler(0, 0, 5);
}
}
public void ImageSet() public void ImageSet()
{ {
loading.SetActive(false); suitImage.texture = Library._suit_image;
suitImage.texture = library._suit_image;
suitImage.SetNativeSize(); suitImage.SetNativeSize();
RectTransform rect = suitImage.gameObject.GetComponent<RectTransform>(); RectTransform rect = suitImage.gameObject.GetComponent<RectTransform>();
rect.anchorMin = new Vector2(0.5f, 0.5f); rect.anchorMin = new Vector2(0.5f, 0.5f);
@ -48,11 +30,11 @@ public class ItemPrefab : MonoBehaviour, System.IEquatable<ItemPrefab>
public void Button() public void Button()
{ {
SearchCtrl.Instance.ModelSet(_library); SearchCtrl.Instance.ModelSet(Library);
} }
public bool Equals(ItemPrefab other) public bool Equals(ItemPrefab other)
{ {
return (_library?.Equals(other?._library) == true) && ReferenceEquals(this, other); return (Library?.Equals(other?.Library) == true) && System.Object.ReferenceEquals(this, other);
} }
} }

View File

@ -1,4 +1,6 @@
using System.Collections;
using TMPro; using TMPro;
using Unity.VisualScripting;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
@ -7,30 +9,19 @@ public class ModalCtrl : MonoBehaviour
[SerializeField] RectTransform imageMask; [SerializeField] RectTransform imageMask;
[SerializeField] RawImage suitImage; [SerializeField] RawImage suitImage;
[SerializeField] TMP_Text suitName; [SerializeField] TMP_Text suitName;
[SerializeField] TMP_Text userInfo;
[SerializeField] TMP_Text ownerName; [SerializeField] TMP_Text ownerName;
[SerializeField] TMP_Text suitMaker; [SerializeField] TMP_Text suitMaker;
[SerializeField] TMP_Text debutDate; [SerializeField] TMP_Text debutDate;
[SerializeField] TMP_Text animalType; [SerializeField] TMP_Text suitType;
[SerializeField] TMP_Text suitStyle; [SerializeField] TMP_Text suitStyle;
[SerializeField] GameObject[] colors; [SerializeField] GameObject[] colors;
[SerializeField] GameObject _modelCanvas;
public GameObject modelCanvas { get { return _modelCanvas; } }
private void Update()
{
if (Input.GetKey(KeyCode.Escape))
{
_modelCanvas.SetActive(false);
}
}
public void Set(Library library) public void Set(Library library)
{ {
_modelCanvas.SetActive(true); gameObject.SetActive(true);
suitImage.texture = library._suit_image; StartCoroutine(checkImageUpdate(library));
suitImage.SetNativeSize(); suitImage.SetNativeSize();
RectTransform rect = suitImage.gameObject.GetComponent<RectTransform>(); RectTransform rect = suitImage.gameObject.GetComponent<RectTransform>();
rect.anchorMin = new Vector2(0.5f, 0.5f); rect.anchorMin = new Vector2(0.5f, 0.5f);
@ -39,19 +30,28 @@ public class ModalCtrl : MonoBehaviour
Vector2 newSize = new Vector2(rect.sizeDelta.x / size, rect.sizeDelta.y / size); Vector2 newSize = new Vector2(rect.sizeDelta.x / size, rect.sizeDelta.y / size);
rect.sizeDelta = newSize; rect.sizeDelta = newSize;
suitName.text = library.suit_name; suitName.text = library.suit_name;
userInfo.text = library.user_info;
ownerName.text = library.owner_name; ownerName.text = library.owner_name;
suitMaker.text = library.maker; suitMaker.text = library.maker;
debutDate.text = library.production_date; debutDate.text = library.production_date;
animalType.text = library.animal_type; suitType.text = library.suit_type;
suitStyle.text = library.suit_style; suitStyle.text = library.suit_style;
for(int n = 0; n < colors.Length; n++)
}
void OnDisable()
{
StopAllCoroutines();
}
IEnumerator checkImageUpdate(Library library)
{
while(library._suit_image == null)
{ {
colors[n].SetActive(false); yield return null;
}
for (int n = 0; n < library.suit_color.Count; n++)
{
colors[int.Parse(library.suit_color[n]) - (int)GameManager.eColor.ÇÎÅ©º¢²É].SetActive(true);
} }
suitImage.texture = library._suit_image;
} }
} }

View File

@ -1,4 +1,5 @@
using BestHTTP; using System.Collections;
using System.Collections.Generic;
using UnityEngine; using UnityEngine;
public class ScreenMove : MonoBehaviour public class ScreenMove : MonoBehaviour
@ -6,13 +7,6 @@ public class ScreenMove : MonoBehaviour
[SerializeField] RectTransform rectTransform; [SerializeField] RectTransform rectTransform;
[SerializeField] RectTransform test_rectTransform; [SerializeField] RectTransform test_rectTransform;
[SerializeField] GameObject searchView;
[SerializeField] GameObject fursuitAdd;
[SerializeField] GameObject[] closeUI;
readonly Vector2 stretch = new Vector2(0f, 0.5f); readonly Vector2 stretch = new Vector2(0f, 0.5f);
readonly Vector2 middle = new Vector2(1f, 0.5f); readonly Vector2 middle = new Vector2(1f, 0.5f);
readonly Vector2 center = new Vector2(0.5f, 0.5f); readonly Vector2 center = new Vector2(0.5f, 0.5f);
@ -23,7 +17,6 @@ public class ScreenMove : MonoBehaviour
void Awake() void Awake()
{ {
isMobile = Application.isMobilePlatform; isMobile = Application.isMobilePlatform;
SearchView();
} }
private void Start() private void Start()
@ -73,59 +66,4 @@ public class ScreenMove : MonoBehaviour
} }
public void SearchView()
{
searchView.SetActive(true);
fursuitAdd.SetActive(false);
for(int n = 0; n < closeUI.Length; n++)
{
closeUI[n].SetActive(false);
}
}
public void FursuitAdd()
{
#if UNITY_EDITOR
GameManager.Instance.xid = "Fursuit_Library";
GameManager.Instance.xname = "ÆÛ½´Æ®µµ¼­°ü";
#endif
if (GameManager.Instance.xid == string.Empty)
{
HTTPRequest http = NetworkManager.Instance.CreateRequest<Session>("common/session/user", new object(), (data) =>
{
if(data.status == "L0002")
{
Application.OpenURL($"{NetworkManager.Instance.baseUrl}/oauth2/authorization/twitter");
}
else
{
GameManager.Instance.xid = data.userId;
GameManager.Instance.xname = data.userName;
searchView.SetActive(false);
fursuitAdd.SetActive(true);
for (int n = 0; n < closeUI.Length; n++)
{
closeUI[n].SetActive(false);
}
}
}, null, HTTPMethods.Get);
http.Send();
return;
}
searchView.SetActive(false);
fursuitAdd.SetActive(true);
for (int n = 0; n < closeUI.Length; n++)
{
closeUI[n].SetActive(false);
}
}
class Session
{
public string status;
public string userId;
public string userName;
}
} }

View File

@ -1,22 +1,19 @@
using Cysharp.Threading.Tasks;
using System;
using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;
using TMPro; using TMPro;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using UnityEngine.Pool;
using Cysharp.Threading.Tasks;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Linq;
using System;
using BestHTTP;
using System.Runtime.CompilerServices;
public class SearchCtrl : SingletonMonoBehaviour<SearchCtrl> public class SearchCtrl : SingletonMonoBehaviour<SearchCtrl>
{ {
//옵션 페이지 UI
[SerializeField] GameObject opsion; [SerializeField] GameObject opsion;
[SerializeField] Image searchMenuButtonImage; [SerializeField] Image searchMenuButtonImage;
[SerializeField] Sprite[] searchMenuButton; [SerializeField] Sprite[] searchMenuButton;
[SerializeField] TMP_Text searchMenuButtonText; [SerializeField] TMP_Text searchMenuButtonText;
[SerializeField] TMP_InputField name; [SerializeField] TMP_InputField name;
[SerializeField] TMP_Dropdown suitStyle; [SerializeField] TMP_Dropdown suitStyle;
[SerializeField] TMP_Dropdown suitType; [SerializeField] TMP_Dropdown suitType;
@ -25,51 +22,39 @@ public class SearchCtrl : SingletonMonoBehaviour<SearchCtrl>
[SerializeField] Toggle[] colors; [SerializeField] Toggle[] colors;
[SerializeField] Sprite[] isOnSprite; [SerializeField] Sprite[] isOnSprite;
// 검색 결과 UI
[SerializeField] ItemPrefab item; [SerializeField] ItemPrefab item;
[SerializeField] Transform results; [SerializeField] Transform results;
[SerializeField] GameObject listTop; [SerializeField] GameObject listTop;
[SerializeField] GameObject bar;
[SerializeField] RectTransform content; [SerializeField] RectTransform content;
[SerializeField] Animator searchUI;
[SerializeField] GameObject loading;
[SerializeField] Transform loadingImage;
// 모달 UI [SerializeField] Animator searchUI;
[SerializeField] ModalCtrl model; [SerializeField] ModalCtrl model;
// 검색 결과 데이터 private SearchRequest request;
private SearchRequest request = new SearchRequest(); private List<Library> librarys = new();
[SerializeField] private List<Library> librarys;
private bool hasMore;
// 검색결과 UI 프리팹
private List<ItemPrefab> itemPrefabs;
private ObjectPool<ItemPrefab> itemPrefabPool;
// ???
private bool isSearching = false;
private bool isRefreshing = false;
private Queue<Library> searchResults = new Queue<Library>(); private Queue<Library> searchResults = new Queue<Library>();
bool isLoading = false; private bool hasMore;
#if UNITY_EDITOR
[SerializeField]
#endif
private List<ItemPrefab> itemPrefabs;
private UnityEngine.Pool.ObjectPool<ItemPrefab> itemPrefabPool;
protected override void OnAwake() protected override void OnAwake()
{ {
name.onEndEdit.AddListener(INPUTFIELD); Application.targetFrameRate = 30;
librarys = new List<Library>(); QualitySettings.vSyncCount = 0;
itemPrefabPool = new ObjectPool<ItemPrefab>(itemPrefabs_OnCreate, itemPrefabs_OnGet, itemPrefabs_OnRelease, null, true, 100);
itemPrefabs = new List<ItemPrefab>();
}
void INPUTFIELD(string input) itemPrefabPool = new UnityEngine.Pool.ObjectPool<ItemPrefab>(itemPrefabs_OnCreate,itemPrefabs_OnGet, itemPrefabs_OnRelease,null,true, 100);
{ itemPrefabs = new List<ItemPrefab>();
if (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter))
{
SearchButton();
}
} }
#region ObjectPool #region ObjectPool
private ItemPrefab itemPrefabs_OnCreate() private ItemPrefab itemPrefabs_OnCreate()
{ {
return Instantiate<ItemPrefab>(item, results); return Instantiate<ItemPrefab>(item, results);
@ -86,35 +71,39 @@ public class SearchCtrl : SingletonMonoBehaviour<SearchCtrl>
itemPrefab.gameObject.SetActive(false); itemPrefab.gameObject.SetActive(false);
itemPrefabs.Remove(itemPrefab); itemPrefabs.Remove(itemPrefab);
} }
#endregion #endregion
private void OnEnable() private void OnEnable()
{ {
hasMore = false; hasMore = false;
model.modelCanvas.SetActive(false); model.gameObject.SetActive(false);
searchUI.SetTrigger("reset"); searchUI.SetTrigger("reset");
loading.SetActive(false);
ResetButton(); ResetButton();
ObjectClear(); ObjectClear();
} }
private void ObjectClear() private void ObjectClear()
{ {
//TODO <20><>Ȱ<EFBFBD><C8B0> <20><> <20><> <20>ְ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
results.gameObject.SetActive(false); results.gameObject.SetActive(false);
listTop.SetActive(false); listTop.SetActive(false);
bar.SetActive(false);
librarys.Clear(); librarys.Clear();
while (itemPrefabPool.CountActive > 0)
{ while(itemPrefabPool.CountActive > 0)
var item = itemPrefabs[itemPrefabs.Count - 1]; {
itemPrefabPool.Release(item); var item = itemPrefabs[itemPrefabs.Count-1];
} itemPrefabPool.Release(item);
}
} }
public void OpsionButton() public void OpsionButton()
{ {
//옵션창이 나오지 않았을때 250,100 //<EFBFBD>ɼ<EFBFBD>â<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD> 250,100
//옵션창이 나왔을때 60 ,290 //<EFBFBD>ɼ<EFBFBD>â<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 60 ,290
bool isSelf = !opsion.activeSelf; bool isSelf = !opsion.activeSelf;
searchMenuButtonImage.sprite = searchMenuButton[(isSelf ? 1 : 0)]; searchMenuButtonImage.sprite = searchMenuButton[(isSelf ? 1 : 0)];
searchMenuButtonImage.pixelsPerUnitMultiplier = (isSelf ? 3.5f : 1.75f); searchMenuButtonImage.pixelsPerUnitMultiplier = (isSelf ? 3.5f : 1.75f);
@ -125,115 +114,46 @@ public class SearchCtrl : SingletonMonoBehaviour<SearchCtrl>
public void SearchButton() public void SearchButton()
{ {
bool isBefore = true; ObjectClear();
if(request.fursuitName != name.text) request = new SearchRequest();
{ request.fursuitName = name.text;
request.fursuitName = name.text;
isBefore = false;
}
if (suitStyle.value != 0) if (suitStyle.value != 0)
{ request.suitStyle = GameManager.Instance.suitStyle[suitStyle.value - 1].code_id;
if (request.suitStyle != GameManager.Instance.suitStyle[suitStyle.value - 1].code_id)
{
request.suitStyle = GameManager.Instance.suitStyle[suitStyle.value - 1].code_id;
isBefore = false;
}
}
else if(request.suitStyle != "")
{
request.suitStyle = "";
isBefore = false;
}
if (suitType.value != 0) if (suitType.value != 0)
{ request.suitType = GameManager.Instance.suitType[suitType.value - 1].code_id;
if (request.suitType != GameManager.Instance.suitType[suitType.value - 1].code_id)
{
request.suitType = GameManager.Instance.suitType[suitType.value - 1].code_id;
isBefore = false;
}
}
else if (request.suitType != "")
{
request.suitType = "";
isBefore = false;
}
if (region.value != 0) if (region.value != 0)
{ request.suitRegion = GameManager.Instance.region[region.value - 1].code_id;
if (request.suitRegion != GameManager.Instance.region[region.value - 1].code_id)
{
request.suitRegion = GameManager.Instance.region[region.value - 1].code_id;
isBefore = false;
}
}
else if (request.suitRegion != "")
{
request.suitRegion = "";
isBefore = false;
}
if (animalTypes.value != 0) if (animalTypes.value != 0)
{ request.suitAnimalType = GameManager.Instance.animalTypes[animalTypes.value - 1].code_id;
if (request.suitAnimalType != GameManager.Instance.animalTypes[animalTypes.value - 1].code_id)
{
request.suitAnimalType = GameManager.Instance.animalTypes[animalTypes.value - 1].code_id;
isBefore = false;
}
}
else if (request.suitAnimalType != "")
{
request.suitAnimalType = "";
isBefore = false;
}
List<string> selectColor = new List<string>(); _ = SearchSuiters();
for (int n = 0; n < colors.Length; n++) {
if (colors[n].isOn)
{
selectColor.Add((n + (int)GameManager.eColor.).ToString());
}
}
if(selectColor.Count != request.colorList.Count)
{
request.colorList = selectColor;
isBefore = false;
}
else
{
for(int n = 0; n < selectColor.Count; n++)
{
if (selectColor[n] != request.colorList[n])
{
request.colorList = selectColor;
isBefore = false;
break;
}
}
}
//첫 검색이거나 이전과 검색결과가 같지 않으면 검색진행
if (!isBefore || !listTop.activeSelf)
{
request.offset = 0;
request.page = 1;
request.size = 10;
ObjectClear();
results.gameObject.SetActive(true); results.gameObject.SetActive(true);
listTop.SetActive(true); listTop.SetActive(true);
SearchSuiters().Forget(); bar.SetActive(true);
} //NetworkManager.Instance.CreateRequest<SearchResponse>("library/select/suiters", request, (data) =>
//{
// librarys = data.data;
// results.gameObject.SetActive(true);
// listTop.SetActive(true);
// bar.SetActive(true);
// ItemPrefab[] items = new ItemPrefab[data.data.Count];
// for (int n = 0; n < data.data.Count; n++)
// {
// var prefab = Instantiate<ItemPrefab>(item, results);
// itemPrefabs.Add(prefab);
// items[n] = prefab;
// }
// for (int n = 0; n < data.data.Count; n++)
// {
// items[n].Set(data.data[n]);
// }
// hasMore = data.hasMore;
// //LayoutRebuilder.ForceRebuildLayoutImmediate(content);
//});
} }
private void Update() private bool isSearching = false;
{
if (isLoading)
{
loadingImage.rotation *= Quaternion.Euler(0, 0, 5);
}
}
public async UniTask SearchSuiters() public async UniTask SearchSuiters()
{ {
if (isSearching) return; if (isSearching) return;
@ -241,27 +161,31 @@ public class SearchCtrl : SingletonMonoBehaviour<SearchCtrl>
var tcs = new TaskCompletionSource<bool>(); var tcs = new TaskCompletionSource<bool>();
HTTPRequest searchRequest = NetworkManager.Instance.CreateRequest<SearchResponse>("library/select/suiters", request, (data) => var searchRequest = NetworkManager.Instance.CreateRequest<SearchResponse>(
"library/select/suiters",
request,
(data) =>
{ {
for (int n = 0; n < data.data.Count; n++) for (int n = 0; n < data.data.Count; n++)
{ {
searchResults.Enqueue(data.data[n]); searchResults.Enqueue(data.data[n]);
} }
hasMore = data.hasMore; hasMore = data.hasMore;
tcs.SetResult(true); // 응답 완료 신호 tcs.SetResult(true); // 응답 완료 신호
loading.SetActive(hasMore);
} }
); );
await searchRequest.Send(); await searchRequest.Send();
await tcs.Task; // 응답이 완료될 때까지 대기 await tcs.Task; // 응답이 완료될 때까지 대기
await RefreshScroll(); await RefreshScroll();
isSearching = false; isSearching = false;
} }
bool isRefreshing = false;
public async UniTask RefreshScroll() public async UniTask RefreshScroll()
{ {
if (isRefreshing) return; if (isRefreshing) return;
@ -273,43 +197,57 @@ public class SearchCtrl : SingletonMonoBehaviour<SearchCtrl>
{ {
librarys.Add(result); librarys.Add(result);
} }
// librarys.Sort((a,b) => a.owner_id.CompareTo(b.owner_id));
} }
int n = 0; int n = 0;
for (; n < itemPrefabs.Count; n++) for (; n < itemPrefabs.Count; n++)
{ {
var item = itemPrefabs[n]; var item = itemPrefabs[n];
item.Set(librarys[n]); item.Set(librarys[n]);
await UniTask.Yield(); await UniTask.Yield();
} }
for (; n < librarys.Count; n++)
for(; n < librarys.Count; n++)
{ {
var item = itemPrefabPool.Get(); var item = itemPrefabPool.Get();
LayoutRebuilder.ForceRebuildLayoutImmediate(content);
item.Set(librarys[n]); item.Set(librarys[n]);
await UniTask.Yield(); await UniTask.Yield();
} }
isLoading = false;
loadingImage.rotation = Quaternion.identity; for(; n > librarys.Count; n--)
for (; n > librarys.Count; n--)
{ {
var item = itemPrefabs.Last(); var item = itemPrefabs.Last();
itemPrefabPool.Release(item); itemPrefabPool.Release(item);
await UniTask.Yield(); await UniTask.Yield();
} }
await ApplayImages(); await ApplayImages();
// LayoutRebuilder.ForceRebuildLayoutImmediate(content);
isRefreshing = false; isRefreshing = false;
} }
private async UniTask ApplayImages() private async UniTask ApplayImages()
{ {
for (int i = 0; itemPrefabs.Count > i; i++) for (int i = 0; itemPrefabs.Count > i; i++)
{ {
await GetImage(itemPrefabs[i].library); await GetImage(itemPrefabs[i].Library);
itemPrefabs[i].ImageSet(); itemPrefabs[i].ImageSet();
} }
}
public void NextSearch()
{
if (isSearching == false) {
hasMore = false;
request.page++;
_ = SearchSuiters();
}
} }
public async UniTask<Texture2D> GetImage(Library library) public async UniTask<Texture2D> GetImage(Library library)
@ -331,27 +269,17 @@ public class SearchCtrl : SingletonMonoBehaviour<SearchCtrl>
}, },
(fail) => (fail) =>
{ {
//Debug.LogError("GetImage Fail"); tcs.SetResult(null);
tcs.SetResult(null);
}, },
BestHTTP.HTTPMethods.Get BestHTTP.HTTPMethods.Get
); );
await request.Send(); await request.Send();
await tcs.Task; await tcs.Task;
return library._suit_image; return library._suit_image;
} }
public void NextSearch()
{
if (isSearching == false)
{
hasMore = false;
request.page++;
SearchSuiters().Forget();
}
}
public void ResetButton() public void ResetButton()
{ {
@ -359,7 +287,7 @@ public class SearchCtrl : SingletonMonoBehaviour<SearchCtrl>
suitType.value = 0; suitType.value = 0;
region.value = 0; region.value = 0;
animalTypes.value = 0; animalTypes.value = 0;
for (int n = 0; n < colors.Length; n++) for(int n = 0; n < colors.Length; n++)
{ {
colors[n].isOn = false; colors[n].isOn = false;
colors[n].image.sprite = isOnSprite[0]; colors[n].image.sprite = isOnSprite[0];
@ -376,15 +304,13 @@ public class SearchCtrl : SingletonMonoBehaviour<SearchCtrl>
model.Set(library); model.Set(library);
} }
public void ScrollValue(RectTransform Content) public void ScrollValue(RectTransform Content) {
{ if(Content.anchoredPosition.y < 0.0f)
if (Content.anchoredPosition.y < 0.0f)
{ {
Content.anchoredPosition = Vector2.zero; Content.anchoredPosition = Vector2.zero;
} }
else if (hasMore && Content.sizeDelta.y != Screen.height && Content.sizeDelta.y - Screen.height < (Content.anchoredPosition.y + 25)) else if(hasMore && Content.sizeDelta.y != Screen.height && Content.sizeDelta.y - Screen.height < Content.anchoredPosition.y)
{ {
isLoading = true;
NextSearch(); NextSearch();
} }
} }
@ -393,15 +319,15 @@ public class SearchCtrl : SingletonMonoBehaviour<SearchCtrl>
public class SearchRequest public class SearchRequest
{ {
public int xid; public int xid;
public string fursuitName = ""; /*오너,슈트 이름*/ public string fursuitName = ""; /*<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>Ʈ <20≯<EFBFBD>*/
public string suitMaker; /*사용안함*/ public string suitMaker; /*<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
public string suitRegion = ""; /*활동 국가*/ public string suitRegion = ""; /*Ȱ<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>*/
public string suitStyle = ""; /*슈트 스타일*/ public string suitStyle = ""; /*<EFBFBD><EFBFBD>Ʈ <20><>Ÿ<EFBFBD><C5B8>*/
public string suitAnimalType = ""; /*슈트 동물 종*/ public string suitAnimalType = ""; /*<EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD> <20><>*/
public string suitType = ""; /*슈트 형태*/ public string suitType = ""; /*<EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>*/
public List<string> colorList = new List<string>(); /*슈트 색상*/ public List<string> colorList = new List<string>(); /*<EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>*/
public int page = 1; public int page = 1;
public int size = 10; public int size = 5;
public int offset = 0; public int offset = 0;
} }
public class SearchResponse public class SearchResponse
@ -414,15 +340,14 @@ public class ImageResponse
public byte[] imageBytes; public byte[] imageBytes;
} }
[Serializable] public class Library : IEquatable<Library>
public class Library
{ {
public string imageBase64; public string imageBase64;
public string suit_name; public string suit_name;
public string user_info;
public string owner_id; public string owner_id;
public string owner_name; public string owner_name;
public string production_date; public string production_date;
public string suit_image;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public Texture2D _suit_image = null; public Texture2D _suit_image = null;
public string maker; public string maker;
public string region; public string region;
@ -430,4 +355,9 @@ public class Library
public string suit_style; public string suit_style;
public string suit_type; public string suit_type;
public List<string> suit_color; public List<string> suit_color;
public bool Equals(Library other)
{
return this.imageBase64 == other.imageBase64 && this.owner_id == other.owner_id && this.maker == other.maker && this.region == other.region && this.animal_type == other.animal_type && this.suit_type == other.suit_type && this.suit_style == other.suit_style;
}
} }

View File

@ -10,35 +10,8 @@ public class GameManager : DontDestroy<GameManager>
public List<CommonData> suitType; public List<CommonData> suitType;
public List<CommonData> region; public List<CommonData> region;
public InfoPageCtrl infoPageUI;
public string xid;
public string xname;
protected override void OnAwake() protected override void OnAwake()
{ {
Application.targetFrameRate = 100; Application.targetFrameRate = 100;
infoPageUI.gameObject.SetActive(false);
xid = string.Empty;
}
public enum eColor
{
= 500001,
= 500002,
= 500003,
= 500004,
= 500005,
= 500006,
= 500007,
= 500008,
= 500009,
= 500010,
= 500011,
= 500012,
= 500013,
= 500014,
= 500015,
= 500016,
} }
} }

View File

@ -1,4 +1,6 @@
using System.Collections.Generic; using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameObjectPool<T> where T : class public class GameObjectPool<T> where T : class
{ {

View File

@ -1,30 +0,0 @@
public static class InfoMessage
{
public static readonly string FursuitAdd = "등록신청이 완료되었습니다!\n<size=66%>주말 / 공휴일 제외 3일 이내로 등록 예정으로 추가 문의는 @fursuit_library로 문의바랍니다.</size>";
//Error
public static readonly string NotLogin = "문제 발생!\n<size=66%>트위터 로그인이 되어있지 않습니다.\n@fursuit_library로 문의바랍니다.</size>";
public static readonly string NotOwner = "확인해 주세요\n<size=66%>오너 정보가 없습니다.</size>";
public static readonly string NotName = "확인해 주세요\n<size=66%>케릭터 이름을 등록하지 않으셨습니다</size>";
public static readonly string NotAnimalType = "확인해 주세요\n<size=66%>동물 종을 선택하지 않으셨습니다. \n만약 리스트에 없을경우 @fursuit_library로 문의바랍니다.</size>";
public static readonly string NotSuitType = "확인해 주세요\n<size=66%>슈트 타입정보가 없습니다.</size>";
public static readonly string NotSuitStyle = "확인해 주세요\n<size=66%>슈트 스타일정보가 없습니다.</size>";
public static readonly string NotRegion = "확인해 주세요\n<size=66%>활동 국가 정보가 없습니다.</size>";
public static readonly string NotProductionDate = "확인해 주세요\n<size=66%>활동 시작일 정보가 잘못되었습니다.\n예)2025-04-01</size>";
public static readonly string NotImage = "확인해 주세요\n<size=66%>이미지 파일이 아닙니다.</size>";
public static readonly string NotImageType = "확인해 주세요\n<size=66%>잘못된 이미지 타입입니다.\n현재 jpg, jpeg, png만 지원하고 있습니다.\n추가 지원문의는 @fursuit_library로 문의바랍니다.</size>";
public static readonly string NotImageSet = "확인해 주세요\n<size=66%>이미지를 등록해 주세요.</size>";
public static readonly string NotImageSize = "확인해 주세요\n<size=66%>등록 가능한 이미지 최대 크기는 10MB입니다.</size>";
//ErrorCode
//잘못된 압축 형식 Base64가 아닌경우 발생
public static readonly string SystemError00001 = "문제 발생!\n<size=66%>아래 코드를 @fursuit_library로 문의해주세요\nE00001</size>";
//json 처리 오류
public static readonly string SystemError00002 = "문제 발생!\n<size=66%>아래 코드를 @fursuit_library로 문의해주세요\nE00002</size>";
}

View File

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: bd699c354f1fbc24ab3d3d6821f6bdaa

View File

@ -2,31 +2,29 @@ using UnityEngine;
using BestHTTP; using BestHTTP;
using System; using System;
using Newtonsoft.Json; using Newtonsoft.Json;
using BestHTTP.JSON; using MEC;
using System.Collections.Generic;
public class NetworkManager : SingletonMonoBehaviour<NetworkManager> public class NetworkManager : SingletonMonoBehaviour<NetworkManager>
{ {
[SerializeField] private string _baseUrl; [SerializeField] private string baseUrl;
[SerializeField] private string _baseEndpoint;
public string baseUrl { get { return _baseUrl; } }
/// <summary> /// <summary>
/// 데이터를 송수신해야할 때 사용합니다. send()는 생성을 마치고 자동으로 보냅니다. /// <20><><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD> <20>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>մϴ<D5B4>. send()<29><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ġ<EFBFBD><C4A1> <20>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.
/// </summary> /// </summary>
/// <typeparam name="T">역직렬화할 타입</typeparam> /// <typeparam name="T"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȭ<EFBFBD><EFBFBD> Ÿ<><C5B8></typeparam>
/// <param name="API">api 주소</param> /// <param name="API">api <EFBFBD>ּ<EFBFBD></param>
/// <param name="onRequestFinished">데이터 받은 후 처리할 절차</param> /// <param name="onRequestFinished"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> ó<><C3B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD></param>
/// <param name="serializeData">전송할 데이터, null로 넣으면 안보냅니다.</param> /// <param name="serializeData"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, null<6C><6C> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ⱥ<EFBFBD><C8BA><EFBFBD><EFBFBD>ϴ<EFBFBD>.</param>
/// <param name="methods">동작방식</param> /// <param name="methods"><EFBFBD><EFBFBD><EFBFBD>۹<EFBFBD><EFBFBD></param>
/// <returns>역직렬화된 데이터 or 기본값(반환 받지 못함)</returns> /// <returns><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȭ<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> or <20><EFBFBD><E2BABB>(<28><>ȯ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>)</returns>
public HTTPRequest CreateRequest<T>(string api, object serializeData, Action<T> onSuccess, Action<T> onFail = null, HTTPMethods methods = HTTPMethods.Post) public HTTPRequest CreateRequest<T>(string api, object serializeData, Action<T> onSuccess, Action<T> onFail = null, HTTPMethods methods = HTTPMethods.Post)
{ {
string url = $"{_baseUrl}/{_baseEndpoint}/{api}".Replace("\\p{Z}", String.Empty); string url = $"{baseUrl}{api}".Replace("\\p{Z}", String.Empty);
var httpRquest = new HTTPRequest(new Uri(url) //url 넣기 var httpRquest = new HTTPRequest(new Uri(url) //url <EFBFBD>ֱ<EFBFBD>
, methods //동작 방식 넣기 , methods //<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20>ֱ<EFBFBD>
, (request, response) => { , (request, response) => {
if (response == null || (response.StatusCode != 200)) if (response == null || (response.StatusCode != 200))
{ {
@ -46,23 +44,15 @@ public class NetworkManager : SingletonMonoBehaviour<NetworkManager>
httpRquest.RawData = System.Text.Encoding.UTF8.GetBytes(json); httpRquest.RawData = System.Text.Encoding.UTF8.GetBytes(json);
} }
httpRquest.Send();
return httpRquest; return httpRquest;
} }
/// <summary>
/// Texture2D 통신용 함수
/// </summary>
/// <param name="api"></param>
/// <param name="serializeData"></param>
/// <param name="onSuccess"></param>
/// <param name="onFail"></param>
/// <param name="methods"></param>
/// <returns></returns>
public HTTPRequest CreateImageRequest(string api, object serializeData, Action<Texture2D> onSuccess, Action<Texture2D> onFail = null, HTTPMethods methods = HTTPMethods.Post) public HTTPRequest CreateImageRequest(string api, object serializeData, Action<Texture2D> onSuccess, Action<Texture2D> onFail = null, HTTPMethods methods = HTTPMethods.Post)
{ {
string url = $"{_baseUrl}/{_baseEndpoint}/{api}".Replace("\\p{Z}", String.Empty); string url = $"{baseUrl}{api}".Replace("\\p{Z}", String.Empty);
var httpRquest = new HTTPRequest(new Uri(url) //url 넣기
, methods //동작 방식 넣기 var httpRquest = new HTTPRequest(new Uri(url) //url <20>ֱ<EFBFBD>
, methods //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD> <20>ֱ<EFBFBD>
, (request, response) => { , (request, response) => {
if (response == null || (response.StatusCode != 200)) if (response == null || (response.StatusCode != 200))
{ {
@ -81,6 +71,13 @@ public class NetworkManager : SingletonMonoBehaviour<NetworkManager>
string json = JsonConvert.SerializeObject(serializeData); string json = JsonConvert.SerializeObject(serializeData);
httpRquest.RawData = System.Text.Encoding.UTF8.GetBytes(json); httpRquest.RawData = System.Text.Encoding.UTF8.GetBytes(json);
} }
return httpRquest; return httpRquest;
} }
private IEnumerator<float> Sendearch()
{
//Timing.RunCoroutine(BuildingSet());
yield return Timing.WaitForSeconds(0.1f);
}
} }

View File

@ -1,4 +1,6 @@
using UnityEngine; using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SingletonMonoBehaviour<T> : MonoBehaviour where T : SingletonMonoBehaviour<T> public class SingletonMonoBehaviour<T> : MonoBehaviour where T : SingletonMonoBehaviour<T>
{ {
@ -13,8 +15,8 @@ public class SingletonMonoBehaviour<T> : MonoBehaviour where T : SingletonMonoBe
} }
else else
{ {
//Debug.Log("1개이상의 싱글턴이 존재합니다" + gameObject.name); Debug.Log("1개이상의 싱글턴이 존재합니다" + gameObject.name);
//Debug.Log("같은 함수가 들어간 싱글턴을 제거해 주세요"); Debug.Log("같은 함수가 들어간 싱글턴을 제거해 주세요");
Destroy(gameObject); Destroy(gameObject);
} }
} }

View File

@ -1,72 +0,0 @@
using System;
using UnityEngine;
public class WebGl : SingletonMonoBehaviour<WebGl>
{
public bool isOn = false;
public byte[] image { get { return _images; } }
byte[] _images;
public void GetDragAndDrop(string base64Json)
{
if (!isOn)
return;
try
{
base64Json = base64Json.Replace("[\"", "").Replace("\"]", "");
string[] data = base64Json.Split(',');
data[0] = data[0].Replace("data:", "");
data[0] = data[0].Replace("/", ";");
string[] info = data[0].Split(";");
if (info[0] != "image")
{
GameManager.Instance.infoPageUI.SetError(InfoMessage.NotImage);
return;
}
if (!(info[1] == "png" || info[1] == "jpg" || info[1] == "jpeg"))
{
GameManager.Instance.infoPageUI.SetError(InfoMessage.NotImageType);
return;
}
if (info[2] != "base64")
{
GameManager.Instance.infoPageUI.SetError(InfoMessage.SystemError00001);
return;
}
_images = DecodeBase64(data[1]);
double fileSizeInMB = _images.Length / (1024.0 * 1024.0);
if (fileSizeInMB > 10.0d)
{
GameManager.Instance.infoPageUI.SetError(InfoMessage.NotImageSize);
Debug.Log($"파일 크기: {fileSizeInMB:F2} MB");
return;
}
FursuitAddCtrl.Instance.SetImage(image);
}
catch (Exception e)
{
GameManager.Instance.infoPageUI.SetError(InfoMessage.SystemError00002);
}
}
public byte[] DecodeBase64(string base64String)
{
try
{
// Base64 문자열을 byte[]로 디코딩
byte[] byteArray = Convert.FromBase64String(base64String);
return byteArray;
}
catch (FormatException ex)
{
// 잘못된 Base64 문자열 처리
Console.WriteLine("Base64 디코딩 실패: " + ex.Message);
return null;
}
}
}

View File

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 061efe05400e6e34c8d1e9dc2bc05eb8

View File

@ -16,6 +16,9 @@ public class TopMenuCtrl : MonoBehaviour
float time; float time;
float speed = 10; float speed = 10;
//50
//-100
private void Awake() private void Awake()
{ {
rectTransform = GetComponent<RectTransform>(); rectTransform = GetComponent<RectTransform>();
@ -25,8 +28,11 @@ public class TopMenuCtrl : MonoBehaviour
if(isUp) if(isUp)
{ {
time += Time.deltaTime * speed; time += Time.deltaTime * speed;
Debug.Log(time);
if(time < 1.0f) if(time < 1.0f)
content.anchoredPosition = new Vector2(0, pointY - (pointY * time)); {
content.anchoredPosition = new Vector2 (0, pointY - (pointY * time));
}
else else
{ {
content.anchoredPosition = new Vector2(0, 0); content.anchoredPosition = new Vector2(0, 0);
@ -36,11 +42,11 @@ public class TopMenuCtrl : MonoBehaviour
else else
{ {
float sizeY = (content.anchoredPosition.y / (((float)Screen.height) / 100) / 100); float sizeY = (content.anchoredPosition.y / (((float)Screen.height) / 100) / 100);
search.text = sizeY < 0.5f ? "행\n사\n\n검\n색" : "행\n사"; search.text = sizeY < 0.5f ? "행\n사\n\n검\n색" : "행\n사";
fursuit.text = sizeY < 0.5f ? "퍼\n슈\n트\n\n등\n록" : "퍼\n슈\n트"; fursuit.text = sizeY < 0.5f ? "퍼\n슈\n트\n\n등\n록" : "퍼\n슈\n트";
sizeY = (sizeY < 1.0f ? sizeY : 1.0f); sizeY = (sizeY < 1.0f ? sizeY : 1.0f);
rectTransform.sizeDelta = new Vector2(282.5f, 242 - (sizeY * 87)); rectTransform.sizeDelta = new Vector2(282.5f, 242 - (sizeY * 87));
topButton.anchoredPosition = new Vector2(-28, -100f + (sizeY * 129f)); topButton.anchoredPosition = new Vector2(-50, -100f + (sizeY * 150f));
} }
} }
public void TopButton() public void TopButton()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 380 B

View File

@ -1,156 +0,0 @@
fileFormatVersion: 2
guid: c2e67ac5578599b44bd53919f12594f8
TextureImporter:
internalIDToNameTable:
- first:
213: -2301733007492010490
second: Dropdown_Input_0
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: Dropdown_Input_0
rect:
serializedVersion: 2
x: 0
y: 0
width: 50
height: 50
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: 60ea5a8560a9e00e0800000000000000
internalID: -2301733007492010490
vertices: []
indices:
edges: []
weights: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable:
Dropdown_Input_0: -2301733007492010490
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -3,7 +3,7 @@ guid: 861fc7ede2a1c3d4f815235336202eba
TextureImporter: TextureImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}
serializedVersion: 13 serializedVersion: 12
mipmaps: mipmaps:
mipMapMode: 0 mipMapMode: 0
enableMipMap: 0 enableMipMap: 0
@ -67,7 +67,7 @@ TextureImporter:
swizzle: 50462976 swizzle: 50462976
cookieLightType: 0 cookieLightType: 0
platformSettings: platformSettings:
- serializedVersion: 4 - serializedVersion: 3
buildTarget: DefaultTexturePlatform buildTarget: DefaultTexturePlatform
maxTextureSize: 2048 maxTextureSize: 2048
resizeAlgorithm: 0 resizeAlgorithm: 0
@ -80,7 +80,7 @@ TextureImporter:
ignorePlatformSupport: 0 ignorePlatformSupport: 0
androidETC2FallbackOverride: 0 androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0 forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4 - serializedVersion: 3
buildTarget: WebGL buildTarget: WebGL
maxTextureSize: 2048 maxTextureSize: 2048
resizeAlgorithm: 0 resizeAlgorithm: 0
@ -93,7 +93,7 @@ TextureImporter:
ignorePlatformSupport: 0 ignorePlatformSupport: 0
androidETC2FallbackOverride: 0 androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0 forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4 - serializedVersion: 3
buildTarget: Standalone buildTarget: Standalone
maxTextureSize: 2048 maxTextureSize: 2048
resizeAlgorithm: 0 resizeAlgorithm: 0
@ -106,7 +106,7 @@ TextureImporter:
ignorePlatformSupport: 0 ignorePlatformSupport: 0
androidETC2FallbackOverride: 0 androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0 forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4 - serializedVersion: 3
buildTarget: Android buildTarget: Android
maxTextureSize: 2048 maxTextureSize: 2048
resizeAlgorithm: 0 resizeAlgorithm: 0
@ -119,7 +119,7 @@ TextureImporter:
ignorePlatformSupport: 0 ignorePlatformSupport: 0
androidETC2FallbackOverride: 0 androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0 forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4 - serializedVersion: 3
buildTarget: Server buildTarget: Server
maxTextureSize: 2048 maxTextureSize: 2048
resizeAlgorithm: 0 resizeAlgorithm: 0
@ -136,7 +136,6 @@ TextureImporter:
serializedVersion: 2 serializedVersion: 2
sprites: [] sprites: []
outline: [] outline: []
customData:
physicsShape: [] physicsShape: []
bones: [] bones: []
spriteID: 5e97eb03825dee720800000000000000 spriteID: 5e97eb03825dee720800000000000000
@ -146,8 +145,6 @@ TextureImporter:
edges: [] edges: []
weights: [] weights: []
secondaryTextures: [] secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {} nameFileIdTable: {}
mipmapLimitGroupName: mipmapLimitGroupName:
pSDRemoveMatte: 0 pSDRemoveMatte: 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 729 B

View File

@ -1,156 +0,0 @@
fileFormatVersion: 2
guid: b837c489f1e01ab429ca7eb0049b01f9
TextureImporter:
internalIDToNameTable:
- first:
213: -2278566297644842510
second: Icon_0
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: Icon_0
rect:
serializedVersion: 2
x: 0
y: 0
width: 24
height: 42
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: 2f1c3bf4608e060e0800000000000000
internalID: -2278566297644842510
vertices: []
indices:
edges: []
weights: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable:
Icon_0: -2278566297644842510
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1,156 +0,0 @@
fileFormatVersion: 2
guid: be55064a11650084a98e70d3710ab911
TextureImporter:
internalIDToNameTable:
- first:
213: -8320539100486018772
second: Rectangle_27_1_0
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: Rectangle_27_1_0
rect:
serializedVersion: 2
x: 0
y: 0
width: 60
height: 60
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 30, y: 30, z: 30, w: 30}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: c2958cfa5c1878c80800000000000000
internalID: -8320539100486018772
vertices: []
indices:
edges: []
weights: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 0baa582e3dcf32c46ac65e46bda1b95b
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable:
Rectangle_27_1_0: -8320539100486018772
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,156 +0,0 @@
fileFormatVersion: 2
guid: e35ef1df33597934b888a3455d587531
TextureImporter:
internalIDToNameTable:
- first:
213: 807920327669769301
second: Style_Background2_0
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: Style_Background2_0
rect:
serializedVersion: 2
x: 0
y: 0
width: 60
height: 60
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 30, y: 30, z: 30, w: 30}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: 554e299e14f463b00800000000000000
internalID: 807920327669769301
vertices: []
indices:
edges: []
weights: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 3a5f5d7e08f89ec43a3210429e89b90e
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable:
Style_Background2_0: 807920327669769301
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1,156 +0,0 @@
fileFormatVersion: 2
guid: c76b64f4a1f71e64784ddec0898842ef
TextureImporter:
internalIDToNameTable:
- first:
213: -5579834082741855272
second: stamp_0
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: stamp_0
rect:
serializedVersion: 2
x: 0
y: 0
width: 604
height: 153
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: 8dbdd8807727092b0800000000000000
internalID: -5579834082741855272
vertices: []
indices:
edges: []
weights: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable:
stamp_0: -5579834082741855272
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -3,7 +3,7 @@ guid: 50a793ca026e5f94db805e7d6ef95009
TextureImporter: TextureImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}
serializedVersion: 13 serializedVersion: 12
mipmaps: mipmaps:
mipMapMode: 0 mipMapMode: 0
enableMipMap: 0 enableMipMap: 0
@ -67,7 +67,7 @@ TextureImporter:
swizzle: 50462976 swizzle: 50462976
cookieLightType: 0 cookieLightType: 0
platformSettings: platformSettings:
- serializedVersion: 4 - serializedVersion: 3
buildTarget: DefaultTexturePlatform buildTarget: DefaultTexturePlatform
maxTextureSize: 2048 maxTextureSize: 2048
resizeAlgorithm: 0 resizeAlgorithm: 0
@ -80,7 +80,7 @@ TextureImporter:
ignorePlatformSupport: 0 ignorePlatformSupport: 0
androidETC2FallbackOverride: 0 androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0 forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4 - serializedVersion: 3
buildTarget: WebGL buildTarget: WebGL
maxTextureSize: 2048 maxTextureSize: 2048
resizeAlgorithm: 0 resizeAlgorithm: 0
@ -93,7 +93,7 @@ TextureImporter:
ignorePlatformSupport: 0 ignorePlatformSupport: 0
androidETC2FallbackOverride: 0 androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0 forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4 - serializedVersion: 3
buildTarget: Standalone buildTarget: Standalone
maxTextureSize: 2048 maxTextureSize: 2048
resizeAlgorithm: 0 resizeAlgorithm: 0
@ -106,7 +106,7 @@ TextureImporter:
ignorePlatformSupport: 0 ignorePlatformSupport: 0
androidETC2FallbackOverride: 0 androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0 forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4 - serializedVersion: 3
buildTarget: Android buildTarget: Android
maxTextureSize: 2048 maxTextureSize: 2048
resizeAlgorithm: 0 resizeAlgorithm: 0
@ -119,7 +119,7 @@ TextureImporter:
ignorePlatformSupport: 0 ignorePlatformSupport: 0
androidETC2FallbackOverride: 0 androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0 forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4 - serializedVersion: 3
buildTarget: Server buildTarget: Server
maxTextureSize: 2048 maxTextureSize: 2048
resizeAlgorithm: 0 resizeAlgorithm: 0
@ -136,7 +136,6 @@ TextureImporter:
serializedVersion: 2 serializedVersion: 2
sprites: [] sprites: []
outline: [] outline: []
customData:
physicsShape: [] physicsShape: []
bones: [] bones: []
spriteID: 5e97eb03825dee720800000000000000 spriteID: 5e97eb03825dee720800000000000000
@ -146,8 +145,6 @@ TextureImporter:
edges: [] edges: []
weights: [] weights: []
secondaryTextures: [] secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {} nameFileIdTable: {}
mipmapLimitGroupName: mipmapLimitGroupName:
pSDRemoveMatte: 0 pSDRemoveMatte: 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 B

View File

@ -1,156 +0,0 @@
fileFormatVersion: 2
guid: 0762348e1598d934f8cc44835fe5d687
TextureImporter:
internalIDToNameTable:
- first:
213: -6889361472651060198
second: Frame_5080_0
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: Frame_5080_0
rect:
serializedVersion: 2
x: 0
y: 0
width: 5
height: 40
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: a1c1f55fd321460a0800000000000000
internalID: -6889361472651060198
vertices: []
indices:
edges: []
weights: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 5bd39ce4a78806048a51e60d8ff06d85
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable:
Frame_5080_0: -6889361472651060198
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 907 B

View File

@ -1,155 +0,0 @@
fileFormatVersion: 2
guid: 1dc401a7352bb85449909791095ea911
TextureImporter:
internalIDToNameTable:
- first:
213: -2278566297644842510
second: Icon_0
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: Icon_0
rect:
serializedVersion: 2
x: 0
y: 0
width: 46
height: 53
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: 2f1c3bf4608e060e0800000000000000
internalID: -2278566297644842510
vertices: []
indices:
edges: []
weights: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

View File

@ -1,156 +0,0 @@
fileFormatVersion: 2
guid: edb55753fb01eb24d89a734b4b947399
TextureImporter:
internalIDToNameTable:
- first:
213: 7227660148774810713
second: Frame_5074_0
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: Frame_5074_0
rect:
serializedVersion: 2
x: 0
y: 0
width: 1920
height: 1080
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: 95438fc8c9ecd4460800000000000000
internalID: 7227660148774810713
vertices: []
indices:
edges: []
weights: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable:
Frame_5074_0: 7227660148774810713
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

View File

@ -1,156 +0,0 @@
fileFormatVersion: 2
guid: 4db3f7ebab1f61e44ba206af4a54e5ea
TextureImporter:
internalIDToNameTable:
- first:
213: 4827032453998402069
second: Frame_5077_0
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: Frame_5077_0
rect:
serializedVersion: 2
x: 0
y: 0
width: 1920
height: 1080
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: 51a5bd331701df240800000000000000
internalID: 4827032453998402069
vertices: []
indices:
edges: []
weights: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable:
Frame_5077_0: 4827032453998402069
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

After

Width:  |  Height:  |  Size: 223 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1023 KiB

View File

@ -1,155 +0,0 @@
fileFormatVersion: 2
guid: 4385301616fa72b46a8eab5ea05c13c0
TextureImporter:
internalIDToNameTable:
- first:
213: 2478865279642758037
second: Main_Container_0
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: Main_Container_0
rect:
serializedVersion: 2
x: 0
y: 0
width: 1920
height: 1080
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: 59be72796d2b66220800000000000000
internalID: 2478865279642758037
vertices: []
indices:
edges: []
weights: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

View File

@ -1,156 +0,0 @@
fileFormatVersion: 2
guid: db7185396c62fea4a9e4e5f4d54ebc1d
TextureImporter:
internalIDToNameTable:
- first:
213: 3121311038206801502
second: Main_Container__0
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: Main_Container__0
rect:
serializedVersion: 2
x: 0
y: 0
width: 1920
height: 1080
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: e5672d11adf115b20800000000000000
internalID: 3121311038206801502
vertices: []
indices:
edges: []
weights: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable:
Main_Container__0: 3121311038206801502
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

View File

@ -1,156 +0,0 @@
fileFormatVersion: 2
guid: 01776f7a17020134898f7ed7462e2af9
TextureImporter:
internalIDToNameTable:
- first:
213: 6839554522387699187
second: Main_Containerasdf_0
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: Main_Containerasdf_0
rect:
serializedVersion: 2
x: 0
y: 0
width: 1920
height: 1080
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: 3f5d5d0c99afaee50800000000000000
internalID: 6839554522387699187
vertices: []
indices:
edges: []
weights: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable:
Main_Containerasdf_0: 6839554522387699187
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -137,23 +137,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1da056f246b185842aae317b0faf0a3b, type: 3} m_Script: {fileID: 11500000, guid: 1da056f246b185842aae317b0faf0a3b, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_library:
imageBase64:
suit_name:
owner_id:
owner_name:
production_date:
_suit_image: {fileID: 0}
maker:
region:
animal_type:
suit_style:
suit_type:
suit_color: []
suitName: {fileID: 8144517625848204680} suitName: {fileID: 8144517625848204680}
ownerName: {fileID: 2525889181953908848} ownerName: {fileID: 2525889181953908848}
suitImage: {fileID: 3834666193358897927} suitImage: {fileID: 1611683278033774322}
loading: {fileID: 5262172002440681221}
--- !u!114 &748755465289565643 --- !u!114 &748755465289565643
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -250,7 +236,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 104449160465615579} - component: {fileID: 104449160465615579}
- component: {fileID: 1422498389634370991} - component: {fileID: 1422498389634370991}
- component: {fileID: 3834666193358897927} - component: {fileID: 1611683278033774322}
m_Layer: 5 m_Layer: 5
m_Name: SuitImage m_Name: SuitImage
m_TagString: Untagged m_TagString: Untagged
@ -285,7 +271,7 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3874408075247954670} m_GameObject: {fileID: 3874408075247954670}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!114 &3834666193358897927 --- !u!114 &1611683278033774322
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
@ -580,81 +566,6 @@ MonoBehaviour:
m_hasFontAssetChanged: 0 m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0} m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &5262172002440681221
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7097115115093172578}
- component: {fileID: 3151196771925636361}
- component: {fileID: 4446388371920305231}
m_Layer: 5
m_Name: Loading
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7097115115093172578
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5262172002440681221}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 716527630986831245}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 50, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3151196771925636361
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5262172002440681221}
m_CullTransparentMesh: 1
--- !u!114 &4446388371920305231
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5262172002440681221}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 96ae92151615e4241b2e95873bbc5ede, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &6543022936957413842 --- !u!1 &6543022936957413842
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -687,14 +598,13 @@ RectTransform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 104449160465615579} - {fileID: 104449160465615579}
- {fileID: 7097115115093172578}
- {fileID: 6213423518440723368} - {fileID: 6213423518440723368}
m_Father: {fileID: 6212042657398888647} m_Father: {fileID: 6212042657398888647}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 4} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -10, y: -10} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &493814710637605694 --- !u!222 &493814710637605694
CanvasRenderer: CanvasRenderer:
@ -703,7 +613,7 @@ CanvasRenderer:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6543022936957413842} m_GameObject: {fileID: 6543022936957413842}
m_CullTransparentMesh: 0 m_CullTransparentMesh: 1
--- !u!114 &7330084566650112225 --- !u!114 &7330084566650112225
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -733,7 +643,7 @@ MonoBehaviour:
m_FillClockwise: 1 m_FillClockwise: 1
m_FillOrigin: 0 m_FillOrigin: 0
m_UseSpriteMesh: 0 m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 5.25 m_PixelsPerUnitMultiplier: 4.5
--- !u!114 &4532091925091001432 --- !u!114 &4532091925091001432
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,42 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!200 &-5059779754161838749
ShaderVariantCollection:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: ShaderVariants
m_Shaders:
- first: {fileID: 4800000, guid: 2933b413a51fc4ff3a83c7ef4177ae84, type: 3}
second:
variants:
- keywords:
passType: 0
- first: {fileID: 4800000, guid: 9839189d918374a318d397a86e90aa73, type: 3}
second:
variants:
- keywords: SOFTMASKABLE
passType: 0
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: eb5b5e33068c14a2bacdd6575e94f505, type: 3}
m_Name: UISoftMaskProjectSettings
m_EditorClassIdentifier:
_jsonText:
m_SoftMaskEnabled: 1
m_StereoEnabled: 1
m_TransformSensitivity: 1
m_HideGeneratedComponents: 1
m_ShaderVariantRegistry:
m_OptionalShaders: []
m_Asset: {fileID: -5059779754161838749}
m_ErrorOnUnregisteredVariant: 0
m_UnregisteredVariants: []

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: e6d9ad8a390508d40970b5eb57e84832
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: a77e3012f37e98f4fb0c9f538d96d114 guid: 8e7e8f5a82a3a134e91c54efd2274ea9
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}

View File

@ -1,6 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 8052753db44702c40aebc2a2b5fa7fc3 guid: 1b8d251f9af63b746bf2f7ffe00ebb9b
folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -114,14 +114,16 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 71c1514a6bd24e1e882cebbe1904ce04, type: 3} m_Script: {fileID: 11500000, guid: 71c1514a6bd24e1e882cebbe1904ce04, type: 3}
m_Name: Anton SDF m_Name: Anton SDF
m_EditorClassIdentifier: m_EditorClassIdentifier:
hashCode: -1153031989
material: {fileID: 2140474}
materialHashCode: -1064320757
m_Version: 1.1.0 m_Version: 1.1.0
m_Material: {fileID: 2140474}
m_SourceFontFileGUID: 997a43b767814dd0a7642ec9b78cba41 m_SourceFontFileGUID: 997a43b767814dd0a7642ec9b78cba41
m_SourceFontFile_EditorRef: {fileID: 12800000, guid: 997a43b767814dd0a7642ec9b78cba41,
type: 3}
m_SourceFontFile: {fileID: 12800000, guid: 997a43b767814dd0a7642ec9b78cba41, type: 3} m_SourceFontFile: {fileID: 12800000, guid: 997a43b767814dd0a7642ec9b78cba41, type: 3}
m_AtlasPopulationMode: 1 m_AtlasPopulationMode: 1
InternalDynamicOS: 0
m_FaceInfo: m_FaceInfo:
m_FaceIndex: 0
m_FamilyName: Anton m_FamilyName: Anton
m_StyleName: Regular m_StyleName: Regular
m_PointSize: 90 m_PointSize: 90
@ -185,21 +187,15 @@ MonoBehaviour:
m_KerningTable: m_KerningTable:
kerningPairs: [] kerningPairs: []
m_FontFeatureTable: m_FontFeatureTable:
m_MultipleSubstitutionRecords: []
m_LigatureSubstitutionRecords: []
m_GlyphPairAdjustmentRecords: [] m_GlyphPairAdjustmentRecords: []
m_MarkToBaseAdjustmentRecords: []
m_MarkToMarkAdjustmentRecords: []
fallbackFontAssets: [] fallbackFontAssets: []
m_FallbackFontAssetTable: [] m_FallbackFontAssetTable: []
m_CreationSettings: m_CreationSettings:
sourceFontFileName: sourceFontFileName:
sourceFontFileGUID: 997a43b767814dd0a7642ec9b78cba41 sourceFontFileGUID: 997a43b767814dd0a7642ec9b78cba41
faceIndex: 0
pointSizeSamplingMode: 1 pointSizeSamplingMode: 1
pointSize: 90 pointSize: 90
padding: 9 padding: 9
paddingMode: 0
packingMode: 4 packingMode: 4
atlasWidth: 1024 atlasWidth: 1024
atlasHeight: 1024 atlasHeight: 1024

View File

@ -114,14 +114,16 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 71c1514a6bd24e1e882cebbe1904ce04, type: 3} m_Script: {fileID: 11500000, guid: 71c1514a6bd24e1e882cebbe1904ce04, type: 3}
m_Name: Electronic Highway Sign SDF m_Name: Electronic Highway Sign SDF
m_EditorClassIdentifier: m_EditorClassIdentifier:
hashCode: 1023178945
material: {fileID: 2140032}
materialHashCode: 225402433
m_Version: 1.1.0 m_Version: 1.1.0
m_Material: {fileID: 2140032}
m_SourceFontFileGUID: 8a2b9e2a607dd2143b58c44bc32410b4 m_SourceFontFileGUID: 8a2b9e2a607dd2143b58c44bc32410b4
m_SourceFontFile_EditorRef: {fileID: 12800000, guid: 8a2b9e2a607dd2143b58c44bc32410b4,
type: 3}
m_SourceFontFile: {fileID: 12800000, guid: 8a2b9e2a607dd2143b58c44bc32410b4, type: 3} m_SourceFontFile: {fileID: 12800000, guid: 8a2b9e2a607dd2143b58c44bc32410b4, type: 3}
m_AtlasPopulationMode: 1 m_AtlasPopulationMode: 1
InternalDynamicOS: 0
m_FaceInfo: m_FaceInfo:
m_FaceIndex: 0
m_FamilyName: Electronic Highway Sign m_FamilyName: Electronic Highway Sign
m_StyleName: Regular m_StyleName: Regular
m_PointSize: 144 m_PointSize: 144
@ -185,21 +187,15 @@ MonoBehaviour:
m_KerningTable: m_KerningTable:
kerningPairs: [] kerningPairs: []
m_FontFeatureTable: m_FontFeatureTable:
m_MultipleSubstitutionRecords: []
m_LigatureSubstitutionRecords: []
m_GlyphPairAdjustmentRecords: [] m_GlyphPairAdjustmentRecords: []
m_MarkToBaseAdjustmentRecords: []
m_MarkToMarkAdjustmentRecords: []
fallbackFontAssets: [] fallbackFontAssets: []
m_FallbackFontAssetTable: [] m_FallbackFontAssetTable: []
m_CreationSettings: m_CreationSettings:
sourceFontFileName: sourceFontFileName:
sourceFontFileGUID: 8a2b9e2a607dd2143b58c44bc32410b4 sourceFontFileGUID: 8a2b9e2a607dd2143b58c44bc32410b4
faceIndex: 0
pointSizeSamplingMode: 1 pointSizeSamplingMode: 1
pointSize: 144 pointSize: 144
padding: 10 padding: 10
paddingMode: 0
packingMode: 4 packingMode: 4
atlasWidth: 1024 atlasWidth: 1024
atlasHeight: 1024 atlasHeight: 1024

View File

@ -68,9 +68,9 @@ Material:
- _OutlineWidth: 0 - _OutlineWidth: 0
- _PerspectiveFilter: 0.875 - _PerspectiveFilter: 0.875
- _Reflectivity: 10 - _Reflectivity: 10
- _ScaleRatioA: 0.9 - _ScaleRatioA: 0.8333333
- _ScaleRatioB: 0.73125 - _ScaleRatioB: 0.6770833
- _ScaleRatioC: 0.73125 - _ScaleRatioC: 0.6770833
- _ScaleX: 1 - _ScaleX: 1
- _ScaleY: 1 - _ScaleY: 1
- _ShaderFlags: 0 - _ShaderFlags: 0
@ -114,14 +114,16 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 71c1514a6bd24e1e882cebbe1904ce04, type: 3} m_Script: {fileID: 11500000, guid: 71c1514a6bd24e1e882cebbe1904ce04, type: 3}
m_Name: Oswald Bold SDF m_Name: Oswald Bold SDF
m_EditorClassIdentifier: m_EditorClassIdentifier:
hashCode: 1490843414
material: {fileID: 2147374}
materialHashCode: 1112331510
m_Version: 1.1.0 m_Version: 1.1.0
m_Material: {fileID: 2147374}
m_SourceFontFileGUID: c9f6d0e7bc8541498c9a4799ba184ede m_SourceFontFileGUID: c9f6d0e7bc8541498c9a4799ba184ede
m_SourceFontFile_EditorRef: {fileID: 12800000, guid: c9f6d0e7bc8541498c9a4799ba184ede,
type: 3}
m_SourceFontFile: {fileID: 12800000, guid: c9f6d0e7bc8541498c9a4799ba184ede, type: 3} m_SourceFontFile: {fileID: 12800000, guid: c9f6d0e7bc8541498c9a4799ba184ede, type: 3}
m_AtlasPopulationMode: 1 m_AtlasPopulationMode: 1
InternalDynamicOS: 0
m_FaceInfo: m_FaceInfo:
m_FaceIndex: 0
m_FamilyName: Oswald m_FamilyName: Oswald
m_StyleName: Bold m_StyleName: Bold
m_PointSize: 90 m_PointSize: 90
@ -185,21 +187,15 @@ MonoBehaviour:
m_KerningTable: m_KerningTable:
kerningPairs: [] kerningPairs: []
m_FontFeatureTable: m_FontFeatureTable:
m_MultipleSubstitutionRecords: []
m_LigatureSubstitutionRecords: []
m_GlyphPairAdjustmentRecords: [] m_GlyphPairAdjustmentRecords: []
m_MarkToBaseAdjustmentRecords: []
m_MarkToMarkAdjustmentRecords: []
fallbackFontAssets: [] fallbackFontAssets: []
m_FallbackFontAssetTable: [] m_FallbackFontAssetTable: []
m_CreationSettings: m_CreationSettings:
sourceFontFileName: sourceFontFileName:
sourceFontFileGUID: c9f6d0e7bc8541498c9a4799ba184ede sourceFontFileGUID: c9f6d0e7bc8541498c9a4799ba184ede
faceIndex: 0
pointSizeSamplingMode: 1 pointSizeSamplingMode: 1
pointSize: 90 pointSize: 90
padding: 9 padding: 9
paddingMode: 0
packingMode: 4 packingMode: 4
atlasWidth: 1024 atlasWidth: 1024
atlasHeight: 1024 atlasHeight: 1024

View File

@ -44,7 +44,7 @@ RenderSettings:
LightmapSettings: LightmapSettings:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
serializedVersion: 11 serializedVersion: 11
m_GIWorkflowMode: 1 m_GIWorkflowMode: 0
m_GISettings: m_GISettings:
serializedVersion: 2 serializedVersion: 2
m_BounceScale: 1 m_BounceScale: 1

View File

@ -484,7 +484,7 @@ MonoBehaviour:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_text: See the <link="ID_01"><u><#40A0FF>online documentation</color></u></link> m_text: See the <link="ID_01"><u><#40A0FF>online documentation</color></u></link>
for more information <a href="http://url...">about this product</a> \U0001F60A for more information <u><link="ID_02">about this product</link></u> \U0001F60A
m_isRightToLeft: 0 m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2100000, guid: e73a58f6e2794ae7b1b7e50b7fb811b0, type: 2} m_sharedMaterial: {fileID: 2100000, guid: e73a58f6e2794ae7b1b7e50b7fb811b0, type: 2}
@ -527,16 +527,15 @@ MonoBehaviour:
m_lineSpacingMax: 0 m_lineSpacingMax: 0
m_paragraphSpacing: 0 m_paragraphSpacing: 0
m_charWidthMaxAdj: 0 m_charWidthMaxAdj: 0
m_TextWrappingMode: 1 m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4 m_wordWrappingRatios: 0.4
m_overflowMode: 1 m_overflowMode: 0
m_linkedTextComponent: {fileID: 0} m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0} parentLinkedComponent: {fileID: 0}
m_enableKerning: 1 m_enableKerning: 1
m_enableExtraPadding: 0 m_enableExtraPadding: 0
checkPaddingRequired: 0 checkPaddingRequired: 0
m_isRichText: 1 m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 0 m_parseCtrlCharacters: 0
m_isOrthographic: 0 m_isOrthographic: 0
m_isCullingEnabled: 0 m_isCullingEnabled: 0
@ -608,7 +607,8 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children:
- {fileID: 1744362547}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 1 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -617,6 +617,87 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 38.25, y: 19.44} m_SizeDelta: {x: 38.25, y: 19.44}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1744362543
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1744362547}
- component: {fileID: 1744362545}
- component: {fileID: 1744362546}
m_Layer: 0
m_Name: TMP SubMesh [TextMeshPro/Sprite]
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!33 &1744362545
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1744362543}
m_Mesh: {fileID: 0}
--- !u!23 &1744362546
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1744362543}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 2103686, guid: c41005c129ba4d66911b75229fd70b45, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!4 &1744362547
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1744362543}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1647263053}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1767744558 --- !u!1 &1767744558
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -747,7 +828,7 @@ MonoBehaviour:
m_lineSpacingMax: 0 m_lineSpacingMax: 0
m_paragraphSpacing: 0 m_paragraphSpacing: 0
m_charWidthMaxAdj: 0 m_charWidthMaxAdj: 0
m_TextWrappingMode: 1 m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4 m_wordWrappingRatios: 0.4
m_overflowMode: 0 m_overflowMode: 0
m_linkedTextComponent: {fileID: 0} m_linkedTextComponent: {fileID: 0}
@ -756,7 +837,6 @@ MonoBehaviour:
m_enableExtraPadding: 0 m_enableExtraPadding: 0
checkPaddingRequired: 0 checkPaddingRequired: 0
m_isRichText: 1 m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 0 m_parseCtrlCharacters: 0
m_isOrthographic: 1 m_isOrthographic: 1
m_isCullingEnabled: 0 m_isCullingEnabled: 0

View File

@ -4,7 +4,7 @@ using System.Collections;
namespace TMPro.Examples namespace TMPro.Examples
{ {
public class Benchmark01 : MonoBehaviour public class Benchmark01 : MonoBehaviour
{ {
@ -54,13 +54,13 @@ namespace TMPro.Examples
//m_textMeshPro.fontSharedMaterial.SetFloat("_OutlineWidth", 0.2f); //m_textMeshPro.fontSharedMaterial.SetFloat("_OutlineWidth", 0.2f);
//m_textMeshPro.fontSharedMaterial.EnableKeyword("UNDERLAY_ON"); //m_textMeshPro.fontSharedMaterial.EnableKeyword("UNDERLAY_ON");
//m_textMeshPro.lineJustification = LineJustificationTypes.Center; //m_textMeshPro.lineJustification = LineJustificationTypes.Center;
m_textMeshPro.textWrappingMode = TextWrappingModes.NoWrap; m_textMeshPro.enableWordWrapping = false;
//m_textMeshPro.lineLength = 60; //m_textMeshPro.lineLength = 60;
//m_textMeshPro.characterSpacing = 0.2f; //m_textMeshPro.characterSpacing = 0.2f;
//m_textMeshPro.fontColor = new Color32(255, 255, 255, 255); //m_textMeshPro.fontColor = new Color32(255, 255, 255, 255);
m_material01 = m_textMeshPro.font.material; m_material01 = m_textMeshPro.font.material;
m_material02 = Resources.Load<Material>("Fonts & Materials/LiberationSans SDF - Drop Shadow"); // Make sure the LiberationSans SDF exists before calling this... m_material02 = Resources.Load<Material>("Fonts & Materials/LiberationSans SDF - Drop Shadow"); // Make sure the LiberationSans SDF exists before calling this...
} }

View File

@ -35,7 +35,7 @@ namespace TMPro.Examples
textMeshPro.alignment = TextAlignmentOptions.Bottom; textMeshPro.alignment = TextAlignmentOptions.Bottom;
textMeshPro.fontSize = 96; textMeshPro.fontSize = 96;
textMeshPro.fontFeatures.Clear(); textMeshPro.enableKerning = false;
textMeshPro.color = new Color32(255, 255, 0, 255); textMeshPro.color = new Color32(255, 255, 0, 255);
textMeshPro.text = "!"; textMeshPro.text = "!";

View File

@ -4,7 +4,7 @@ using System.Collections;
namespace TMPro.Examples namespace TMPro.Examples
{ {
public class Benchmark04 : MonoBehaviour public class Benchmark04 : MonoBehaviour
{ {
@ -45,7 +45,7 @@ namespace TMPro.Examples
//textMeshPro.anchor = AnchorPositions.Left; //textMeshPro.anchor = AnchorPositions.Left;
textMeshPro.rectTransform.pivot = new Vector2(0, 0.5f); textMeshPro.rectTransform.pivot = new Vector2(0, 0.5f);
textMeshPro.textWrappingMode = TextWrappingModes.NoWrap; textMeshPro.enableWordWrapping = false;
textMeshPro.extraPadding = true; textMeshPro.extraPadding = true;
textMeshPro.isOrthographic = true; textMeshPro.isOrthographic = true;
textMeshPro.fontSize = i; textMeshPro.fontSize = i;
@ -65,7 +65,7 @@ namespace TMPro.Examples
//if (lineHeight > orthoSize * 2 * 0.9f) return; //if (lineHeight > orthoSize * 2 * 0.9f) return;
go.transform.position = m_Transform.position + new Vector3(ratio * -orthoSize * 0.975f, orthoSize * 0.975f - lineHeight, 1); go.transform.position = m_Transform.position + new Vector3(ratio * -orthoSize * 0.975f, orthoSize * 0.975f - lineHeight, 1);
TextMesh textMesh = go.AddComponent<TextMesh>(); TextMesh textMesh = go.AddComponent<TextMesh>();
textMesh.font = Resources.Load("Fonts/ARIAL", typeof(Font)) as Font; textMesh.font = Resources.Load("Fonts/ARIAL", typeof(Font)) as Font;
textMesh.renderer.sharedMaterial = textMesh.font.material; textMesh.renderer.sharedMaterial = textMesh.font.material;

View File

@ -4,15 +4,12 @@ using System.Collections;
namespace TMPro.Examples namespace TMPro.Examples
{ {
public class ObjectSpin : MonoBehaviour public class ObjectSpin : MonoBehaviour
{ {
#pragma warning disable 0414
public enum MotionType { Rotation, SearchLight, Translation };
public MotionType Motion;
public Vector3 TranslationDistance = new Vector3(5, 0, 0); #pragma warning disable 0414
public float TranslationSpeed = 1.0f;
public float SpinSpeed = 5; public float SpinSpeed = 5;
public int RotationRange = 15; public int RotationRange = 15;
private Transform m_transform; private Transform m_transform;
@ -22,6 +19,10 @@ namespace TMPro.Examples
private Vector3 m_initial_Rotation; private Vector3 m_initial_Rotation;
private Vector3 m_initial_Position; private Vector3 m_initial_Position;
private Color32 m_lightColor; private Color32 m_lightColor;
private int frames = 0;
public enum MotionType { Rotation, BackAndForth, Translation };
public MotionType Motion;
void Awake() void Awake()
{ {
@ -37,30 +38,31 @@ namespace TMPro.Examples
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
switch (Motion) if (Motion == MotionType.Rotation)
{ {
case MotionType.Rotation: m_transform.Rotate(0, SpinSpeed * Time.deltaTime, 0);
m_transform.Rotate(0, SpinSpeed * Time.deltaTime, 0); }
break; else if (Motion == MotionType.BackAndForth)
case MotionType.SearchLight: {
m_time += SpinSpeed * Time.deltaTime; m_time += SpinSpeed * Time.deltaTime;
m_transform.rotation = Quaternion.Euler(m_initial_Rotation.x, Mathf.Sin(m_time) * RotationRange + m_initial_Rotation.y, m_initial_Rotation.z); m_transform.rotation = Quaternion.Euler(m_initial_Rotation.x, Mathf.Sin(m_time) * RotationRange + m_initial_Rotation.y, m_initial_Rotation.z);
break; }
case MotionType.Translation: else
m_time += TranslationSpeed * Time.deltaTime; {
m_time += SpinSpeed * Time.deltaTime;
float x = TranslationDistance.x * Mathf.Cos(m_time); float x = 15 * Mathf.Cos(m_time * .95f);
float y = TranslationDistance.y * Mathf.Sin(m_time) * Mathf.Cos(m_time * 1f); float y = 10; // *Mathf.Sin(m_time * 1f) * Mathf.Cos(m_time * 1f);
float z = TranslationDistance.z * Mathf.Sin(m_time); float z = 0f; // *Mathf.Sin(m_time * .9f);
m_transform.position = m_initial_Position + new Vector3(x, z, y); m_transform.position = m_initial_Position + new Vector3(x, z, y);
// Drawing light patterns because they can be cool looking. // Drawing light patterns because they can be cool looking.
//if (Time.frameCount > 1) //if (frames > 2)
// Debug.DrawLine(m_transform.position, m_prevPOS, m_lightColor, 100f); // Debug.DrawLine(m_transform.position, m_prevPOS, m_lightColor, 100f);
m_prevPOS = m_transform.position; m_prevPOS = m_transform.position;
break; frames += 1;
} }
} }
} }

View File

@ -4,7 +4,7 @@ using System.Collections;
namespace TMPro.Examples namespace TMPro.Examples
{ {
public class SimpleScript : MonoBehaviour public class SimpleScript : MonoBehaviour
{ {
@ -29,12 +29,12 @@ namespace TMPro.Examples
// Assign Material to TextMesh Pro Component // Assign Material to TextMesh Pro Component
//m_textMeshPro.fontSharedMaterial = Resources.Load("Fonts & Materials/LiberationSans SDF - Bevel", typeof(Material)) as Material; //m_textMeshPro.fontSharedMaterial = Resources.Load("Fonts & Materials/LiberationSans SDF - Bevel", typeof(Material)) as Material;
//m_textMeshPro.fontSharedMaterial.EnableKeyword("BEVEL_ON"); //m_textMeshPro.fontSharedMaterial.EnableKeyword("BEVEL_ON");
// Set various font settings. // Set various font settings.
m_textMeshPro.fontSize = 48; m_textMeshPro.fontSize = 48;
m_textMeshPro.alignment = TextAlignmentOptions.Center; m_textMeshPro.alignment = TextAlignmentOptions.Center;
//m_textMeshPro.anchorDampening = true; // Has been deprecated but under consideration for re-implementation. //m_textMeshPro.anchorDampening = true; // Has been deprecated but under consideration for re-implementation.
//m_textMeshPro.enableAutoSizing = true; //m_textMeshPro.enableAutoSizing = true;
@ -42,7 +42,7 @@ namespace TMPro.Examples
//m_textMeshPro.wordSpacing = 0.1f; //m_textMeshPro.wordSpacing = 0.1f;
//m_textMeshPro.enableCulling = true; //m_textMeshPro.enableCulling = true;
m_textMeshPro.textWrappingMode = TextWrappingModes.NoWrap; m_textMeshPro.enableWordWrapping = false;
//textMeshPro.fontColor = new Color32(255, 255, 255, 255); //textMeshPro.fontColor = new Color32(255, 255, 255, 255);
} }

View File

@ -4,7 +4,7 @@ using System.Collections;
namespace TMPro.Examples namespace TMPro.Examples
{ {
public class TMP_FrameRateCounter : MonoBehaviour public class TMP_FrameRateCounter : MonoBehaviour
{ {
public float UpdateInterval = 5.0f; public float UpdateInterval = 5.0f;
@ -43,7 +43,7 @@ namespace TMPro.Examples
m_frameCounter_transform.SetParent(m_camera.transform); m_frameCounter_transform.SetParent(m_camera.transform);
m_frameCounter_transform.localRotation = Quaternion.identity; m_frameCounter_transform.localRotation = Quaternion.identity;
m_TextMeshPro.textWrappingMode = TextWrappingModes.NoWrap; m_TextMeshPro.enableWordWrapping = false;
m_TextMeshPro.fontSize = 24; m_TextMeshPro.fontSize = 24;
//m_TextMeshPro.FontColor = new Color32(255, 255, 255, 128); //m_TextMeshPro.FontColor = new Color32(255, 255, 255, 128);
//m_TextMeshPro.edgeWidth = .15f; //m_TextMeshPro.edgeWidth = .15f;

View File

@ -41,22 +41,22 @@ namespace TMPro.Examples
void OnCharacterSelection(char c, int index) void OnCharacterSelection(char c, int index)
{ {
//Debug.Log("Character [" + c + "] at Index: " + index + " has been selected."); Debug.Log("Character [" + c + "] at Index: " + index + " has been selected.");
} }
void OnSpriteSelection(char c, int index) void OnSpriteSelection(char c, int index)
{ {
//Debug.Log("Sprite [" + c + "] at Index: " + index + " has been selected."); Debug.Log("Sprite [" + c + "] at Index: " + index + " has been selected.");
} }
void OnWordSelection(string word, int firstCharacterIndex, int length) void OnWordSelection(string word, int firstCharacterIndex, int length)
{ {
//Debug.Log("Word [" + word + "] with first character index of " + firstCharacterIndex + " and length of " + length + " has been selected."); Debug.Log("Word [" + word + "] with first character index of " + firstCharacterIndex + " and length of " + length + " has been selected.");
} }
void OnLineSelection(string lineText, int firstCharacterIndex, int length) void OnLineSelection(string lineText, int firstCharacterIndex, int length)
{ {
//Debug.Log("Line [" + lineText + "] with first character index of " + firstCharacterIndex + " and length of " + length + " has been selected."); Debug.Log("Line [" + lineText + "] with first character index of " + firstCharacterIndex + " and length of " + length + " has been selected.");
} }
void OnLinkSelection(string linkID, string linkText, int linkIndex) void OnLinkSelection(string linkID, string linkText, int linkIndex)
@ -66,7 +66,7 @@ namespace TMPro.Examples
TMP_LinkInfo linkInfo = m_TextComponent.textInfo.linkInfo[linkIndex]; TMP_LinkInfo linkInfo = m_TextComponent.textInfo.linkInfo[linkIndex];
} }
//Debug.Log("Link Index: " + linkIndex + " with ID [" + linkID + "] and Text \"" + linkText + "\" has been selected."); Debug.Log("Link Index: " + linkIndex + " with ID [" + linkID + "] and Text \"" + linkText + "\" has been selected.");
} }
} }

View File

@ -124,15 +124,6 @@ namespace TMPro
{ {
if (TMP_TextUtilities.IsIntersectingRectTransform(m_TextComponent.rectTransform, Input.mousePosition, m_Camera)) if (TMP_TextUtilities.IsIntersectingRectTransform(m_TextComponent.rectTransform, Input.mousePosition, m_Camera))
{ {
#region Nearest Character
/*int charIndex = TMP_TextUtilities.FindNearestCharacterOnLine(m_TextComponent, Input.mousePosition, 0, m_Camera, false);
if (charIndex != -1 && charIndex != m_lastCharIndex)
{
m_lastCharIndex = charIndex;
}*/
#endregion
#region Example of Character or Sprite Selection #region Example of Character or Sprite Selection
int charIndex = TMP_TextUtilities.FindIntersectingCharacter(m_TextComponent, Input.mousePosition, m_Camera, true); int charIndex = TMP_TextUtilities.FindIntersectingCharacter(m_TextComponent, Input.mousePosition, m_Camera, true);
if (charIndex != -1 && charIndex != m_lastCharIndex) if (charIndex != -1 && charIndex != m_lastCharIndex)

View File

@ -10,6 +10,7 @@ namespace TMPro.Examples
public class TMP_TextInfoDebugTool : MonoBehaviour public class TMP_TextInfoDebugTool : MonoBehaviour
{ {
// Since this script is used for debugging, we exclude it from builds. // Since this script is used for debugging, we exclude it from builds.
// TODO: Rework this script to make it into an editor utility.
#if UNITY_EDITOR #if UNITY_EDITOR
public bool ShowCharacters; public bool ShowCharacters;
public bool ShowWords; public bool ShowWords;

View File

@ -142,14 +142,14 @@ namespace TMPro.Examples
public void OnPointerEnter(PointerEventData eventData) public void OnPointerEnter(PointerEventData eventData)
{ {
//Debug.Log("OnPointerEnter()"); Debug.Log("OnPointerEnter()");
m_isHoveringObject = true; m_isHoveringObject = true;
} }
public void OnPointerExit(PointerEventData eventData) public void OnPointerExit(PointerEventData eventData)
{ {
//Debug.Log("OnPointerExit()"); Debug.Log("OnPointerExit()");
m_isHoveringObject = false; m_isHoveringObject = false;
} }

View File

@ -158,7 +158,7 @@ namespace TMPro.Examples
// We do this to make sure this character is rendered last and over other characters. // We do this to make sure this character is rendered last and over other characters.
meshInfo.SwapVertexData(vertexIndex, lastVertexIndex); meshInfo.SwapVertexData(vertexIndex, lastVertexIndex);
// Need to update the appropriate // Need to update the appropriate
m_TextMeshPro.UpdateVertexData(TMP_VertexDataUpdateFlags.All); m_TextMeshPro.UpdateVertexData(TMP_VertexDataUpdateFlags.All);
} }
#endregion #endregion
@ -286,7 +286,7 @@ namespace TMPro.Examples
m_lastIndex = -1; m_lastIndex = -1;
} }
} }
} }
@ -491,8 +491,8 @@ namespace TMPro.Examples
// Restore UV0S // Restore UV0S
// UVS0 // UVS0
Vector4[] src_uv0s = m_cachedMeshInfoVertexData[materialIndex].uvs0; Vector2[] src_uv0s = m_cachedMeshInfoVertexData[materialIndex].uvs0;
Vector4[] dst_uv0s = m_TextMeshPro.textInfo.meshInfo[materialIndex].uvs0; Vector2[] dst_uv0s = m_TextMeshPro.textInfo.meshInfo[materialIndex].uvs0;
dst_uv0s[vertexIndex + 0] = src_uv0s[vertexIndex + 0]; dst_uv0s[vertexIndex + 0] = src_uv0s[vertexIndex + 0];
dst_uv0s[vertexIndex + 1] = src_uv0s[vertexIndex + 1]; dst_uv0s[vertexIndex + 1] = src_uv0s[vertexIndex + 1];
dst_uv0s[vertexIndex + 2] = src_uv0s[vertexIndex + 2]; dst_uv0s[vertexIndex + 2] = src_uv0s[vertexIndex + 2];
@ -540,7 +540,7 @@ namespace TMPro.Examples
dst_uv2s[lastIndex + 2] = src_uv2s[lastIndex + 2]; dst_uv2s[lastIndex + 2] = src_uv2s[lastIndex + 2];
dst_uv2s[lastIndex + 3] = src_uv2s[lastIndex + 3]; dst_uv2s[lastIndex + 3] = src_uv2s[lastIndex + 3];
// Need to update the appropriate // Need to update the appropriate
m_TextMeshPro.UpdateVertexData(TMP_VertexDataUpdateFlags.All); m_TextMeshPro.UpdateVertexData(TMP_VertexDataUpdateFlags.All);
} }
} }

View File

@ -4,7 +4,7 @@ using System.Collections;
namespace TMPro.Examples namespace TMPro.Examples
{ {
public class TMP_UiFrameRateCounter : MonoBehaviour public class TMP_UiFrameRateCounter : MonoBehaviour
{ {
public float UpdateInterval = 5.0f; public float UpdateInterval = 5.0f;
@ -39,7 +39,7 @@ namespace TMPro.Examples
m_TextMeshPro.font = Resources.Load<TMP_FontAsset>("Fonts & Materials/LiberationSans SDF"); m_TextMeshPro.font = Resources.Load<TMP_FontAsset>("Fonts & Materials/LiberationSans SDF");
m_TextMeshPro.fontSharedMaterial = Resources.Load<Material>("Fonts & Materials/LiberationSans SDF - Overlay"); m_TextMeshPro.fontSharedMaterial = Resources.Load<Material>("Fonts & Materials/LiberationSans SDF - Overlay");
m_TextMeshPro.textWrappingMode = TextWrappingModes.NoWrap; m_TextMeshPro.enableWordWrapping = false;
m_TextMeshPro.fontSize = 36; m_TextMeshPro.fontSize = 36;
m_TextMeshPro.isOverlay = true; m_TextMeshPro.isOverlay = true;

View File

@ -4,7 +4,7 @@ using System.Collections;
namespace TMPro.Examples namespace TMPro.Examples
{ {
public class TeleType : MonoBehaviour public class TeleType : MonoBehaviour
{ {
@ -24,7 +24,7 @@ namespace TMPro.Examples
// Get Reference to TextMeshPro Component // Get Reference to TextMeshPro Component
m_textMeshPro = GetComponent<TMP_Text>(); m_textMeshPro = GetComponent<TMP_Text>();
m_textMeshPro.text = label01; m_textMeshPro.text = label01;
m_textMeshPro.textWrappingMode = TextWrappingModes.Normal; m_textMeshPro.enableWordWrapping = true;
m_textMeshPro.alignment = TextAlignmentOptions.Top; m_textMeshPro.alignment = TextAlignmentOptions.Top;

View File

@ -65,7 +65,7 @@ namespace TMPro.Examples
m_textMeshPro.fontSize = 24; m_textMeshPro.fontSize = 24;
//m_textMeshPro.enableExtraPadding = true; //m_textMeshPro.enableExtraPadding = true;
//m_textMeshPro.enableShadows = false; //m_textMeshPro.enableShadows = false;
m_textMeshPro.fontFeatures.Clear(); m_textMeshPro.enableKerning = false;
m_textMeshPro.text = string.Empty; m_textMeshPro.text = string.Empty;
m_textMeshPro.isTextObjectScaleStatic = IsTextObjectScaleStatic; m_textMeshPro.isTextObjectScaleStatic = IsTextObjectScaleStatic;

View File

@ -71,7 +71,7 @@ namespace TMPro.Examples
while (true) while (true)
{ {
// Allocate new vertices // Allocate new vertices
if (hasTextChanged) if (hasTextChanged)
{ {
// Get updated vertex data // Get updated vertex data
@ -130,7 +130,7 @@ namespace TMPro.Examples
// Determine the random scale change for each character. // Determine the random scale change for each character.
float randomScale = Random.Range(1f, 1.5f); float randomScale = Random.Range(1f, 1.5f);
// Add modified scale and index // Add modified scale and index
modifiedCharScale.Add(randomScale); modifiedCharScale.Add(randomScale);
scaleSortingOrder.Add(modifiedCharScale.Count - 1); scaleSortingOrder.Add(modifiedCharScale.Count - 1);
@ -150,8 +150,8 @@ namespace TMPro.Examples
destinationVertices[vertexIndex + 3] += offset; destinationVertices[vertexIndex + 3] += offset;
// Restore Source UVS which have been modified by the sorting // Restore Source UVS which have been modified by the sorting
Vector4[] sourceUVs0 = cachedMeshInfoVertexData[materialIndex].uvs0; Vector2[] sourceUVs0 = cachedMeshInfoVertexData[materialIndex].uvs0;
Vector4[] destinationUVs0 = textInfo.meshInfo[materialIndex].uvs0; Vector2[] destinationUVs0 = textInfo.meshInfo[materialIndex].uvs0;
destinationUVs0[vertexIndex + 0] = sourceUVs0[vertexIndex + 0]; destinationUVs0[vertexIndex + 0] = sourceUVs0[vertexIndex + 0];
destinationUVs0[vertexIndex + 1] = sourceUVs0[vertexIndex + 1]; destinationUVs0[vertexIndex + 1] = sourceUVs0[vertexIndex + 1];
@ -178,7 +178,7 @@ namespace TMPro.Examples
// Updated modified vertex attributes // Updated modified vertex attributes
textInfo.meshInfo[i].mesh.vertices = textInfo.meshInfo[i].vertices; textInfo.meshInfo[i].mesh.vertices = textInfo.meshInfo[i].vertices;
textInfo.meshInfo[i].mesh.SetUVs(0, textInfo.meshInfo[i].uvs0); textInfo.meshInfo[i].mesh.uv = textInfo.meshInfo[i].uvs0;
textInfo.meshInfo[i].mesh.colors32 = textInfo.meshInfo[i].colors32; textInfo.meshInfo[i].mesh.colors32 = textInfo.meshInfo[i].colors32;
m_TextComponent.UpdateGeometry(textInfo.meshInfo[i].mesh, i); m_TextComponent.UpdateGeometry(textInfo.meshInfo[i].mesh, i);

File diff suppressed because one or more lines are too long

View File

@ -3,9 +3,8 @@
--- !u!114 &11400000 --- !u!114 &11400000
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0} m_GameObject: {fileID: 0}
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
@ -13,12 +12,6 @@ MonoBehaviour:
m_Name: Default Style Sheet m_Name: Default Style Sheet
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_StyleList: m_StyleList:
- m_Name: Normal
m_HashCode: -1183493901
m_OpeningDefinition:
m_ClosingDefinition:
m_OpeningTagArray:
m_ClosingTagArray:
- m_Name: H1 - m_Name: H1
m_HashCode: 2425 m_HashCode: 2425
m_OpeningDefinition: <size=2em><b><#40ff80>* m_OpeningDefinition: <size=2em><b><#40ff80>*
@ -26,25 +19,19 @@ MonoBehaviour:
m_OpeningTagArray: 3c00000073000000690000007a000000650000003d00000032000000650000006d0000003e0000003c000000620000003e0000003c000000230000003400000030000000660000006600000038000000300000003e0000002a000000 m_OpeningTagArray: 3c00000073000000690000007a000000650000003d00000032000000650000006d0000003e0000003c000000620000003e0000003c000000230000003400000030000000660000006600000038000000300000003e0000002a000000
m_ClosingTagArray: 2a0000003c0000002f00000073000000690000007a000000650000003e0000003c0000002f000000620000003e0000003c0000002f000000630000006f0000006c0000006f000000720000003e000000 m_ClosingTagArray: 2a0000003c0000002f00000073000000690000007a000000650000003e0000003c0000002f000000620000003e0000003c0000002f000000630000006f0000006c0000006f000000720000003e000000
- m_Name: Quote - m_Name: Quote
m_HashCode: 93368250 m_HashCode: 92254330
m_OpeningDefinition: <i><size=75%><margin=10%> m_OpeningDefinition: <i><size=75%><margin=10%>
m_ClosingDefinition: </i></size></width></margin> m_ClosingDefinition: </i></size></width></margin>
m_OpeningTagArray: 3c000000690000003e0000003c00000073000000690000007a000000650000003d0000003700000035000000250000003e0000003c0000006d000000610000007200000067000000690000006e0000003d0000003100000030000000250000003e000000 m_OpeningTagArray: 3c000000690000003e0000003c00000073000000690000007a000000650000003d0000003700000035000000250000003e0000003c0000006d000000610000007200000067000000690000006e0000003d0000003100000030000000250000003e000000
m_ClosingTagArray: 3c0000002f000000690000003e0000003c0000002f00000073000000690000007a000000650000003e0000003c0000002f00000077000000690000006400000074000000680000003e0000003c0000002f0000006d000000610000007200000067000000690000006e0000003e000000 m_ClosingTagArray: 3c0000002f000000690000003e0000003c0000002f00000073000000690000007a000000650000003e0000003c0000002f00000077000000690000006400000074000000680000003e0000003c0000002f0000006d000000610000007200000067000000690000006e0000003e000000
- m_Name: A
m_HashCode: 65
m_OpeningDefinition: <color=#40a0ff><u>
m_ClosingDefinition: </u></color>
m_OpeningTagArray: 3c000000630000006f0000006c0000006f000000720000003d000000230000003400000030000000610000003000000066000000660000003e0000003c000000750000003e000000
m_ClosingTagArray: 3c0000002f000000750000003e0000003c0000002f000000630000006f0000006c0000006f000000720000003e000000
- m_Name: Link - m_Name: Link
m_HashCode: 2656128 m_HashCode: 2687968
m_OpeningDefinition: <u><#40a0ff><link="ID_01"> m_OpeningDefinition: <u><#40a0ff><link="ID_01">
m_ClosingDefinition: </u></color></link> m_ClosingDefinition: </u></color></link>
m_OpeningTagArray: 3c000000750000003e0000003c000000230000003400000030000000610000003000000066000000660000003e0000003c0000006c000000690000006e0000006b0000003d0000002200000049000000440000005f0000003000000031000000220000003e000000 m_OpeningTagArray: 3c000000750000003e0000003c000000230000003400000030000000610000003000000066000000660000003e0000003c0000006c000000690000006e0000006b0000003d0000002200000049000000440000005f0000003000000031000000220000003e000000
m_ClosingTagArray: 3c0000002f000000750000003e0000003c0000002f000000630000006f0000006c0000006f000000720000003e0000003c0000002f0000006c000000690000006e0000006b0000003e000000 m_ClosingTagArray: 3c0000002f000000750000003e0000003c0000002f000000630000006f0000006c0000006f000000720000003e0000003c0000002f0000006c000000690000006e0000006b0000003e000000
- m_Name: Title - m_Name: Title
m_HashCode: 97690656 m_HashCode: 98732960
m_OpeningDefinition: <size=125%><b><align=center> m_OpeningDefinition: <size=125%><b><align=center>
m_ClosingDefinition: </size></b></align> m_ClosingDefinition: </size></b></align>
m_OpeningTagArray: 3c00000073000000690000007a000000650000003d000000310000003200000035000000250000003e0000003c000000620000003e0000003c000000610000006c00000069000000670000006e0000003d00000063000000650000006e0000007400000065000000720000003e000000 m_OpeningTagArray: 3c00000073000000690000007a000000650000003d000000310000003200000035000000250000003e0000003c000000620000003e0000003c000000610000006c00000069000000670000006e0000003d00000063000000650000006e0000007400000065000000720000003e000000

View File

@ -12,17 +12,14 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 2705215ac5b84b70bacc50632be6e391, type: 3} m_Script: {fileID: 11500000, guid: 2705215ac5b84b70bacc50632be6e391, type: 3}
m_Name: TMP Settings m_Name: TMP Settings
m_EditorClassIdentifier: m_EditorClassIdentifier:
assetVersion: 2 m_enableWordWrapping: 1
m_TextWrappingMode: 1
m_enableKerning: 1 m_enableKerning: 1
m_ActiveFontFeatures: 00000000
m_enableExtraPadding: 0 m_enableExtraPadding: 0
m_enableTintAllSprites: 0 m_enableTintAllSprites: 0
m_enableParseEscapeCharacters: 1 m_enableParseEscapeCharacters: 1
m_EnableRaycastTarget: 1 m_EnableRaycastTarget: 1
m_GetFontFeaturesAtRuntime: 1 m_GetFontFeaturesAtRuntime: 1
m_missingGlyphCharacter: 0 m_missingGlyphCharacter: 0
m_ClearDynamicDataOnBuild: 1
m_warningsDisabled: 0 m_warningsDisabled: 0
m_defaultFontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_defaultFontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_defaultFontAssetPath: Fonts & Materials/ m_defaultFontAssetPath: Fonts & Materials/
@ -32,16 +29,13 @@ MonoBehaviour:
m_defaultTextMeshProTextContainerSize: {x: 20, y: 5} m_defaultTextMeshProTextContainerSize: {x: 20, y: 5}
m_defaultTextMeshProUITextContainerSize: {x: 200, y: 50} m_defaultTextMeshProUITextContainerSize: {x: 200, y: 50}
m_autoSizeTextContainer: 0 m_autoSizeTextContainer: 0
m_IsTextObjectScaleStatic: 0
m_fallbackFontAssets: [] m_fallbackFontAssets: []
m_matchMaterialPreset: 1 m_matchMaterialPreset: 1
m_HideSubTextObjects: 0
m_defaultSpriteAsset: {fileID: 11400000, guid: c41005c129ba4d66911b75229fd70b45, m_defaultSpriteAsset: {fileID: 11400000, guid: c41005c129ba4d66911b75229fd70b45,
type: 2} type: 2}
m_defaultSpriteAssetPath: Sprite Assets/ m_defaultSpriteAssetPath: Sprite Assets/
m_enableEmojiSupport: 1 m_enableEmojiSupport: 1
m_MissingCharacterSpriteUnicode: 0 m_MissingCharacterSpriteUnicode: 0
m_EmojiFallbackTextAssets: []
m_defaultColorGradientPresetsPath: Color Gradient Presets/ m_defaultColorGradientPresetsPath: Color Gradient Presets/
m_defaultStyleSheet: {fileID: 11400000, guid: f952c082cb03451daed3ee968ac6c63e, m_defaultStyleSheet: {fileID: 11400000, guid: f952c082cb03451daed3ee968ac6c63e,
type: 2} type: 2}

View File

@ -1,26 +1,26 @@
Shader "TextMeshPro/Bitmap Custom Atlas" { Shader "TextMeshPro/Bitmap Custom Atlas" {
Properties { Properties {
_MainTex ("Font Atlas", 2D) = "white" {} _MainTex ("Font Atlas", 2D) = "white" {}
_FaceTex ("Font Texture", 2D) = "white" {} _FaceTex ("Font Texture", 2D) = "white" {}
_FaceColor ("Text Color", Color) = (1,1,1,1) [HDR]_FaceColor ("Text Color", Color) = (1,1,1,1)
_VertexOffsetX ("Vertex OffsetX", float) = 0 _VertexOffsetX ("Vertex OffsetX", float) = 0
_VertexOffsetY ("Vertex OffsetY", float) = 0 _VertexOffsetY ("Vertex OffsetY", float) = 0
_MaskSoftnessX ("Mask SoftnessX", float) = 0 _MaskSoftnessX ("Mask SoftnessX", float) = 0
_MaskSoftnessY ("Mask SoftnessY", float) = 0 _MaskSoftnessY ("Mask SoftnessY", float) = 0
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767) _ClipRect("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
_Padding ("Padding", float) = 0 _Padding ("Padding", float) = 0
_StencilComp ("Stencil Comparison", Float) = 8 _StencilComp("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0 _Stencil("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0 _StencilOp("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255 _StencilWriteMask("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255 _StencilReadMask("Stencil Read Mask", Float) = 255
_CullMode ("Cull Mode", Float) = 0 _CullMode("Cull Mode", Float) = 0
_ColorMask ("Color Mask", Float) = 15 _ColorMask("Color Mask", Float) = 15
} }
SubShader{ SubShader{
@ -55,18 +55,15 @@ SubShader{
#include "UnityCG.cginc" #include "UnityCG.cginc"
#include "UnityUI.cginc"
struct appdata_t struct appdata_t {
{
float4 vertex : POSITION; float4 vertex : POSITION;
fixed4 color : COLOR; fixed4 color : COLOR;
float4 texcoord0 : TEXCOORD0; float2 texcoord0 : TEXCOORD0;
float2 texcoord1 : TEXCOORD1; float2 texcoord1 : TEXCOORD1;
}; };
struct v2f struct v2f {
{
float4 vertex : SV_POSITION; float4 vertex : SV_POSITION;
fixed4 color : COLOR; fixed4 color : COLOR;
float2 texcoord0 : TEXCOORD0; float2 texcoord0 : TEXCOORD0;
@ -84,9 +81,15 @@ SubShader{
uniform float4 _ClipRect; uniform float4 _ClipRect;
uniform float _MaskSoftnessX; uniform float _MaskSoftnessX;
uniform float _MaskSoftnessY; uniform float _MaskSoftnessY;
uniform float _UIMaskSoftnessX;
uniform float _UIMaskSoftnessY; float2 UnpackUV(float uv)
uniform int _UIVertexColorAlwaysGammaSpace; {
float2 output;
output.x = floor(uv / 4096);
output.y = uv - 4096 * output.x;
return output * 0.001953125;
}
v2f vert (appdata_t v) v2f vert (appdata_t v)
{ {
@ -98,10 +101,6 @@ SubShader{
float4 vPosition = UnityPixelSnap(UnityObjectToClipPos(vert)); float4 vPosition = UnityPixelSnap(UnityObjectToClipPos(vert));
if (_UIVertexColorAlwaysGammaSpace && !IsGammaSpace())
{
v.color.rgb = UIGammaToLinear(v.color.rgb);
}
fixed4 faceColor = v.color; fixed4 faceColor = v.color;
faceColor *= _FaceColor; faceColor *= _FaceColor;
@ -109,14 +108,13 @@ SubShader{
OUT.vertex = vPosition; OUT.vertex = vPosition;
OUT.color = faceColor; OUT.color = faceColor;
OUT.texcoord0 = v.texcoord0; OUT.texcoord0 = v.texcoord0;
OUT.texcoord1 = TRANSFORM_TEX(v.texcoord1, _FaceTex); OUT.texcoord1 = TRANSFORM_TEX(UnpackUV(v.texcoord1), _FaceTex);
float2 pixelSize = vPosition.w; float2 pixelSize = vPosition.w;
pixelSize /= abs(float2(_ScreenParams.x * UNITY_MATRIX_P[0][0], _ScreenParams.y * UNITY_MATRIX_P[1][1])); pixelSize /= abs(float2(_ScreenParams.x * UNITY_MATRIX_P[0][0], _ScreenParams.y * UNITY_MATRIX_P[1][1]));
// Clamp _ClipRect to 16bit. // Clamp _ClipRect to 16bit.
const float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); float4 clampedRect = clamp(_ClipRect, -2e10, 2e10);
const half2 maskSoftness = half2(max(_UIMaskSoftnessX, _MaskSoftnessX), max(_UIMaskSoftnessY, _MaskSoftnessY)); OUT.mask = float4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy));
OUT.mask = float4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * maskSoftness + pixelSize.xy));
return OUT; return OUT;
} }

View File

@ -1,25 +1,25 @@
Shader "TextMeshPro/Mobile/Bitmap" { Shader "TextMeshPro/Mobile/Bitmap" {
Properties { Properties {
_MainTex ("Font Atlas", 2D) = "white" {} _MainTex ("Font Atlas", 2D) = "white" {}
_Color ("Text Color", Color) = (1,1,1,1) [HDR]_Color ("Text Color", Color) = (1,1,1,1)
_DiffusePower ("Diffuse Power", Range(1.0,4.0)) = 1.0 _DiffusePower ("Diffuse Power", Range(1.0,4.0)) = 1.0
_VertexOffsetX ("Vertex OffsetX", float) = 0 _VertexOffsetX("Vertex OffsetX", float) = 0
_VertexOffsetY ("Vertex OffsetY", float) = 0 _VertexOffsetY("Vertex OffsetY", float) = 0
_MaskSoftnessX ("Mask SoftnessX", float) = 0 _MaskSoftnessX("Mask SoftnessX", float) = 0
_MaskSoftnessY ("Mask SoftnessY", float) = 0 _MaskSoftnessY("Mask SoftnessY", float) = 0
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767) _ClipRect("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
_StencilComp ("Stencil Comparison", Float) = 8 _StencilComp("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0 _Stencil("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0 _StencilOp("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255 _StencilWriteMask("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255 _StencilReadMask("Stencil Read Mask", Float) = 255
_CullMode ("Cull Mode", Float) = 0 _CullMode("Cull Mode", Float) = 0
_ColorMask ("Color Mask", Float) = 15 _ColorMask("Color Mask", Float) = 15
} }
SubShader { SubShader {
@ -55,18 +55,15 @@ SubShader {
#include "UnityCG.cginc" #include "UnityCG.cginc"
#include "UnityUI.cginc"
struct appdata_t struct appdata_t {
{
float4 vertex : POSITION; float4 vertex : POSITION;
fixed4 color : COLOR; fixed4 color : COLOR;
float2 texcoord0 : TEXCOORD0; float2 texcoord0 : TEXCOORD0;
float2 texcoord1 : TEXCOORD1; float2 texcoord1 : TEXCOORD1;
}; };
struct v2f struct v2f {
{
float4 vertex : POSITION; float4 vertex : POSITION;
fixed4 color : COLOR; fixed4 color : COLOR;
float2 texcoord0 : TEXCOORD0; float2 texcoord0 : TEXCOORD0;
@ -82,9 +79,6 @@ SubShader {
uniform float4 _ClipRect; uniform float4 _ClipRect;
uniform float _MaskSoftnessX; uniform float _MaskSoftnessX;
uniform float _MaskSoftnessY; uniform float _MaskSoftnessY;
uniform float _UIMaskSoftnessX;
uniform float _UIMaskSoftnessY;
uniform int _UIVertexColorAlwaysGammaSpace;
v2f vert (appdata_t v) v2f vert (appdata_t v)
{ {
@ -94,11 +88,8 @@ SubShader {
vert.y += _VertexOffsetY; vert.y += _VertexOffsetY;
vert.xy += (vert.w * 0.5) / _ScreenParams.xy; vert.xy += (vert.w * 0.5) / _ScreenParams.xy;
if (_UIVertexColorAlwaysGammaSpace && !IsGammaSpace())
{ OUT.vertex = UnityPixelSnap(UnityObjectToClipPos(vert));
v.color.rgb = UIGammaToLinear(v.color.rgb);
}
OUT.vertex = UnityPixelSnap(UnityObjectToClipPos(vert));
OUT.color = v.color; OUT.color = v.color;
OUT.color *= _Color; OUT.color *= _Color;
OUT.color.rgb *= _DiffusePower; OUT.color.rgb *= _DiffusePower;
@ -108,9 +99,8 @@ SubShader {
//pixelSize /= abs(float2(_ScreenParams.x * UNITY_MATRIX_P[0][0], _ScreenParams.y * UNITY_MATRIX_P[1][1])); //pixelSize /= abs(float2(_ScreenParams.x * UNITY_MATRIX_P[0][0], _ScreenParams.y * UNITY_MATRIX_P[1][1]));
// Clamp _ClipRect to 16bit. // Clamp _ClipRect to 16bit.
const float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); float4 clampedRect = clamp(_ClipRect, -2e10, 2e10);
const half2 maskSoftness = half2(max(_UIMaskSoftnessX, _MaskSoftnessX), max(_UIMaskSoftnessY, _MaskSoftnessY)); OUT.mask = float4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy));
OUT.mask = float4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * maskSoftness + pixelSize.xy));
return OUT; return OUT;
} }

View File

@ -1,25 +1,25 @@
Shader "TextMeshPro/Bitmap" { Shader "TextMeshPro/Bitmap" {
Properties { Properties {
_MainTex ("Font Atlas", 2D) = "white" {} _MainTex ("Font Atlas", 2D) = "white" {}
_FaceTex ("Font Texture", 2D) = "white" {} _FaceTex ("Font Texture", 2D) = "white" {}
_FaceColor ("Text Color", Color) = (1,1,1,1) [HDR]_FaceColor ("Text Color", Color) = (1,1,1,1)
_VertexOffsetX ("Vertex OffsetX", float) = 0 _VertexOffsetX ("Vertex OffsetX", float) = 0
_VertexOffsetY ("Vertex OffsetY", float) = 0 _VertexOffsetY ("Vertex OffsetY", float) = 0
_MaskSoftnessX ("Mask SoftnessX", float) = 0 _MaskSoftnessX ("Mask SoftnessX", float) = 0
_MaskSoftnessY ("Mask SoftnessY", float) = 0 _MaskSoftnessY ("Mask SoftnessY", float) = 0
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767) _ClipRect("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
_StencilComp ("Stencil Comparison", Float) = 8 _StencilComp("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0 _Stencil("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0 _StencilOp("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255 _StencilWriteMask("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255 _StencilReadMask("Stencil Read Mask", Float) = 255
_CullMode ("Cull Mode", Float) = 0 _CullMode("Cull Mode", Float) = 0
_ColorMask ("Color Mask", Float) = 15 _ColorMask("Color Mask", Float) = 15
} }
SubShader{ SubShader{
@ -54,18 +54,15 @@ SubShader{
#include "UnityCG.cginc" #include "UnityCG.cginc"
#include "UnityUI.cginc"
struct appdata_t struct appdata_t {
{
float4 vertex : POSITION; float4 vertex : POSITION;
fixed4 color : COLOR; fixed4 color : COLOR;
float4 texcoord0 : TEXCOORD0; float2 texcoord0 : TEXCOORD0;
float2 texcoord1 : TEXCOORD1; float2 texcoord1 : TEXCOORD1;
}; };
struct v2f struct v2f {
{
float4 vertex : SV_POSITION; float4 vertex : SV_POSITION;
fixed4 color : COLOR; fixed4 color : COLOR;
float2 texcoord0 : TEXCOORD0; float2 texcoord0 : TEXCOORD0;
@ -83,9 +80,15 @@ SubShader{
uniform float4 _ClipRect; uniform float4 _ClipRect;
uniform float _MaskSoftnessX; uniform float _MaskSoftnessX;
uniform float _MaskSoftnessY; uniform float _MaskSoftnessY;
uniform float _UIMaskSoftnessX;
uniform float _UIMaskSoftnessY; float2 UnpackUV(float uv)
uniform int _UIVertexColorAlwaysGammaSpace; {
float2 output;
output.x = floor(uv / 4096);
output.y = uv - 4096 * output.x;
return output * 0.001953125;
}
v2f vert (appdata_t v) v2f vert (appdata_t v)
{ {
@ -97,10 +100,6 @@ SubShader{
float4 vPosition = UnityPixelSnap(UnityObjectToClipPos(vert)); float4 vPosition = UnityPixelSnap(UnityObjectToClipPos(vert));
if (_UIVertexColorAlwaysGammaSpace && !IsGammaSpace())
{
v.color.rgb = UIGammaToLinear(v.color.rgb);
}
fixed4 faceColor = v.color; fixed4 faceColor = v.color;
faceColor *= _FaceColor; faceColor *= _FaceColor;
@ -108,14 +107,13 @@ SubShader{
OUT.vertex = vPosition; OUT.vertex = vPosition;
OUT.color = faceColor; OUT.color = faceColor;
OUT.texcoord0 = v.texcoord0; OUT.texcoord0 = v.texcoord0;
OUT.texcoord1 = TRANSFORM_TEX(v.texcoord1, _FaceTex); OUT.texcoord1 = TRANSFORM_TEX(UnpackUV(v.texcoord1), _FaceTex);
float2 pixelSize = vPosition.w; float2 pixelSize = vPosition.w;
pixelSize /= abs(float2(_ScreenParams.x * UNITY_MATRIX_P[0][0], _ScreenParams.y * UNITY_MATRIX_P[1][1])); pixelSize /= abs(float2(_ScreenParams.x * UNITY_MATRIX_P[0][0], _ScreenParams.y * UNITY_MATRIX_P[1][1]));
// Clamp _ClipRect to 16bit. // Clamp _ClipRect to 16bit.
const float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); float4 clampedRect = clamp(_ClipRect, -2e10, 2e10);
const half2 maskSoftness = half2(max(_UIMaskSoftnessX, _MaskSoftnessX), max(_UIMaskSoftnessY, _MaskSoftnessY)); OUT.mask = float4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy));
OUT.mask = float4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * maskSoftness + pixelSize.xy));
return OUT; return OUT;
} }

View File

@ -4,10 +4,10 @@ Properties {
_FaceTex ("Face Texture", 2D) = "white" {} _FaceTex ("Face Texture", 2D) = "white" {}
_FaceUVSpeedX ("Face UV Speed X", Range(-5, 5)) = 0.0 _FaceUVSpeedX ("Face UV Speed X", Range(-5, 5)) = 0.0
_FaceUVSpeedY ("Face UV Speed Y", Range(-5, 5)) = 0.0 _FaceUVSpeedY ("Face UV Speed Y", Range(-5, 5)) = 0.0
_FaceColor ("Face Color", Color) = (1,1,1,1) [HDR]_FaceColor ("Face Color", Color) = (1,1,1,1)
_FaceDilate ("Face Dilate", Range(-1,1)) = 0 _FaceDilate ("Face Dilate", Range(-1,1)) = 0
_OutlineColor ("Outline Color", Color) = (0,0,0,1) [HDR]_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_OutlineTex ("Outline Texture", 2D) = "white" {} _OutlineTex ("Outline Texture", 2D) = "white" {}
_OutlineUVSpeedX ("Outline UV Speed X", Range(-5, 5)) = 0.0 _OutlineUVSpeedX ("Outline UV Speed X", Range(-5, 5)) = 0.0
_OutlineUVSpeedY ("Outline UV Speed Y", Range(-5, 5)) = 0.0 _OutlineUVSpeedY ("Outline UV Speed Y", Range(-5, 5)) = 0.0
@ -21,7 +21,7 @@ Properties {
_BevelRoundness ("Bevel Roundness", Range(0,1)) = 0 _BevelRoundness ("Bevel Roundness", Range(0,1)) = 0
_LightAngle ("Light Angle", Range(0.0, 6.2831853)) = 3.1416 _LightAngle ("Light Angle", Range(0.0, 6.2831853)) = 3.1416
_SpecularColor ("Specular", Color) = (1,1,1,1) [HDR]_SpecularColor ("Specular", Color) = (1,1,1,1)
_SpecularPower ("Specular", Range(0,4)) = 2.0 _SpecularPower ("Specular", Range(0,4)) = 2.0
_Reflectivity ("Reflectivity", Range(5.0,15.0)) = 10 _Reflectivity ("Reflectivity", Range(5.0,15.0)) = 10
_Diffuse ("Diffuse", Range(0,1)) = 0.5 _Diffuse ("Diffuse", Range(0,1)) = 0.5
@ -37,13 +37,13 @@ Properties {
_EnvMatrixRotation ("Texture Rotation", vector) = (0, 0, 0, 0) _EnvMatrixRotation ("Texture Rotation", vector) = (0, 0, 0, 0)
_UnderlayColor ("Border Color", Color) = (0,0,0, 0.5) [HDR]_UnderlayColor ("Border Color", Color) = (0,0,0, 0.5)
_UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0 _UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0
_UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0 _UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0
_UnderlayDilate ("Border Dilate", Range(-1,1)) = 0 _UnderlayDilate ("Border Dilate", Range(-1,1)) = 0
_UnderlaySoftness ("Border Softness", Range(0,1)) = 0 _UnderlaySoftness ("Border Softness", Range(0,1)) = 0
_GlowColor ("Color", Color) = (0, 1, 0, 0.5) [HDR]_GlowColor ("Color", Color) = (0, 1, 0, 0.5)
_GlowOffset ("Offset", Range(-1,1)) = 0 _GlowOffset ("Offset", Range(-1,1)) = 0
_GlowInner ("Inner", Range(0,1)) = 0.05 _GlowInner ("Inner", Range(0,1)) = 0.05
_GlowOuter ("Outer", Range(0,1)) = 0.05 _GlowOuter ("Outer", Range(0,1)) = 0.05
@ -127,18 +127,17 @@ SubShader {
#include "TMPro_Properties.cginc" #include "TMPro_Properties.cginc"
#include "TMPro.cginc" #include "TMPro.cginc"
struct vertex_t struct vertex_t {
{
UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_INPUT_INSTANCE_ID
float4 position : POSITION; float4 position : POSITION;
float3 normal : NORMAL; float3 normal : NORMAL;
fixed4 color : COLOR; fixed4 color : COLOR;
float4 texcoord0 : TEXCOORD0; float2 texcoord0 : TEXCOORD0;
float2 texcoord1 : TEXCOORD1; float2 texcoord1 : TEXCOORD1;
}; };
struct pixel_t
{ struct pixel_t {
UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO UNITY_VERTEX_OUTPUT_STEREO
float4 position : SV_POSITION; float4 position : SV_POSITION;
@ -148,20 +147,16 @@ SubShader {
float4 mask : TEXCOORD2; // Position in object space(xy), pixel Size(zw) float4 mask : TEXCOORD2; // Position in object space(xy), pixel Size(zw)
float3 viewDir : TEXCOORD3; float3 viewDir : TEXCOORD3;
#if (UNDERLAY_ON || UNDERLAY_INNER) #if (UNDERLAY_ON || UNDERLAY_INNER)
float4 texcoord2 : TEXCOORD4; // u,v, scale, bias float4 texcoord2 : TEXCOORD4; // u,v, scale, bias
fixed4 underlayColor : COLOR1; fixed4 underlayColor : COLOR1;
#endif #endif
float4 textures : TEXCOORD5; float4 textures : TEXCOORD5;
}; };
// Used by Unity internally to handle Texture Tiling and Offset. // Used by Unity internally to handle Texture Tiling and Offset.
uniform float4 _FaceTex_ST; float4 _FaceTex_ST;
uniform float4 _OutlineTex_ST; float4 _OutlineTex_ST;
uniform float _UIMaskSoftnessX;
uniform float _UIMaskSoftnessY;
uniform int _UIVertexColorAlwaysGammaSpace;
pixel_t VertShader(vertex_t input) pixel_t VertShader(vertex_t input)
{ {
@ -172,7 +167,7 @@ SubShader {
UNITY_TRANSFER_INSTANCE_ID(input,output); UNITY_TRANSFER_INSTANCE_ID(input,output);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
float bold = step(input.texcoord0.w, 0); float bold = step(input.texcoord1.y, 0);
float4 vert = input.position; float4 vert = input.position;
vert.x += _VertexOffsetX; vert.x += _VertexOffsetX;
@ -183,7 +178,7 @@ SubShader {
float2 pixelSize = vPosition.w; float2 pixelSize = vPosition.w;
pixelSize /= float2(_ScaleX, _ScaleY) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); pixelSize /= float2(_ScaleX, _ScaleY) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy));
float scale = rsqrt(dot(pixelSize, pixelSize)); float scale = rsqrt(dot(pixelSize, pixelSize));
scale *= abs(input.texcoord0.w) * _GradientScale * (_Sharpness + 1); scale *= abs(input.texcoord1.y) * _GradientScale * (_Sharpness + 1);
if (UNITY_MATRIX_P[3][3] == 0) scale = lerp(abs(scale) * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(input.normal.xyz), normalize(WorldSpaceViewDir(vert))))); if (UNITY_MATRIX_P[3][3] == 0) scale = lerp(abs(scale) * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(input.normal.xyz), normalize(WorldSpaceViewDir(vert)))));
float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0; float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0;
@ -193,13 +188,13 @@ SubShader {
float alphaClip = (1.0 - _OutlineWidth*_ScaleRatioA - _OutlineSoftness*_ScaleRatioA); float alphaClip = (1.0 - _OutlineWidth*_ScaleRatioA - _OutlineSoftness*_ScaleRatioA);
#if GLOW_ON #if GLOW_ON
alphaClip = min(alphaClip, 1.0 - _GlowOffset * _ScaleRatioB - _GlowOuter * _ScaleRatioB); alphaClip = min(alphaClip, 1.0 - _GlowOffset * _ScaleRatioB - _GlowOuter * _ScaleRatioB);
#endif #endif
alphaClip = alphaClip / 2.0 - ( .5 / scale) - weight; alphaClip = alphaClip / 2.0 - ( .5 / scale) - weight;
#if (UNDERLAY_ON || UNDERLAY_INNER) #if (UNDERLAY_ON || UNDERLAY_INNER)
float4 underlayColor = _UnderlayColor; float4 underlayColor = _UnderlayColor;
underlayColor.rgb *= underlayColor.a; underlayColor.rgb *= underlayColor.a;
@ -210,28 +205,23 @@ SubShader {
float x = -(_UnderlayOffsetX * _ScaleRatioC) * _GradientScale / _TextureWidth; float x = -(_UnderlayOffsetX * _ScaleRatioC) * _GradientScale / _TextureWidth;
float y = -(_UnderlayOffsetY * _ScaleRatioC) * _GradientScale / _TextureHeight; float y = -(_UnderlayOffsetY * _ScaleRatioC) * _GradientScale / _TextureHeight;
float2 bOffset = float2(x, y); float2 bOffset = float2(x, y);
#endif #endif
// Generate UV for the Masking Texture // Generate UV for the Masking Texture
float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); float4 clampedRect = clamp(_ClipRect, -2e10, 2e10);
float2 maskUV = (vert.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); float2 maskUV = (vert.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy);
// Support for texture tiling and offset // Support for texture tiling and offset
float2 textureUV = input.texcoord1; float2 textureUV = UnpackUV(input.texcoord1.x);
float2 faceUV = TRANSFORM_TEX(textureUV, _FaceTex); float2 faceUV = TRANSFORM_TEX(textureUV, _FaceTex);
float2 outlineUV = TRANSFORM_TEX(textureUV, _OutlineTex); float2 outlineUV = TRANSFORM_TEX(textureUV, _OutlineTex);
if (_UIVertexColorAlwaysGammaSpace && !IsGammaSpace())
{
input.color.rgb = UIGammaToLinear(input.color.rgb);
}
output.position = vPosition; output.position = vPosition;
output.color = input.color; output.color = input.color;
output.atlas = input.texcoord0; output.atlas = input.texcoord0;
output.param = float4(alphaClip, scale, bias, weight); output.param = float4(alphaClip, scale, bias, weight);
const half2 maskSoftness = half2(max(_UIMaskSoftnessX, _MaskSoftnessX), max(_UIMaskSoftnessY, _MaskSoftnessY)); output.mask = half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy));
output.mask = half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * maskSoftness + pixelSize.xy));
output.viewDir = mul((float3x3)_EnvMatrix, _WorldSpaceCameraPos.xyz - mul(unity_ObjectToWorld, vert).xyz); output.viewDir = mul((float3x3)_EnvMatrix, _WorldSpaceCameraPos.xyz - mul(unity_ObjectToWorld, vert).xyz);
#if (UNDERLAY_ON || UNDERLAY_INNER) #if (UNDERLAY_ON || UNDERLAY_INNER)
output.texcoord2 = float4(input.texcoord0 + bOffset, bScale, bBias); output.texcoord2 = float4(input.texcoord0 + bOffset, bScale, bBias);
@ -249,9 +239,9 @@ SubShader {
float c = tex2D(_MainTex, input.atlas).a; float c = tex2D(_MainTex, input.atlas).a;
#ifndef UNDERLAY_ON #ifndef UNDERLAY_ON
clip(c - input.param.x); clip(c - input.param.x);
#endif #endif
float scale = input.param.y; float scale = input.param.y;
float bias = input.param.z; float bias = input.param.z;
@ -271,7 +261,7 @@ SubShader {
faceColor = GetColor(sd, faceColor, outlineColor, outline, softness); faceColor = GetColor(sd, faceColor, outlineColor, outline, softness);
#if BEVEL_ON #if BEVEL_ON
float3 dxy = float3(0.5 / _TextureWidth, 0.5 / _TextureHeight, 0); float3 dxy = float3(0.5 / _TextureWidth, 0.5 / _TextureHeight, 0);
float3 n = GetSurfaceNormal(input.atlas, weight, dxy); float3 n = GetSurfaceNormal(input.atlas, weight, dxy);
@ -288,35 +278,36 @@ SubShader {
fixed4 reflcol = texCUBE(_Cube, reflect(input.viewDir, -n)); fixed4 reflcol = texCUBE(_Cube, reflect(input.viewDir, -n));
faceColor.rgb += reflcol.rgb * lerp(_ReflectFaceColor.rgb, _ReflectOutlineColor.rgb, saturate(sd + outline * 0.5)) * faceColor.a; faceColor.rgb += reflcol.rgb * lerp(_ReflectFaceColor.rgb, _ReflectOutlineColor.rgb, saturate(sd + outline * 0.5)) * faceColor.a;
#endif #endif
#if UNDERLAY_ON #if UNDERLAY_ON
float d = tex2D(_MainTex, input.texcoord2.xy).a * input.texcoord2.z; float d = tex2D(_MainTex, input.texcoord2.xy).a * input.texcoord2.z;
faceColor += input.underlayColor * saturate(d - input.texcoord2.w) * (1 - faceColor.a); faceColor += input.underlayColor * saturate(d - input.texcoord2.w) * (1 - faceColor.a);
#endif #endif
#if UNDERLAY_INNER #if UNDERLAY_INNER
float d = tex2D(_MainTex, input.texcoord2.xy).a * input.texcoord2.z; float d = tex2D(_MainTex, input.texcoord2.xy).a * input.texcoord2.z;
faceColor += input.underlayColor * (1 - saturate(d - input.texcoord2.w)) * saturate(1 - sd) * (1 - faceColor.a); faceColor += input.underlayColor * (1 - saturate(d - input.texcoord2.w)) * saturate(1 - sd) * (1 - faceColor.a);
#endif #endif
#if GLOW_ON #if GLOW_ON
float4 glowColor = GetGlowColor(sd, scale); float4 glowColor = GetGlowColor(sd, scale);
faceColor.rgb += glowColor.rgb * glowColor.a; faceColor.rgb += glowColor.rgb * glowColor.a;
#endif #endif
// Alternative implementation to UnityGet2DClipping with support for softness. // Alternative implementation to UnityGet2DClipping with support for softness.
#if UNITY_UI_CLIP_RECT #if UNITY_UI_CLIP_RECT
half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * input.mask.zw); half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * input.mask.zw);
faceColor *= m.x * m.y; faceColor *= m.x * m.y;
#endif #endif
#if UNITY_UI_ALPHACLIP #if UNITY_UI_ALPHACLIP
clip(faceColor.a - 0.001); clip(faceColor.a - 0.001);
#endif #endif
return faceColor * input.color.a; return faceColor * input.color.a;
} }
ENDCG ENDCG
} }
} }

View File

@ -4,10 +4,10 @@ Properties {
_FaceTex ("Face Texture", 2D) = "white" {} _FaceTex ("Face Texture", 2D) = "white" {}
_FaceUVSpeedX ("Face UV Speed X", Range(-5, 5)) = 0.0 _FaceUVSpeedX ("Face UV Speed X", Range(-5, 5)) = 0.0
_FaceUVSpeedY ("Face UV Speed Y", Range(-5, 5)) = 0.0 _FaceUVSpeedY ("Face UV Speed Y", Range(-5, 5)) = 0.0
_FaceColor ("Face Color", Color) = (1,1,1,1) [HDR]_FaceColor ("Face Color", Color) = (1,1,1,1)
_FaceDilate ("Face Dilate", Range(-1,1)) = 0 _FaceDilate ("Face Dilate", Range(-1,1)) = 0
_OutlineColor ("Outline Color", Color) = (0,0,0,1) [HDR]_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_OutlineTex ("Outline Texture", 2D) = "white" {} _OutlineTex ("Outline Texture", 2D) = "white" {}
_OutlineUVSpeedX ("Outline UV Speed X", Range(-5, 5)) = 0.0 _OutlineUVSpeedX ("Outline UV Speed X", Range(-5, 5)) = 0.0
_OutlineUVSpeedY ("Outline UV Speed Y", Range(-5, 5)) = 0.0 _OutlineUVSpeedY ("Outline UV Speed Y", Range(-5, 5)) = 0.0
@ -21,7 +21,7 @@ Properties {
_BevelRoundness ("Bevel Roundness", Range(0,1)) = 0 _BevelRoundness ("Bevel Roundness", Range(0,1)) = 0
_LightAngle ("Light Angle", Range(0.0, 6.2831853)) = 3.1416 _LightAngle ("Light Angle", Range(0.0, 6.2831853)) = 3.1416
_SpecularColor ("Specular", Color) = (1,1,1,1) [HDR]_SpecularColor ("Specular", Color) = (1,1,1,1)
_SpecularPower ("Specular", Range(0,4)) = 2.0 _SpecularPower ("Specular", Range(0,4)) = 2.0
_Reflectivity ("Reflectivity", Range(5.0,15.0)) = 10 _Reflectivity ("Reflectivity", Range(5.0,15.0)) = 10
_Diffuse ("Diffuse", Range(0,1)) = 0.5 _Diffuse ("Diffuse", Range(0,1)) = 0.5
@ -37,13 +37,13 @@ Properties {
_EnvMatrixRotation ("Texture Rotation", vector) = (0, 0, 0, 0) _EnvMatrixRotation ("Texture Rotation", vector) = (0, 0, 0, 0)
_UnderlayColor ("Border Color", Color) = (0,0,0, 0.5) [HDR]_UnderlayColor ("Border Color", Color) = (0,0,0, 0.5)
_UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0 _UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0
_UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0 _UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0
_UnderlayDilate ("Border Dilate", Range(-1,1)) = 0 _UnderlayDilate ("Border Dilate", Range(-1,1)) = 0
_UnderlaySoftness ("Border Softness", Range(0,1)) = 0 _UnderlaySoftness ("Border Softness", Range(0,1)) = 0
_GlowColor ("Color", Color) = (0, 1, 0, 0.5) [HDR]_GlowColor ("Color", Color) = (0, 1, 0, 0.5)
_GlowOffset ("Offset", Range(-1,1)) = 0 _GlowOffset ("Offset", Range(-1,1)) = 0
_GlowInner ("Inner", Range(0,1)) = 0.05 _GlowInner ("Inner", Range(0,1)) = 0.05
_GlowOuter ("Outer", Range(0,1)) = 0.05 _GlowOuter ("Outer", Range(0,1)) = 0.05
@ -109,8 +109,7 @@ SubShader {
Blend One OneMinusSrcAlpha Blend One OneMinusSrcAlpha
ColorMask[_ColorMask] ColorMask[_ColorMask]
Pass Pass {
{
CGPROGRAM CGPROGRAM
#pragma target 3.0 #pragma target 3.0
#pragma vertex VertShader #pragma vertex VertShader
@ -128,18 +127,17 @@ SubShader {
#include "TMPro_Properties.cginc" #include "TMPro_Properties.cginc"
#include "TMPro.cginc" #include "TMPro.cginc"
struct vertex_t struct vertex_t {
{
UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_INPUT_INSTANCE_ID
float4 position : POSITION; float4 position : POSITION;
float3 normal : NORMAL; float3 normal : NORMAL;
float4 color : COLOR; float4 color : COLOR;
float4 texcoord0 : TEXCOORD0; float2 texcoord0 : TEXCOORD0;
float2 texcoord1 : TEXCOORD1; float2 texcoord1 : TEXCOORD1;
}; };
struct pixel_t
{ struct pixel_t {
UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO UNITY_VERTEX_OUTPUT_STEREO
float4 position : SV_POSITION; float4 position : SV_POSITION;
@ -149,23 +147,18 @@ SubShader {
float2 mask : TEXCOORD2; // Position in object space(xy) float2 mask : TEXCOORD2; // Position in object space(xy)
float3 viewDir : TEXCOORD3; float3 viewDir : TEXCOORD3;
#if (UNDERLAY_ON || UNDERLAY_INNER) #if (UNDERLAY_ON || UNDERLAY_INNER)
float2 texcoord2 : TEXCOORD4; float2 texcoord2 : TEXCOORD4;
float4 underlayColor : COLOR1; float4 underlayColor : COLOR1;
#endif #endif
float4 textures : TEXCOORD5; float4 textures : TEXCOORD5;
}; };
// Used by Unity internally to handle Texture Tiling and Offset. // Used by Unity internally to handle Texture Tiling and Offset.
float4 _FaceTex_ST; float4 _FaceTex_ST;
float4 _OutlineTex_ST; float4 _OutlineTex_ST;
float _UIMaskSoftnessX;
float _UIMaskSoftnessY;
int _UIVertexColorAlwaysGammaSpace;
float4 SRGBToLinear(float4 rgba) float4 SRGBToLinear(float4 rgba) {
{
return float4(lerp(rgba.rgb / 12.92f, pow((rgba.rgb + 0.055f) / 1.055f, 2.4f), step(0.04045f, rgba.rgb)), rgba.a); return float4(lerp(rgba.rgb / 12.92f, pow((rgba.rgb + 0.055f) / 1.055f, 2.4f), step(0.04045f, rgba.rgb)), rgba.a);
} }
@ -178,7 +171,7 @@ SubShader {
UNITY_TRANSFER_INSTANCE_ID(input,output); UNITY_TRANSFER_INSTANCE_ID(input,output);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
float bold = step(input.texcoord0.w, 0); float bold = step(input.texcoord1.y, 0);
float4 vert = input.position; float4 vert = input.position;
vert.x += _VertexOffsetX; vert.x += _VertexOffsetX;
@ -189,31 +182,27 @@ SubShader {
float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0; float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0;
weight = (weight + _FaceDilate) * _ScaleRatioA * 0.5; weight = (weight + _FaceDilate) * _ScaleRatioA * 0.5;
#if (UNDERLAY_ON || UNDERLAY_INNER) #if (UNDERLAY_ON || UNDERLAY_INNER)
float4 underlayColor = _UnderlayColor; float4 underlayColor = _UnderlayColor;
underlayColor.rgb *= underlayColor.a; underlayColor.rgb *= underlayColor.a;
float x = -(_UnderlayOffsetX * _ScaleRatioC) * _GradientScale / _TextureWidth; float x = -(_UnderlayOffsetX * _ScaleRatioC) * _GradientScale / _TextureWidth;
float y = -(_UnderlayOffsetY * _ScaleRatioC) * _GradientScale / _TextureHeight; float y = -(_UnderlayOffsetY * _ScaleRatioC) * _GradientScale / _TextureHeight;
float2 bOffset = float2(x, y); float2 bOffset = float2(x, y);
#endif #endif
// Generate UV for the Masking Texture // Generate UV for the Masking Texture
float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); float4 clampedRect = clamp(_ClipRect, -2e10, 2e10);
// Support for texture tiling and offset // Support for texture tiling and offset
float2 textureUV = input.texcoord1; float2 textureUV = UnpackUV(input.texcoord1.x);
float2 faceUV = TRANSFORM_TEX(textureUV, _FaceTex); float2 faceUV = TRANSFORM_TEX(textureUV, _FaceTex);
float2 outlineUV = TRANSFORM_TEX(textureUV, _OutlineTex); float2 outlineUV = TRANSFORM_TEX(textureUV, _OutlineTex);
if (_UIVertexColorAlwaysGammaSpace && !IsGammaSpace())
{
input.color.rgb = UIGammaToLinear(input.color.rgb);
}
float4 color = input.color; float4 color = input.color;
#if (FORCE_LINEAR && !UNITY_COLORSPACE_GAMMA) #if (FORCE_LINEAR && !UNITY_COLORSPACE_GAMMA)
color = SRGBToLinear(input.color); color = SRGBToLinear(input.color);
#endif #endif
output.position = vPosition; output.position = vPosition;
output.color = color; output.color = color;
@ -221,10 +210,10 @@ SubShader {
output.weight = weight; output.weight = weight;
output.mask = half2(vert.xy * 2 - clampedRect.xy - clampedRect.zw); output.mask = half2(vert.xy * 2 - clampedRect.xy - clampedRect.zw);
output.viewDir = mul((float3x3)_EnvMatrix, _WorldSpaceCameraPos.xyz - mul(unity_ObjectToWorld, vert).xyz); output.viewDir = mul((float3x3)_EnvMatrix, _WorldSpaceCameraPos.xyz - mul(unity_ObjectToWorld, vert).xyz);
#if (UNDERLAY_ON || UNDERLAY_INNER) #if (UNDERLAY_ON || UNDERLAY_INNER)
output.texcoord2 = input.texcoord0 + bOffset; output.texcoord2 = input.texcoord0 + bOffset;
output.underlayColor = underlayColor; output.underlayColor = underlayColor;
#endif #endif
output.textures = float4(faceUV, outlineUV); output.textures = float4(faceUV, outlineUV);
return output; return output;
@ -237,9 +226,9 @@ SubShader {
float c = tex2D(_MainTex, input.atlas).a; float c = tex2D(_MainTex, input.atlas).a;
float pixelSize = abs(ddx(input.atlas.y)) + abs(ddy(input.atlas.y)); float2 pixelSize = float2(ddx(input.atlas.y), ddy(input.atlas.y));
pixelSize *= _TextureHeight * 0.75; pixelSize *= _TextureWidth * .75;
float scale = 1 / pixelSize * _GradientScale * (_Sharpness + 1); float scale = rsqrt(dot(pixelSize, pixelSize)) * _GradientScale * (_Sharpness + 1);
float weight = input.weight; float weight = input.weight;
float bias = (.5 - weight) + (.5 / scale); float bias = (.5 - weight) + (.5 / scale);
@ -258,7 +247,7 @@ SubShader {
faceColor = GetColor(sd, faceColor, outlineColor, outline, softness); faceColor = GetColor(sd, faceColor, outlineColor, outline, softness);
#if BEVEL_ON #if BEVEL_ON
float3 dxy = float3(0.5 / _TextureWidth, 0.5 / _TextureHeight, 0); float3 dxy = float3(0.5 / _TextureWidth, 0.5 / _TextureHeight, 0);
float3 n = GetSurfaceNormal(input.atlas, weight, dxy); float3 n = GetSurfaceNormal(input.atlas, weight, dxy);
@ -275,45 +264,45 @@ SubShader {
fixed4 reflcol = texCUBE(_Cube, reflect(input.viewDir, -n)); fixed4 reflcol = texCUBE(_Cube, reflect(input.viewDir, -n));
faceColor.rgb += reflcol.rgb * lerp(_ReflectFaceColor.rgb, _ReflectOutlineColor.rgb, saturate(sd + outline * 0.5)) * faceColor.a; faceColor.rgb += reflcol.rgb * lerp(_ReflectFaceColor.rgb, _ReflectOutlineColor.rgb, saturate(sd + outline * 0.5)) * faceColor.a;
#endif #endif
#if (UNDERLAY_ON || UNDERLAY_INNER) #if (UNDERLAY_ON || UNDERLAY_INNER)
float bScale = scale; float bScale = scale;
bScale /= 1 + ((_UnderlaySoftness * _ScaleRatioC) * bScale); bScale /= 1 + ((_UnderlaySoftness * _ScaleRatioC) * bScale);
float bBias = (0.5 - weight) * bScale - 0.5 - ((_UnderlayDilate * _ScaleRatioC) * 0.5 * bScale); float bBias = (0.5 - weight) * bScale - 0.5 - ((_UnderlayDilate * _ScaleRatioC) * 0.5 * bScale);
#endif #endif
#if UNDERLAY_ON #if UNDERLAY_ON
float d = tex2D(_MainTex, input.texcoord2.xy).a * bScale; float d = tex2D(_MainTex, input.texcoord2.xy).a * bScale;
faceColor += input.underlayColor * saturate(d - bBias) * (1 - faceColor.a); faceColor += input.underlayColor * saturate(d - bBias) * (1 - faceColor.a);
#endif #endif
#if UNDERLAY_INNER #if UNDERLAY_INNER
float d = tex2D(_MainTex, input.texcoord2.xy).a * bScale; float d = tex2D(_MainTex, input.texcoord2.xy).a * bScale;
faceColor += input.underlayColor * (1 - saturate(d - bBias)) * saturate(1 - sd) * (1 - faceColor.a); faceColor += input.underlayColor * (1 - saturate(d - bBias)) * saturate(1 - sd) * (1 - faceColor.a);
#endif #endif
#if GLOW_ON #if GLOW_ON
float4 glowColor = GetGlowColor(sd, scale); float4 glowColor = GetGlowColor(sd, scale);
faceColor.rgb += glowColor.rgb * glowColor.a; faceColor.rgb += glowColor.rgb * glowColor.a;
#endif #endif
// Alternative implementation to UnityGet2DClipping with support for softness. // Alternative implementation to UnityGet2DClipping with support for softness.
#if UNITY_UI_CLIP_RECT #if UNITY_UI_CLIP_RECT
half2 maskSoftness = half2(max(_UIMaskSoftnessX, _MaskSoftnessX), max(_UIMaskSoftnessY, _MaskSoftnessY)); float2 maskZW = 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + (1 / scale));
float2 maskZW = 0.25 / (0.25 * maskSoftness + 1 / scale);
half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * maskZW); half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * maskZW);
faceColor *= m.x * m.y; faceColor *= m.x * m.y;
#endif #endif
#if UNITY_UI_ALPHACLIP #if UNITY_UI_ALPHACLIP
clip(faceColor.a - 0.001); clip(faceColor.a - 0.001);
#endif #endif
return faceColor * input.color.a; return faceColor * input.color.a;
}
ENDCG
} }
ENDCG
}
} }
Fallback "TextMeshPro/Mobile/Distance Field" Fallback "TextMeshPro/Mobile/Distance Field"

View File

@ -6,14 +6,14 @@
Shader "TextMeshPro/Mobile/Distance Field - Masking" { Shader "TextMeshPro/Mobile/Distance Field - Masking" {
Properties { Properties {
_FaceColor ("Face Color", Color) = (1,1,1,1) [HDR]_FaceColor ("Face Color", Color) = (1,1,1,1)
_FaceDilate ("Face Dilate", Range(-1,1)) = 0 _FaceDilate ("Face Dilate", Range(-1,1)) = 0
_OutlineColor ("Outline Color", Color) = (0,0,0,1) [HDR]_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_OutlineWidth ("Outline Thickness", Range(0,1)) = 0 _OutlineWidth ("Outline Thickness", Range(0,1)) = 0
_OutlineSoftness ("Outline Softness", Range(0,1)) = 0 _OutlineSoftness ("Outline Softness", Range(0,1)) = 0
_UnderlayColor ("Border Color", Color) = (0,0,0,.5) [HDR]_UnderlayColor ("Border Color", Color) = (0,0,0,.5)
_UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0 _UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0
_UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0 _UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0
_UnderlayDilate ("Border Dilate", Range(-1,1)) = 0 _UnderlayDilate ("Border Dilate", Range(-1,1)) = 0
@ -99,41 +99,35 @@ SubShader {
#include "UnityUI.cginc" #include "UnityUI.cginc"
#include "TMPro_Properties.cginc" #include "TMPro_Properties.cginc"
struct vertex_t struct vertex_t {
{
float4 vertex : POSITION; float4 vertex : POSITION;
float3 normal : NORMAL; float3 normal : NORMAL;
fixed4 color : COLOR; fixed4 color : COLOR;
float4 texcoord0 : TEXCOORD0; float2 texcoord0 : TEXCOORD0;
float2 texcoord1 : TEXCOORD1; float2 texcoord1 : TEXCOORD1;
}; };
struct pixel_t struct pixel_t {
{
float4 vertex : SV_POSITION; float4 vertex : SV_POSITION;
fixed4 faceColor : COLOR; fixed4 faceColor : COLOR;
fixed4 outlineColor : COLOR1; fixed4 outlineColor : COLOR1;
float4 texcoord0 : TEXCOORD0; // Texture UV, Mask UV float4 texcoord0 : TEXCOORD0; // Texture UV, Mask UV
half4 param : TEXCOORD1; // Scale(x), BiasIn(y), BiasOut(z), Bias(w) half4 param : TEXCOORD1; // Scale(x), BiasIn(y), BiasOut(z), Bias(w)
half4 mask : TEXCOORD2; // Position in clip space(xy), Softness(zw) half4 mask : TEXCOORD2; // Position in clip space(xy), Softness(zw)
#if (UNDERLAY_ON | UNDERLAY_INNER)
#if (UNDERLAY_ON | UNDERLAY_INNER)
float4 texcoord1 : TEXCOORD3; // Texture UV, alpha, reserved float4 texcoord1 : TEXCOORD3; // Texture UV, alpha, reserved
half2 underlayParam : TEXCOORD4; // Scale(x), Bias(y) half2 underlayParam : TEXCOORD4; // Scale(x), Bias(y)
#endif #endif
}; };
float _MaskWipeControl; float _MaskWipeControl;
float _MaskEdgeSoftness; float _MaskEdgeSoftness;
fixed4 _MaskEdgeColor; fixed4 _MaskEdgeColor;
bool _MaskInverse; bool _MaskInverse;
float _UIMaskSoftnessX;
float _UIMaskSoftnessY;
int _UIVertexColorAlwaysGammaSpace;
pixel_t VertShader(vertex_t input) pixel_t VertShader(vertex_t input)
{ {
float bold = step(input.texcoord0.w, 0); float bold = step(input.texcoord1.y, 0);
float4 vert = input.vertex; float4 vert = input.vertex;
vert.x += _VertexOffsetX; vert.x += _VertexOffsetX;
@ -144,7 +138,7 @@ SubShader {
pixelSize /= float2(_ScaleX, _ScaleY) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); pixelSize /= float2(_ScaleX, _ScaleY) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy));
float scale = rsqrt(dot(pixelSize, pixelSize)); float scale = rsqrt(dot(pixelSize, pixelSize));
scale *= abs(input.texcoord0.w) * _GradientScale * (_Sharpness + 1); scale *= abs(input.texcoord1.y) * _GradientScale * (_Sharpness + 1);
if(UNITY_MATRIX_P[3][3] == 0) scale = lerp(abs(scale) * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(input.normal.xyz), normalize(WorldSpaceViewDir(vert))))); if(UNITY_MATRIX_P[3][3] == 0) scale = lerp(abs(scale) * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(input.normal.xyz), normalize(WorldSpaceViewDir(vert)))));
float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0; float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0;
@ -156,10 +150,6 @@ SubShader {
float bias = (0.5 - weight) * scale - 0.5; float bias = (0.5 - weight) * scale - 0.5;
float outline = _OutlineWidth * _ScaleRatioA * 0.5 * scale; float outline = _OutlineWidth * _ScaleRatioA * 0.5 * scale;
if (_UIVertexColorAlwaysGammaSpace && !IsGammaSpace())
{
input.color.rgb = UIGammaToLinear(input.color.rgb);
}
float opacity = input.color.a; float opacity = input.color.a;
#if (UNDERLAY_ON | UNDERLAY_INNER) #if (UNDERLAY_ON | UNDERLAY_INNER)
opacity = 1.0; opacity = 1.0;
@ -173,7 +163,7 @@ SubShader {
outlineColor.rgb *= outlineColor.a; outlineColor.rgb *= outlineColor.a;
outlineColor = lerp(faceColor, outlineColor, sqrt(min(1.0, (outline * 2)))); outlineColor = lerp(faceColor, outlineColor, sqrt(min(1.0, (outline * 2))));
#if (UNDERLAY_ON | UNDERLAY_INNER) #if (UNDERLAY_ON | UNDERLAY_INNER)
layerScale /= 1 + ((_UnderlaySoftness * _ScaleRatioC) * layerScale); layerScale /= 1 + ((_UnderlaySoftness * _ScaleRatioC) * layerScale);
float layerBias = (.5 - weight) * layerScale - .5 - ((_UnderlayDilate * _ScaleRatioC) * .5 * layerScale); float layerBias = (.5 - weight) * layerScale - .5 - ((_UnderlayDilate * _ScaleRatioC) * .5 * layerScale);
@ -181,12 +171,11 @@ SubShader {
float x = -(_UnderlayOffsetX * _ScaleRatioC) * _GradientScale / _TextureWidth; float x = -(_UnderlayOffsetX * _ScaleRatioC) * _GradientScale / _TextureWidth;
float y = -(_UnderlayOffsetY * _ScaleRatioC) * _GradientScale / _TextureHeight; float y = -(_UnderlayOffsetY * _ScaleRatioC) * _GradientScale / _TextureHeight;
float2 layerOffset = float2(x, y); float2 layerOffset = float2(x, y);
#endif #endif
// Generate UV for the Masking Texture // Generate UV for the Masking Texture
float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); float4 clampedRect = clamp(_ClipRect, -2e10, 2e10);
float2 maskUV = (vert.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); float2 maskUV = (vert.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy);
const half2 maskSoftness = half2(max(_UIMaskSoftnessX, _MaskSoftnessX), max(_UIMaskSoftnessY, _MaskSoftnessY));
// Structure for pixel shader // Structure for pixel shader
pixel_t output = { pixel_t output = {
@ -195,11 +184,11 @@ SubShader {
outlineColor, outlineColor,
float4(input.texcoord0.x, input.texcoord0.y, maskUV.x, maskUV.y), float4(input.texcoord0.x, input.texcoord0.y, maskUV.x, maskUV.y),
half4(scale, bias - outline, bias + outline, bias), half4(scale, bias - outline, bias + outline, bias),
half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * maskSoftness + pixelSize.xy)), half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy)),
#if (UNDERLAY_ON | UNDERLAY_INNER) #if (UNDERLAY_ON | UNDERLAY_INNER)
float4(input.texcoord0 + layerOffset, input.color.a, 0), float4(input.texcoord0 + layerOffset, input.color.a, 0),
half2(layerScale, layerBias), half2(layerScale, layerBias),
#endif #endif
}; };
return output; return output;
@ -212,41 +201,41 @@ SubShader {
half d = tex2D(_MainTex, input.texcoord0.xy).a * input.param.x; half d = tex2D(_MainTex, input.texcoord0.xy).a * input.param.x;
half4 c = input.faceColor * saturate(d - input.param.w); half4 c = input.faceColor * saturate(d - input.param.w);
#ifdef OUTLINE_ON #ifdef OUTLINE_ON
c = lerp(input.outlineColor, input.faceColor, saturate(d - input.param.z)); c = lerp(input.outlineColor, input.faceColor, saturate(d - input.param.z));
c *= saturate(d - input.param.y); c *= saturate(d - input.param.y);
#endif #endif
#if UNDERLAY_ON #if UNDERLAY_ON
d = tex2D(_MainTex, input.texcoord1.xy).a * input.underlayParam.x; d = tex2D(_MainTex, input.texcoord1.xy).a * input.underlayParam.x;
c += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * saturate(d - input.underlayParam.y) * (1 - c.a); c += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * saturate(d - input.underlayParam.y) * (1 - c.a);
#endif #endif
#if UNDERLAY_INNER #if UNDERLAY_INNER
half sd = saturate(d - input.param.z); half sd = saturate(d - input.param.z);
d = tex2D(_MainTex, input.texcoord1.xy).a * input.underlayParam.x; d = tex2D(_MainTex, input.texcoord1.xy).a * input.underlayParam.x;
c += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * (1 - saturate(d - input.underlayParam.y)) * sd * (1 - c.a); c += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * (1 - saturate(d - input.underlayParam.y)) * sd * (1 - c.a);
#endif #endif
// Alternative implementation to UnityGet2DClipping with support for softness. // Alternative implementation to UnityGet2DClipping with support for softness.
//#if UNITY_UI_CLIP_RECT //#if UNITY_UI_CLIP_RECT
half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * input.mask.zw); half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * input.mask.zw);
c *= m.x * m.y; c *= m.x * m.y;
//#endif //#endif
float a = abs(_MaskInverse - tex2D(_MaskTex, input.texcoord0.zw).a); float a = abs(_MaskInverse - tex2D(_MaskTex, input.texcoord0.zw).a);
float t = a + (1 - _MaskWipeControl) * _MaskEdgeSoftness - _MaskWipeControl; float t = a + (1 - _MaskWipeControl) * _MaskEdgeSoftness - _MaskWipeControl;
a = saturate(t / _MaskEdgeSoftness); a = saturate(t / _MaskEdgeSoftness);
c.rgb = lerp(_MaskEdgeColor.rgb*c.a, c.rgb, a); c.rgb = lerp(_MaskEdgeColor.rgb*c.a, c.rgb, a);
c *= a; c *= a;
#if (UNDERLAY_ON | UNDERLAY_INNER) #if (UNDERLAY_ON | UNDERLAY_INNER)
c *= input.texcoord1.z; c *= input.texcoord1.z;
#endif #endif
#if UNITY_UI_ALPHACLIP #if UNITY_UI_ALPHACLIP
clip(c.a - 0.001); clip(c.a - 0.001);
#endif #endif
return c; return c;
} }

View File

@ -6,14 +6,14 @@
Shader "TextMeshPro/Mobile/Distance Field Overlay" { Shader "TextMeshPro/Mobile/Distance Field Overlay" {
Properties { Properties {
_FaceColor ("Face Color", Color) = (1,1,1,1) [HDR]_FaceColor ("Face Color", Color) = (1,1,1,1)
_FaceDilate ("Face Dilate", Range(-1,1)) = 0 _FaceDilate ("Face Dilate", Range(-1,1)) = 0
_OutlineColor ("Outline Color", Color) = (0,0,0,1) [HDR]_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_OutlineWidth ("Outline Thickness", Range(0,1)) = 0 _OutlineWidth ("Outline Thickness", Range(0,1)) = 0
_OutlineSoftness ("Outline Softness", Range(0,1)) = 0 _OutlineSoftness ("Outline Softness", Range(0,1)) = 0
_UnderlayColor ("Border Color", Color) = (0,0,0,.5) [HDR]_UnderlayColor ("Border Color", Color) = (0,0,0,.5)
_UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0 _UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0
_UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0 _UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0
_UnderlayDilate ("Border Dilate", Range(-1,1)) = 0 _UnderlayDilate ("Border Dilate", Range(-1,1)) = 0
@ -93,18 +93,16 @@ SubShader {
#include "UnityUI.cginc" #include "UnityUI.cginc"
#include "TMPro_Properties.cginc" #include "TMPro_Properties.cginc"
struct vertex_t struct vertex_t {
{
UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_INPUT_INSTANCE_ID
float4 vertex : POSITION; float4 vertex : POSITION;
float3 normal : NORMAL; float3 normal : NORMAL;
fixed4 color : COLOR; fixed4 color : COLOR;
float4 texcoord0 : TEXCOORD0; float2 texcoord0 : TEXCOORD0;
float2 texcoord1 : TEXCOORD1; float2 texcoord1 : TEXCOORD1;
}; };
struct pixel_t struct pixel_t {
{
UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO UNITY_VERTEX_OUTPUT_STEREO
float4 vertex : SV_POSITION; float4 vertex : SV_POSITION;
@ -113,17 +111,12 @@ SubShader {
float4 texcoord0 : TEXCOORD0; // Texture UV, Mask UV float4 texcoord0 : TEXCOORD0; // Texture UV, Mask UV
half4 param : TEXCOORD1; // Scale(x), BiasIn(y), BiasOut(z), Bias(w) half4 param : TEXCOORD1; // Scale(x), BiasIn(y), BiasOut(z), Bias(w)
half4 mask : TEXCOORD2; // Position in clip space(xy), Softness(zw) half4 mask : TEXCOORD2; // Position in clip space(xy), Softness(zw)
#if (UNDERLAY_ON | UNDERLAY_INNER)
#if (UNDERLAY_ON | UNDERLAY_INNER)
float4 texcoord1 : TEXCOORD3; // Texture UV, alpha, reserved float4 texcoord1 : TEXCOORD3; // Texture UV, alpha, reserved
half2 underlayParam : TEXCOORD4; // Scale(x), Bias(y) half2 underlayParam : TEXCOORD4; // Scale(x), Bias(y)
#endif #endif
}; };
float _UIMaskSoftnessX;
float _UIMaskSoftnessY;
int _UIVertexColorAlwaysGammaSpace;
pixel_t VertShader(vertex_t input) pixel_t VertShader(vertex_t input)
{ {
@ -134,7 +127,7 @@ SubShader {
UNITY_TRANSFER_INSTANCE_ID(input, output); UNITY_TRANSFER_INSTANCE_ID(input, output);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
float bold = step(input.texcoord0.w, 0); float bold = step(input.texcoord1.y, 0);
float4 vert = input.vertex; float4 vert = input.vertex;
vert.x += _VertexOffsetX; vert.x += _VertexOffsetX;
@ -145,7 +138,7 @@ SubShader {
pixelSize /= float2(_ScaleX, _ScaleY) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); pixelSize /= float2(_ScaleX, _ScaleY) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy));
float scale = rsqrt(dot(pixelSize, pixelSize)); float scale = rsqrt(dot(pixelSize, pixelSize));
scale *= abs(input.texcoord0.w) * _GradientScale * (_Sharpness + 1); scale *= abs(input.texcoord1.y) * _GradientScale * (_Sharpness + 1);
if(UNITY_MATRIX_P[3][3] == 0) scale = lerp(abs(scale) * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(input.normal.xyz), normalize(WorldSpaceViewDir(vert))))); if(UNITY_MATRIX_P[3][3] == 0) scale = lerp(abs(scale) * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(input.normal.xyz), normalize(WorldSpaceViewDir(vert)))));
float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0; float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0;
@ -157,14 +150,10 @@ SubShader {
float bias = (0.5 - weight) * scale - 0.5; float bias = (0.5 - weight) * scale - 0.5;
float outline = _OutlineWidth * _ScaleRatioA * 0.5 * scale; float outline = _OutlineWidth * _ScaleRatioA * 0.5 * scale;
if (_UIVertexColorAlwaysGammaSpace && !IsGammaSpace())
{
input.color.rgb = UIGammaToLinear(input.color.rgb);
}
float opacity = input.color.a; float opacity = input.color.a;
#if (UNDERLAY_ON | UNDERLAY_INNER) #if (UNDERLAY_ON | UNDERLAY_INNER)
opacity = 1.0; opacity = 1.0;
#endif #endif
fixed4 faceColor = fixed4(input.color.rgb, opacity) * _FaceColor; fixed4 faceColor = fixed4(input.color.rgb, opacity) * _FaceColor;
faceColor.rgb *= faceColor.a; faceColor.rgb *= faceColor.a;
@ -174,14 +163,14 @@ SubShader {
outlineColor.rgb *= outlineColor.a; outlineColor.rgb *= outlineColor.a;
outlineColor = lerp(faceColor, outlineColor, sqrt(min(1.0, (outline * 2)))); outlineColor = lerp(faceColor, outlineColor, sqrt(min(1.0, (outline * 2))));
#if (UNDERLAY_ON | UNDERLAY_INNER) #if (UNDERLAY_ON | UNDERLAY_INNER)
layerScale /= 1 + ((_UnderlaySoftness * _ScaleRatioC) * layerScale); layerScale /= 1 + ((_UnderlaySoftness * _ScaleRatioC) * layerScale);
float layerBias = (.5 - weight) * layerScale - .5 - ((_UnderlayDilate * _ScaleRatioC) * .5 * layerScale); float layerBias = (.5 - weight) * layerScale - .5 - ((_UnderlayDilate * _ScaleRatioC) * .5 * layerScale);
float x = -(_UnderlayOffsetX * _ScaleRatioC) * _GradientScale / _TextureWidth; float x = -(_UnderlayOffsetX * _ScaleRatioC) * _GradientScale / _TextureWidth;
float y = -(_UnderlayOffsetY * _ScaleRatioC) * _GradientScale / _TextureHeight; float y = -(_UnderlayOffsetY * _ScaleRatioC) * _GradientScale / _TextureHeight;
float2 layerOffset = float2(x, y); float2 layerOffset = float2(x, y);
#endif #endif
// Generate UV for the Masking Texture // Generate UV for the Masking Texture
float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); float4 clampedRect = clamp(_ClipRect, -2e10, 2e10);
@ -193,8 +182,7 @@ SubShader {
output.outlineColor = outlineColor; output.outlineColor = outlineColor;
output.texcoord0 = float4(input.texcoord0.x, input.texcoord0.y, maskUV.x, maskUV.y); output.texcoord0 = float4(input.texcoord0.x, input.texcoord0.y, maskUV.x, maskUV.y);
output.param = half4(scale, bias - outline, bias + outline, bias); output.param = half4(scale, bias - outline, bias + outline, bias);
const half2 maskSoftness = half2(max(_UIMaskSoftnessX, _MaskSoftnessX), max(_UIMaskSoftnessY, _MaskSoftnessY)); output.mask = half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy));
output.mask = half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * maskSoftness + pixelSize.xy));
#if (UNDERLAY_ON || UNDERLAY_INNER) #if (UNDERLAY_ON || UNDERLAY_INNER)
output.texcoord1 = float4(input.texcoord0 + layerOffset, input.color.a, 0); output.texcoord1 = float4(input.texcoord0 + layerOffset, input.color.a, 0);
output.underlayParam = half2(layerScale, layerBias); output.underlayParam = half2(layerScale, layerBias);
@ -212,35 +200,35 @@ SubShader {
half d = tex2D(_MainTex, input.texcoord0.xy).a * input.param.x; half d = tex2D(_MainTex, input.texcoord0.xy).a * input.param.x;
half4 c = input.faceColor * saturate(d - input.param.w); half4 c = input.faceColor * saturate(d - input.param.w);
#ifdef OUTLINE_ON #ifdef OUTLINE_ON
c = lerp(input.outlineColor, input.faceColor, saturate(d - input.param.z)); c = lerp(input.outlineColor, input.faceColor, saturate(d - input.param.z));
c *= saturate(d - input.param.y); c *= saturate(d - input.param.y);
#endif #endif
#if UNDERLAY_ON #if UNDERLAY_ON
d = tex2D(_MainTex, input.texcoord1.xy).a * input.underlayParam.x; d = tex2D(_MainTex, input.texcoord1.xy).a * input.underlayParam.x;
c += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * saturate(d - input.underlayParam.y) * (1 - c.a); c += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * saturate(d - input.underlayParam.y) * (1 - c.a);
#endif #endif
#if UNDERLAY_INNER #if UNDERLAY_INNER
half sd = saturate(d - input.param.z); half sd = saturate(d - input.param.z);
d = tex2D(_MainTex, input.texcoord1.xy).a * input.underlayParam.x; d = tex2D(_MainTex, input.texcoord1.xy).a * input.underlayParam.x;
c += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * (1 - saturate(d - input.underlayParam.y)) * sd * (1 - c.a); c += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * (1 - saturate(d - input.underlayParam.y)) * sd * (1 - c.a);
#endif #endif
// Alternative implementation to UnityGet2DClipping with support for softness. // Alternative implementation to UnityGet2DClipping with support for softness.
#if UNITY_UI_CLIP_RECT #if UNITY_UI_CLIP_RECT
half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * input.mask.zw); half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * input.mask.zw);
c *= m.x * m.y; c *= m.x * m.y;
#endif #endif
#if (UNDERLAY_ON | UNDERLAY_INNER) #if (UNDERLAY_ON | UNDERLAY_INNER)
c *= input.texcoord1.z; c *= input.texcoord1.z;
#endif #endif
#if UNITY_UI_ALPHACLIP #if UNITY_UI_ALPHACLIP
clip(c.a - 0.001); clip(c.a - 0.001);
#endif #endif
return c; return c;
} }

View File

@ -6,14 +6,14 @@
Shader "TextMeshPro/Mobile/Distance Field SSD" { Shader "TextMeshPro/Mobile/Distance Field SSD" {
Properties { Properties {
_FaceColor ("Face Color", Color) = (1,1,1,1) [HDR]_FaceColor ("Face Color", Color) = (1,1,1,1)
_FaceDilate ("Face Dilate", Range(-1,1)) = 0 _FaceDilate ("Face Dilate", Range(-1,1)) = 0
_OutlineColor ("Outline Color", Color) = (0,0,0,1) [HDR]_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_OutlineWidth ("Outline Thickness", Range(0,1)) = 0 _OutlineWidth ("Outline Thickness", Range(0,1)) = 0
_OutlineSoftness ("Outline Softness", Range(0,1)) = 0 _OutlineSoftness ("Outline Softness", Range(0,1)) = 0
_UnderlayColor ("Border Color", Color) = (0,0,0,.5) [HDR]_UnderlayColor ("Border Color", Color) = (0,0,0,.5)
_UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0 _UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0
_UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0 _UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0
_UnderlayDilate ("Border Dilate", Range(-1,1)) = 0 _UnderlayDilate ("Border Dilate", Range(-1,1)) = 0

View File

@ -6,14 +6,14 @@
Shader "TextMeshPro/Mobile/Distance Field" { Shader "TextMeshPro/Mobile/Distance Field" {
Properties { Properties {
_FaceColor ("Face Color", Color) = (1,1,1,1) [HDR]_FaceColor ("Face Color", Color) = (1,1,1,1)
_FaceDilate ("Face Dilate", Range(-1,1)) = 0 _FaceDilate ("Face Dilate", Range(-1,1)) = 0
_OutlineColor ("Outline Color", Color) = (0,0,0,1) [HDR]_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_OutlineWidth ("Outline Thickness", Range(0,1)) = 0 _OutlineWidth ("Outline Thickness", Range(0,1)) = 0
_OutlineSoftness ("Outline Softness", Range(0,1)) = 0 _OutlineSoftness ("Outline Softness", Range(0,1)) = 0
_UnderlayColor ("Border Color", Color) = (0,0,0,.5) [HDR]_UnderlayColor ("Border Color", Color) = (0,0,0,.5)
_UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0 _UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0
_UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0 _UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0
_UnderlayDilate ("Border Dilate", Range(-1,1)) = 0 _UnderlayDilate ("Border Dilate", Range(-1,1)) = 0
@ -81,7 +81,6 @@ SubShader {
Pass { Pass {
CGPROGRAM CGPROGRAM
#pragma enable_d3d11_debug_symbols
#pragma vertex VertShader #pragma vertex VertShader
#pragma fragment PixShader #pragma fragment PixShader
#pragma shader_feature __ OUTLINE_ON #pragma shader_feature __ OUTLINE_ON
@ -99,7 +98,7 @@ SubShader {
float4 vertex : POSITION; float4 vertex : POSITION;
float3 normal : NORMAL; float3 normal : NORMAL;
fixed4 color : COLOR; fixed4 color : COLOR;
float4 texcoord0 : TEXCOORD0; float2 texcoord0 : TEXCOORD0;
float2 texcoord1 : TEXCOORD1; float2 texcoord1 : TEXCOORD1;
}; };
@ -118,9 +117,6 @@ SubShader {
#endif #endif
}; };
float _UIMaskSoftnessX;
float _UIMaskSoftnessY;
int _UIVertexColorAlwaysGammaSpace;
pixel_t VertShader(vertex_t input) pixel_t VertShader(vertex_t input)
{ {
@ -131,7 +127,7 @@ SubShader {
UNITY_TRANSFER_INSTANCE_ID(input, output); UNITY_TRANSFER_INSTANCE_ID(input, output);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
float bold = step(input.texcoord0.w, 0); float bold = step(input.texcoord1.y, 0);
float4 vert = input.vertex; float4 vert = input.vertex;
vert.x += _VertexOffsetX; vert.x += _VertexOffsetX;
@ -142,7 +138,7 @@ SubShader {
pixelSize /= float2(_ScaleX, _ScaleY) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); pixelSize /= float2(_ScaleX, _ScaleY) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy));
float scale = rsqrt(dot(pixelSize, pixelSize)); float scale = rsqrt(dot(pixelSize, pixelSize));
scale *= abs(input.texcoord0.w) * _GradientScale * (_Sharpness + 1); scale *= abs(input.texcoord1.y) * _GradientScale * (_Sharpness + 1);
if(UNITY_MATRIX_P[3][3] == 0) scale = lerp(abs(scale) * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(input.normal.xyz), normalize(WorldSpaceViewDir(vert))))); if(UNITY_MATRIX_P[3][3] == 0) scale = lerp(abs(scale) * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(input.normal.xyz), normalize(WorldSpaceViewDir(vert)))));
float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0; float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0;
@ -154,11 +150,7 @@ SubShader {
float bias = (0.5 - weight) * scale - 0.5; float bias = (0.5 - weight) * scale - 0.5;
float outline = _OutlineWidth * _ScaleRatioA * 0.5 * scale; float outline = _OutlineWidth * _ScaleRatioA * 0.5 * scale;
if (_UIVertexColorAlwaysGammaSpace && !IsGammaSpace()) float opacity = input.color.a;
{
input.color.rgb = UIGammaToLinear(input.color.rgb);
}
float opacity = input.color.a;
#if (UNDERLAY_ON | UNDERLAY_INNER) #if (UNDERLAY_ON | UNDERLAY_INNER)
opacity = 1.0; opacity = 1.0;
#endif #endif
@ -190,9 +182,7 @@ SubShader {
output.outlineColor = outlineColor; output.outlineColor = outlineColor;
output.texcoord0 = float4(input.texcoord0.x, input.texcoord0.y, maskUV.x, maskUV.y); output.texcoord0 = float4(input.texcoord0.x, input.texcoord0.y, maskUV.x, maskUV.y);
output.param = half4(scale, bias - outline, bias + outline, bias); output.param = half4(scale, bias - outline, bias + outline, bias);
output.mask = half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy));
const half2 maskSoftness = half2(max(_UIMaskSoftnessX, _MaskSoftnessX), max(_UIMaskSoftnessY, _MaskSoftnessY));
output.mask = half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * maskSoftness + pixelSize.xy));
#if (UNDERLAY_ON || UNDERLAY_INNER) #if (UNDERLAY_ON || UNDERLAY_INNER)
output.texcoord1 = float4(input.texcoord0 + layerOffset, input.color.a, 0); output.texcoord1 = float4(input.texcoord0 + layerOffset, input.color.a, 0);
output.underlayParam = half2(layerScale, layerBias); output.underlayParam = half2(layerScale, layerBias);

View File

@ -7,15 +7,15 @@ Shader "TextMeshPro/Mobile/Distance Field (Surface)" {
Properties { Properties {
_FaceTex ("Fill Texture", 2D) = "white" {} _FaceTex ("Fill Texture", 2D) = "white" {}
_FaceColor ("Fill Color", Color) = (1,1,1,1) [HDR]_FaceColor ("Fill Color", Color) = (1,1,1,1)
_FaceDilate ("Face Dilate", Range(-1,1)) = 0 _FaceDilate ("Face Dilate", Range(-1,1)) = 0
_OutlineColor ("Outline Color", Color) = (0,0,0,1) [HDR]_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_OutlineTex ("Outline Texture", 2D) = "white" {} _OutlineTex ("Outline Texture", 2D) = "white" {}
_OutlineWidth ("Outline Thickness", Range(0, 1)) = 0 _OutlineWidth ("Outline Thickness", Range(0, 1)) = 0
_OutlineSoftness ("Outline Softness", Range(0,1)) = 0 _OutlineSoftness ("Outline Softness", Range(0,1)) = 0
_GlowColor ("Color", Color) = (0, 1, 0, 0.5) [HDR]_GlowColor ("Color", Color) = (0, 1, 0, 0.5)
_GlowOffset ("Offset", Range(-1,1)) = 0 _GlowOffset ("Offset", Range(-1,1)) = 0
_GlowInner ("Inner", Range(0,1)) = 0.05 _GlowInner ("Inner", Range(0,1)) = 0.05
_GlowOuter ("Outer", Range(0,1)) = 0.05 _GlowOuter ("Outer", Range(0,1)) = 0.05
@ -99,8 +99,7 @@ SubShader {
#pragma multi_compile_shadowcaster #pragma multi_compile_shadowcaster
#include "UnityCG.cginc" #include "UnityCG.cginc"
struct v2f struct v2f {
{
V2F_SHADOW_CASTER; V2F_SHADOW_CASTER;
float2 uv : TEXCOORD1; float2 uv : TEXCOORD1;
float2 uv2 : TEXCOORD3; float2 uv2 : TEXCOORD3;

View File

@ -4,10 +4,10 @@ Properties {
_FaceTex ("Fill Texture", 2D) = "white" {} _FaceTex ("Fill Texture", 2D) = "white" {}
_FaceUVSpeedX ("Face UV Speed X", Range(-5, 5)) = 0.0 _FaceUVSpeedX ("Face UV Speed X", Range(-5, 5)) = 0.0
_FaceUVSpeedY ("Face UV Speed Y", Range(-5, 5)) = 0.0 _FaceUVSpeedY ("Face UV Speed Y", Range(-5, 5)) = 0.0
_FaceColor ("Fill Color", Color) = (1,1,1,1) [HDR]_FaceColor ("Fill Color", Color) = (1,1,1,1)
_FaceDilate ("Face Dilate", Range(-1,1)) = 0 _FaceDilate ("Face Dilate", Range(-1,1)) = 0
_OutlineColor ("Outline Color", Color) = (0,0,0,1) [HDR]_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_OutlineTex ("Outline Texture", 2D) = "white" {} _OutlineTex ("Outline Texture", 2D) = "white" {}
_OutlineUVSpeedX ("Outline UV Speed X", Range(-5, 5)) = 0.0 _OutlineUVSpeedX ("Outline UV Speed X", Range(-5, 5)) = 0.0
_OutlineUVSpeedY ("Outline UV Speed Y", Range(-5, 5)) = 0.0 _OutlineUVSpeedY ("Outline UV Speed Y", Range(-5, 5)) = 0.0
@ -28,12 +28,12 @@ Properties {
_ReflectOutlineColor ("Outline Color", Color) = (0,0,0,1) _ReflectOutlineColor ("Outline Color", Color) = (0,0,0,1)
_Cube ("Reflection Cubemap", Cube) = "black" { /* TexGen CubeReflect */ } _Cube ("Reflection Cubemap", Cube) = "black" { /* TexGen CubeReflect */ }
_EnvMatrixRotation ("Texture Rotation", vector) = (0, 0, 0, 0) _EnvMatrixRotation ("Texture Rotation", vector) = (0, 0, 0, 0)
_SpecColor ("Specular Color", Color) = (0,0,0,1) [HDR]_SpecColor ("Specular Color", Color) = (0,0,0,1)
_FaceShininess ("Face Shininess", Range(0,1)) = 0 _FaceShininess ("Face Shininess", Range(0,1)) = 0
_OutlineShininess ("Outline Shininess", Range(0,1)) = 0 _OutlineShininess ("Outline Shininess", Range(0,1)) = 0
_GlowColor ("Color", Color) = (0, 1, 0, 0.5) [HDR]_GlowColor ("Color", Color) = (0, 1, 0, 0.5)
_GlowOffset ("Offset", Range(-1,1)) = 0 _GlowOffset ("Offset", Range(-1,1)) = 0
_GlowInner ("Inner", Range(0,1)) = 0.05 _GlowInner ("Inner", Range(0,1)) = 0.05
_GlowOuter ("Outer", Range(0,1)) = 0.05 _GlowOuter ("Outer", Range(0,1)) = 0.05
@ -118,8 +118,7 @@ SubShader {
#pragma multi_compile_shadowcaster #pragma multi_compile_shadowcaster
#include "UnityCG.cginc" #include "UnityCG.cginc"
struct v2f struct v2f {
{
V2F_SHADOW_CASTER; V2F_SHADOW_CASTER;
float2 uv : TEXCOORD1; float2 uv : TEXCOORD1;
float2 uv2 : TEXCOORD3; float2 uv2 : TEXCOORD3;

View File

@ -4,10 +4,10 @@ Properties {
_FaceTex ("Face Texture", 2D) = "white" {} _FaceTex ("Face Texture", 2D) = "white" {}
_FaceUVSpeedX ("Face UV Speed X", Range(-5, 5)) = 0.0 _FaceUVSpeedX ("Face UV Speed X", Range(-5, 5)) = 0.0
_FaceUVSpeedY ("Face UV Speed Y", Range(-5, 5)) = 0.0 _FaceUVSpeedY ("Face UV Speed Y", Range(-5, 5)) = 0.0
_FaceColor ("Face Color", Color) = (1,1,1,1) [HDR]_FaceColor ("Face Color", Color) = (1,1,1,1)
_FaceDilate ("Face Dilate", Range(-1,1)) = 0 _FaceDilate ("Face Dilate", Range(-1,1)) = 0
_OutlineColor ("Outline Color", Color) = (0,0,0,1) [HDR]_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_OutlineTex ("Outline Texture", 2D) = "white" {} _OutlineTex ("Outline Texture", 2D) = "white" {}
_OutlineUVSpeedX ("Outline UV Speed X", Range(-5, 5)) = 0.0 _OutlineUVSpeedX ("Outline UV Speed X", Range(-5, 5)) = 0.0
_OutlineUVSpeedY ("Outline UV Speed Y", Range(-5, 5)) = 0.0 _OutlineUVSpeedY ("Outline UV Speed Y", Range(-5, 5)) = 0.0
@ -21,7 +21,7 @@ Properties {
_BevelRoundness ("Bevel Roundness", Range(0,1)) = 0 _BevelRoundness ("Bevel Roundness", Range(0,1)) = 0
_LightAngle ("Light Angle", Range(0.0, 6.2831853)) = 3.1416 _LightAngle ("Light Angle", Range(0.0, 6.2831853)) = 3.1416
_SpecularColor ("Specular", Color) = (1,1,1,1) [HDR]_SpecularColor ("Specular", Color) = (1,1,1,1)
_SpecularPower ("Specular", Range(0,4)) = 2.0 _SpecularPower ("Specular", Range(0,4)) = 2.0
_Reflectivity ("Reflectivity", Range(5.0,15.0)) = 10 _Reflectivity ("Reflectivity", Range(5.0,15.0)) = 10
_Diffuse ("Diffuse", Range(0,1)) = 0.5 _Diffuse ("Diffuse", Range(0,1)) = 0.5
@ -37,13 +37,13 @@ Properties {
_EnvMatrixRotation ("Texture Rotation", vector) = (0, 0, 0, 0) _EnvMatrixRotation ("Texture Rotation", vector) = (0, 0, 0, 0)
_UnderlayColor ("Border Color", Color) = (0,0,0, 0.5) [HDR]_UnderlayColor ("Border Color", Color) = (0,0,0, 0.5)
_UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0 _UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0
_UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0 _UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0
_UnderlayDilate ("Border Dilate", Range(-1,1)) = 0 _UnderlayDilate ("Border Dilate", Range(-1,1)) = 0
_UnderlaySoftness ("Border Softness", Range(0,1)) = 0 _UnderlaySoftness ("Border Softness", Range(0,1)) = 0
_GlowColor ("Color", Color) = (0, 1, 0, 0.5) [HDR]_GlowColor ("Color", Color) = (0, 1, 0, 0.5)
_GlowOffset ("Offset", Range(-1,1)) = 0 _GlowOffset ("Offset", Range(-1,1)) = 0
_GlowInner ("Inner", Range(0,1)) = 0.05 _GlowInner ("Inner", Range(0,1)) = 0.05
_GlowOuter ("Outer", Range(0,1)) = 0.05 _GlowOuter ("Outer", Range(0,1)) = 0.05
@ -127,18 +127,17 @@ SubShader {
#include "TMPro_Properties.cginc" #include "TMPro_Properties.cginc"
#include "TMPro.cginc" #include "TMPro.cginc"
struct vertex_t struct vertex_t {
{
UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_INPUT_INSTANCE_ID
float4 position : POSITION; float4 position : POSITION;
float3 normal : NORMAL; float3 normal : NORMAL;
fixed4 color : COLOR; fixed4 color : COLOR;
float4 texcoord0 : TEXCOORD0; float2 texcoord0 : TEXCOORD0;
float2 texcoord1 : TEXCOORD1; float2 texcoord1 : TEXCOORD1;
}; };
struct pixel_t
{ struct pixel_t {
UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO UNITY_VERTEX_OUTPUT_STEREO
float4 position : SV_POSITION; float4 position : SV_POSITION;
@ -148,20 +147,16 @@ SubShader {
float4 mask : TEXCOORD2; // Position in object space(xy), pixel Size(zw) float4 mask : TEXCOORD2; // Position in object space(xy), pixel Size(zw)
float3 viewDir : TEXCOORD3; float3 viewDir : TEXCOORD3;
#if (UNDERLAY_ON || UNDERLAY_INNER) #if (UNDERLAY_ON || UNDERLAY_INNER)
float4 texcoord2 : TEXCOORD4; // u,v, scale, bias float4 texcoord2 : TEXCOORD4; // u,v, scale, bias
fixed4 underlayColor : COLOR1; fixed4 underlayColor : COLOR1;
#endif #endif
float4 textures : TEXCOORD5;
float4 textures : TEXCOORD5;
}; };
// Used by Unity internally to handle Texture Tiling and Offset. // Used by Unity internally to handle Texture Tiling and Offset.
float4 _FaceTex_ST; float4 _FaceTex_ST;
float4 _OutlineTex_ST; float4 _OutlineTex_ST;
float _UIMaskSoftnessX;
float _UIMaskSoftnessY;
int _UIVertexColorAlwaysGammaSpace;
pixel_t VertShader(vertex_t input) pixel_t VertShader(vertex_t input)
{ {
@ -172,7 +167,7 @@ SubShader {
UNITY_TRANSFER_INSTANCE_ID(input,output); UNITY_TRANSFER_INSTANCE_ID(input,output);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
float bold = step(input.texcoord0.w, 0); float bold = step(input.texcoord1.y, 0);
float4 vert = input.position; float4 vert = input.position;
vert.x += _VertexOffsetX; vert.x += _VertexOffsetX;
@ -183,7 +178,7 @@ SubShader {
float2 pixelSize = vPosition.w; float2 pixelSize = vPosition.w;
pixelSize /= float2(_ScaleX, _ScaleY) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); pixelSize /= float2(_ScaleX, _ScaleY) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy));
float scale = rsqrt(dot(pixelSize, pixelSize)); float scale = rsqrt(dot(pixelSize, pixelSize));
scale *= abs(input.texcoord0.w) * _GradientScale * (_Sharpness + 1); scale *= abs(input.texcoord1.y) * _GradientScale * (_Sharpness + 1);
if (UNITY_MATRIX_P[3][3] == 0) scale = lerp(abs(scale) * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(input.normal.xyz), normalize(WorldSpaceViewDir(vert))))); if (UNITY_MATRIX_P[3][3] == 0) scale = lerp(abs(scale) * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(input.normal.xyz), normalize(WorldSpaceViewDir(vert)))));
float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0; float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0;
@ -193,13 +188,13 @@ SubShader {
float alphaClip = (1.0 - _OutlineWidth * _ScaleRatioA - _OutlineSoftness * _ScaleRatioA); float alphaClip = (1.0 - _OutlineWidth * _ScaleRatioA - _OutlineSoftness * _ScaleRatioA);
#if GLOW_ON #if GLOW_ON
alphaClip = min(alphaClip, 1.0 - _GlowOffset * _ScaleRatioB - _GlowOuter * _ScaleRatioB); alphaClip = min(alphaClip, 1.0 - _GlowOffset * _ScaleRatioB - _GlowOuter * _ScaleRatioB);
#endif #endif
alphaClip = alphaClip / 2.0 - ( .5 / scale) - weight; alphaClip = alphaClip / 2.0 - ( .5 / scale) - weight;
#if (UNDERLAY_ON || UNDERLAY_INNER) #if (UNDERLAY_ON || UNDERLAY_INNER)
float4 underlayColor = _UnderlayColor; float4 underlayColor = _UnderlayColor;
underlayColor.rgb *= underlayColor.a; underlayColor.rgb *= underlayColor.a;
@ -210,28 +205,23 @@ SubShader {
float x = -(_UnderlayOffsetX * _ScaleRatioC) * _GradientScale / _TextureWidth; float x = -(_UnderlayOffsetX * _ScaleRatioC) * _GradientScale / _TextureWidth;
float y = -(_UnderlayOffsetY * _ScaleRatioC) * _GradientScale / _TextureHeight; float y = -(_UnderlayOffsetY * _ScaleRatioC) * _GradientScale / _TextureHeight;
float2 bOffset = float2(x, y); float2 bOffset = float2(x, y);
#endif #endif
// Generate UV for the Masking Texture // Generate UV for the Masking Texture
float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); float4 clampedRect = clamp(_ClipRect, -2e10, 2e10);
float2 maskUV = (vert.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); float2 maskUV = (vert.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy);
// Support for texture tiling and offset // Support for texture tiling and offset
float2 textureUV = input.texcoord1; float2 textureUV = UnpackUV(input.texcoord1.x);
float2 faceUV = TRANSFORM_TEX(textureUV, _FaceTex); float2 faceUV = TRANSFORM_TEX(textureUV, _FaceTex);
float2 outlineUV = TRANSFORM_TEX(textureUV, _OutlineTex); float2 outlineUV = TRANSFORM_TEX(textureUV, _OutlineTex);
if (_UIVertexColorAlwaysGammaSpace && !IsGammaSpace())
{
input.color.rgb = UIGammaToLinear(input.color.rgb);
}
output.position = vPosition; output.position = vPosition;
output.color = input.color; output.color = input.color;
output.atlas = input.texcoord0; output.atlas = input.texcoord0;
output.param = float4(alphaClip, scale, bias, weight); output.param = float4(alphaClip, scale, bias, weight);
const half2 maskSoftness = half2(max(_UIMaskSoftnessX, _MaskSoftnessX), max(_UIMaskSoftnessY, _MaskSoftnessY)); output.mask = half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy));
output.mask = half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * maskSoftness + pixelSize.xy));
output.viewDir = mul((float3x3)_EnvMatrix, _WorldSpaceCameraPos.xyz - mul(unity_ObjectToWorld, vert).xyz); output.viewDir = mul((float3x3)_EnvMatrix, _WorldSpaceCameraPos.xyz - mul(unity_ObjectToWorld, vert).xyz);
#if (UNDERLAY_ON || UNDERLAY_INNER) #if (UNDERLAY_ON || UNDERLAY_INNER)
output.texcoord2 = float4(input.texcoord0 + bOffset, bScale, bBias); output.texcoord2 = float4(input.texcoord0 + bOffset, bScale, bBias);
@ -249,9 +239,9 @@ SubShader {
float c = tex2D(_MainTex, input.atlas).a; float c = tex2D(_MainTex, input.atlas).a;
#ifndef UNDERLAY_ON #ifndef UNDERLAY_ON
clip(c - input.param.x); clip(c - input.param.x);
#endif #endif
float scale = input.param.y; float scale = input.param.y;
float bias = input.param.z; float bias = input.param.z;
@ -271,7 +261,7 @@ SubShader {
faceColor = GetColor(sd, faceColor, outlineColor, outline, softness); faceColor = GetColor(sd, faceColor, outlineColor, outline, softness);
#if BEVEL_ON #if BEVEL_ON
float3 dxy = float3(0.5 / _TextureWidth, 0.5 / _TextureHeight, 0); float3 dxy = float3(0.5 / _TextureWidth, 0.5 / _TextureHeight, 0);
float3 n = GetSurfaceNormal(input.atlas, weight, dxy); float3 n = GetSurfaceNormal(input.atlas, weight, dxy);
@ -288,35 +278,36 @@ SubShader {
fixed4 reflcol = texCUBE(_Cube, reflect(input.viewDir, -n)); fixed4 reflcol = texCUBE(_Cube, reflect(input.viewDir, -n));
faceColor.rgb += reflcol.rgb * lerp(_ReflectFaceColor.rgb, _ReflectOutlineColor.rgb, saturate(sd + outline * 0.5)) * faceColor.a; faceColor.rgb += reflcol.rgb * lerp(_ReflectFaceColor.rgb, _ReflectOutlineColor.rgb, saturate(sd + outline * 0.5)) * faceColor.a;
#endif #endif
#if UNDERLAY_ON #if UNDERLAY_ON
float d = tex2D(_MainTex, input.texcoord2.xy).a * input.texcoord2.z; float d = tex2D(_MainTex, input.texcoord2.xy).a * input.texcoord2.z;
faceColor += input.underlayColor * saturate(d - input.texcoord2.w) * (1 - faceColor.a); faceColor += input.underlayColor * saturate(d - input.texcoord2.w) * (1 - faceColor.a);
#endif #endif
#if UNDERLAY_INNER #if UNDERLAY_INNER
float d = tex2D(_MainTex, input.texcoord2.xy).a * input.texcoord2.z; float d = tex2D(_MainTex, input.texcoord2.xy).a * input.texcoord2.z;
faceColor += input.underlayColor * (1 - saturate(d - input.texcoord2.w)) * saturate(1 - sd) * (1 - faceColor.a); faceColor += input.underlayColor * (1 - saturate(d - input.texcoord2.w)) * saturate(1 - sd) * (1 - faceColor.a);
#endif #endif
#if GLOW_ON #if GLOW_ON
float4 glowColor = GetGlowColor(sd, scale); float4 glowColor = GetGlowColor(sd, scale);
faceColor.rgb += glowColor.rgb * glowColor.a; faceColor.rgb += glowColor.rgb * glowColor.a;
#endif #endif
// Alternative implementation to UnityGet2DClipping with support for softness. // Alternative implementation to UnityGet2DClipping with support for softness.
#if UNITY_UI_CLIP_RECT #if UNITY_UI_CLIP_RECT
half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * input.mask.zw); half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * input.mask.zw);
faceColor *= m.x * m.y; faceColor *= m.x * m.y;
#endif #endif
#if UNITY_UI_ALPHACLIP #if UNITY_UI_ALPHACLIP
clip(faceColor.a - 0.001); clip(faceColor.a - 0.001);
#endif #endif
return faceColor * input.color.a; return faceColor * input.color.a;
} }
ENDCG ENDCG
} }
} }

View File

@ -2,18 +2,18 @@ Shader "TextMeshPro/Sprite"
{ {
Properties Properties
{ {
_MainTex ("Sprite Texture", 2D) = "white" {} [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1) _Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8 _StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0 _Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0 _StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255 _StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255 _StencilReadMask ("Stencil Read Mask", Float) = 255
_CullMode ("Cull Mode", Float) = 0 _CullMode ("Cull Mode", Float) = 0
_ColorMask ("Color Mask", Float) = 15 _ColorMask ("Color Mask", Float) = 15
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767) _ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
} }
@ -21,19 +21,19 @@ Shader "TextMeshPro/Sprite"
SubShader SubShader
{ {
Tags Tags
{ {
"Queue"="Transparent" "Queue"="Transparent"
"IgnoreProjector"="True" "IgnoreProjector"="True"
"RenderType"="Transparent" "RenderType"="Transparent"
"PreviewType"="Plane" "PreviewType"="Plane"
"CanUseSpriteAtlas"="True" "CanUseSpriteAtlas"="True"
} }
Stencil Stencil
{ {
Ref [_Stencil] Ref [_Stencil]
Comp [_StencilComp] Comp [_StencilComp]
Pass [_StencilOp] Pass [_StencilOp]
ReadMask [_StencilReadMask] ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask] WriteMask [_StencilWriteMask]
} }
@ -58,7 +58,7 @@ Shader "TextMeshPro/Sprite"
#pragma multi_compile __ UNITY_UI_CLIP_RECT #pragma multi_compile __ UNITY_UI_CLIP_RECT
#pragma multi_compile __ UNITY_UI_ALPHACLIP #pragma multi_compile __ UNITY_UI_ALPHACLIP
struct appdata_t struct appdata_t
{ {
float4 vertex : POSITION; float4 vertex : POSITION;
@ -69,43 +69,29 @@ Shader "TextMeshPro/Sprite"
struct v2f struct v2f
{ {
float4 vertex : SV_POSITION; float4 vertex : SV_POSITION;
fixed4 color : COLOR; fixed4 color : COLOR;
float2 texcoord : TEXCOORD0; float2 texcoord : TEXCOORD0;
float4 worldPosition : TEXCOORD1; float4 worldPosition : TEXCOORD1;
float4 mask : TEXCOORD2;
UNITY_VERTEX_OUTPUT_STEREO UNITY_VERTEX_OUTPUT_STEREO
}; };
sampler2D _MainTex; sampler2D _MainTex;
fixed4 _Color; fixed4 _Color;
fixed4 _TextureSampleAdd; fixed4 _TextureSampleAdd;
float4 _ClipRect; float4 _ClipRect;
float4 _MainTex_ST; float4 _MainTex_ST;
float _UIMaskSoftnessX;
float _UIMaskSoftnessY;
int _UIVertexColorAlwaysGammaSpace;
v2f vert(appdata_t v) v2f vert(appdata_t v)
{ {
v2f OUT; v2f OUT;
UNITY_SETUP_INSTANCE_ID(v); UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
float4 vPosition = UnityObjectToClipPos(v.vertex); OUT.worldPosition = v.vertex;
OUT.worldPosition = v.vertex; OUT.vertex = UnityObjectToClipPos(OUT.worldPosition);
OUT.vertex = vPosition;
float2 pixelSize = vPosition.w;
pixelSize /= abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy));
float4 clampedRect = clamp(_ClipRect, -2e10, 2e10);
OUT.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); OUT.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
OUT.mask = half4(v.vertex.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_UIMaskSoftnessX, _UIMaskSoftnessY) + abs(pixelSize.xy)));
if (_UIVertexColorAlwaysGammaSpace && !IsGammaSpace())
{
v.color.rgb = UIGammaToLinear(v.color.rgb);
}
OUT.color = v.color * _Color; OUT.color = v.color * _Color;
return OUT; return OUT;
} }
@ -113,10 +99,9 @@ Shader "TextMeshPro/Sprite"
fixed4 frag(v2f IN) : SV_Target fixed4 frag(v2f IN) : SV_Target
{ {
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color; half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color;
#if UNITY_UI_CLIP_RECT #ifdef UNITY_UI_CLIP_RECT
half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
color *= m.x * m.y;
#endif #endif
#ifdef UNITY_UI_ALPHACLIP #ifdef UNITY_UI_ALPHACLIP
@ -125,7 +110,7 @@ Shader "TextMeshPro/Sprite"
return color; return color;
} }
ENDCG ENDCG
} }
} }
} }

View File

@ -4,6 +4,6 @@ ShaderImporter:
externalObjects: {} externalObjects: {}
defaultTextures: [] defaultTextures: []
nonModifiableTextures: [] nonModifiableTextures: []
userData: Version 2.0 userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:

View File

@ -1,22 +1,20 @@
struct vertex_t struct vertex_t {
{
UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_INPUT_INSTANCE_ID
float4 position : POSITION; float4 position : POSITION;
float3 normal : NORMAL; float3 normal : NORMAL;
float4 color : COLOR; float4 color : COLOR;
float4 texcoord0 : TEXCOORD0; float2 texcoord0 : TEXCOORD0;
float2 texcoord1 : TEXCOORD1; float2 texcoord1 : TEXCOORD1;
}; };
struct pixel_t struct pixel_t {
{
UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO UNITY_VERTEX_OUTPUT_STEREO
float4 position : SV_POSITION; float4 position : SV_POSITION;
float4 faceColor : COLOR; float4 faceColor : COLOR;
float4 outlineColor : COLOR1; float4 outlineColor : COLOR1;
float4 texcoord0 : TEXCOORD0; float4 texcoord0 : TEXCOORD0;
float4 param : TEXCOORD1; // x = weight, y = no longer used float4 param : TEXCOORD1; // weight, scaleRatio
float2 mask : TEXCOORD2; float2 mask : TEXCOORD2;
#if (UNDERLAY_ON || UNDERLAY_INNER) #if (UNDERLAY_ON || UNDERLAY_INNER)
float4 texcoord2 : TEXCOORD3; float4 texcoord2 : TEXCOORD3;
@ -24,14 +22,10 @@ struct pixel_t
#endif #endif
}; };
float4 SRGBToLinear(float4 rgba) float4 SRGBToLinear(float4 rgba) {
{
return float4(lerp(rgba.rgb / 12.92f, pow((rgba.rgb + 0.055f) / 1.055f, 2.4f), step(0.04045f, rgba.rgb)), rgba.a); return float4(lerp(rgba.rgb / 12.92f, pow((rgba.rgb + 0.055f) / 1.055f, 2.4f), step(0.04045f, rgba.rgb)), rgba.a);
} }
float _UIMaskSoftnessX;
float _UIMaskSoftnessY;
pixel_t VertShader(vertex_t input) pixel_t VertShader(vertex_t input)
{ {
pixel_t output; pixel_t output;
@ -41,7 +35,7 @@ pixel_t VertShader(vertex_t input)
UNITY_TRANSFER_INSTANCE_ID(input, output); UNITY_TRANSFER_INSTANCE_ID(input, output);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
float bold = step(input.texcoord0.w, 0); float bold = step(input.texcoord1.y, 0);
float4 vert = input.position; float4 vert = input.position;
vert.x += _VertexOffsetX; vert.x += _VertexOffsetX;
@ -77,7 +71,7 @@ pixel_t VertShader(vertex_t input)
output.faceColor = faceColor; output.faceColor = faceColor;
output.outlineColor = outlineColor; output.outlineColor = outlineColor;
output.texcoord0 = float4(input.texcoord0.xy, maskUV.xy); output.texcoord0 = float4(input.texcoord0.xy, maskUV.xy);
output.param = float4(0.5 - weight, 0, _OutlineWidth * _ScaleRatioA * 0.5, 0); output.param = float4(0.5 - weight, 1.3333 * _GradientScale * (_Sharpness + 1) / _TextureWidth, _OutlineWidth * _ScaleRatioA * 0.5, 0);
float2 mask = float2(0, 0); float2 mask = float2(0, 0);
#if UNITY_UI_CLIP_RECT #if UNITY_UI_CLIP_RECT
@ -105,9 +99,8 @@ float4 PixShader(pixel_t input) : SV_Target
float d = tex2D(_MainTex, input.texcoord0.xy).a; float d = tex2D(_MainTex, input.texcoord0.xy).a;
float pixelSize = abs(ddx(input.texcoord0.y)) + abs(ddy(input.texcoord0.y)); float2 UV = input.texcoord0.xy;
pixelSize *= _TextureHeight * 0.75; float scale = rsqrt(abs(ddx(UV.x) * ddy(UV.y) - ddy(UV.x) * ddx(UV.y))) * input.param.y;
float scale = 1 / pixelSize * _GradientScale * (_Sharpness + 1);
#if (UNDERLAY_ON | UNDERLAY_INNER) #if (UNDERLAY_ON | UNDERLAY_INNER)
float layerScale = scale; float layerScale = scale;
@ -119,7 +112,7 @@ float4 PixShader(pixel_t input) : SV_Target
float4 faceColor = input.faceColor * saturate((d - input.param.x) * scale + 0.5); float4 faceColor = input.faceColor * saturate((d - input.param.x) * scale + 0.5);
#if OUTLINE_ON #ifdef OUTLINE_ON
float4 outlineColor = lerp(input.faceColor, input.outlineColor, sqrt(min(1.0, input.param.z * scale * 2))); float4 outlineColor = lerp(input.faceColor, input.outlineColor, sqrt(min(1.0, input.param.z * scale * 2)));
faceColor = lerp(outlineColor, input.faceColor, saturate((d - input.param.x - input.param.z) * scale + 0.5)); faceColor = lerp(outlineColor, input.faceColor, saturate((d - input.param.x - input.param.z) * scale + 0.5));
faceColor *= saturate((d - input.param.x + input.param.z) * scale + 0.5); faceColor *= saturate((d - input.param.x + input.param.z) * scale + 0.5);
@ -137,7 +130,7 @@ float4 PixShader(pixel_t input) : SV_Target
faceColor += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * (1 - saturate(d - layerBias)) * sd * (1 - faceColor.a); faceColor += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * (1 - saturate(d - layerBias)) * sd * (1 - faceColor.a);
#endif #endif
#if MASKING #ifdef MASKING
float a = abs(_MaskInverse - tex2D(_MaskTex, input.texcoord0.zw).a); float a = abs(_MaskInverse - tex2D(_MaskTex, input.texcoord0.zw).a);
float t = a + (1 - _MaskWipeControl) * _MaskEdgeSoftness - _MaskWipeControl; float t = a + (1 - _MaskWipeControl) * _MaskEdgeSoftness - _MaskWipeControl;
a = saturate(t / _MaskEdgeSoftness); a = saturate(t / _MaskEdgeSoftness);
@ -147,8 +140,7 @@ float4 PixShader(pixel_t input) : SV_Target
// Alternative implementation to UnityGet2DClipping with support for softness // Alternative implementation to UnityGet2DClipping with support for softness
#if UNITY_UI_CLIP_RECT #if UNITY_UI_CLIP_RECT
half2 maskSoftness = half2(max(_UIMaskSoftnessX, _MaskSoftnessX), max(_UIMaskSoftnessY, _MaskSoftnessY)); float2 maskZW = 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + (1 / scale));
float2 maskZW = 0.25 / (0.25 * maskSoftness + 1 / scale);
float2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * maskZW); float2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * maskZW);
faceColor *= m.x * m.y; faceColor *= m.x * m.y;
#endif #endif

View File

@ -66,6 +66,11 @@ uniform float _MaskID;
uniform sampler2D _MaskTex; uniform sampler2D _MaskTex;
uniform float4 _MaskCoord; uniform float4 _MaskCoord;
uniform float4 _ClipRect; // bottom left(x,y) : top right(z,w) uniform float4 _ClipRect; // bottom left(x,y) : top right(z,w)
//uniform float _MaskWipeControl;
//uniform float _MaskEdgeSoftness;
//uniform fixed4 _MaskEdgeColor;
//uniform bool _MaskInverse;
uniform float _MaskSoftnessX; uniform float _MaskSoftnessX;
uniform float _MaskSoftnessY; uniform float _MaskSoftnessY;

Some files were not shown because too many files have changed in this diff Show More