整合包
gameplay bundle has been imported together
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5eee4bce0820aea429b1343e0a960377
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,55 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
using UnityEditor.UI;
|
||||
|
||||
[CustomEditor(typeof(UI_Image), true)]
|
||||
[CanEditMultipleObjects]
|
||||
public class UI_Image_Editor : ImageEditor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
|
||||
UI_Image uiSkewImage = (UI_Image)target;
|
||||
EditorGUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
|
||||
if (GUILayout.Button("重置", GUILayout.Width(40)))
|
||||
{
|
||||
uiSkewImage.OffsetLeftTop = Vector3.zero;
|
||||
}
|
||||
uiSkewImage.OffsetLeftTop = EditorGUILayout.Vector3Field("左上", uiSkewImage.OffsetLeftTop, GUILayout.ExpandWidth(true));
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
|
||||
if (GUILayout.Button("重置", GUILayout.Width(40)))
|
||||
{
|
||||
uiSkewImage.OffsetRightTop = Vector3.zero;
|
||||
}
|
||||
uiSkewImage.OffsetRightTop = EditorGUILayout.Vector3Field("右上", uiSkewImage.OffsetRightTop, GUILayout.ExpandWidth(true));
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
|
||||
if (GUILayout.Button("重置", GUILayout.Width(40)))
|
||||
{
|
||||
uiSkewImage.OffsetLeftButtom = Vector3.zero;
|
||||
}
|
||||
uiSkewImage.OffsetLeftButtom = EditorGUILayout.Vector3Field("左下", uiSkewImage.OffsetLeftButtom, GUILayout.ExpandWidth(true));
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
|
||||
if (GUILayout.Button("重置", GUILayout.Width(40)))
|
||||
{
|
||||
uiSkewImage.OffsetRightButtom = Vector3.zero;
|
||||
}
|
||||
uiSkewImage.OffsetRightButtom = EditorGUILayout.Vector3Field("右下", uiSkewImage.OffsetRightButtom, GUILayout.ExpandWidth(true));
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
EditorUtility.SetDirty(uiSkewImage);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8b2fcb9535ec47543b0734cac9e6f031
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
using UnityEditor.UI;
|
||||
|
||||
[CustomEditor(typeof(UI_Text_Mesh_Modify), true)]
|
||||
[CanEditMultipleObjects]
|
||||
public class UI_Text_Mesh_Modify_Editor : ImageEditor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
|
||||
var type = (UI_Text_Mesh_Modify)target;
|
||||
EditorGUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
|
||||
if (GUILayout.Button("预览", GUILayout.Width(40)))
|
||||
{
|
||||
type.Prv();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c02bcc439d935a040807d174c586b52b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* FancyScrollView (https://github.com/setchi/FancyScrollView)
|
||||
* Copyright (c) 2020 setchi
|
||||
* Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
namespace FancyScrollView.Example01
|
||||
{
|
||||
class ItemData
|
||||
{
|
||||
public string Message { get; }
|
||||
|
||||
public ItemData(string message)
|
||||
{
|
||||
Message = message;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fe195dccef0874cf9b6f90eb82e8bb4d
|
||||
timeCreated: 1552490564
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* FancyScrollView (https://github.com/setchi/FancyScrollView)
|
||||
* Copyright (c) 2020 setchi
|
||||
* Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FancyScrollView.Example01
|
||||
{
|
||||
class ScrollView : FancyScrollView<ItemData>
|
||||
{
|
||||
[SerializeField] Scroller scroller = default;
|
||||
public Scroller Scroller => scroller;
|
||||
[SerializeField] GameObject cellPrefab = default;
|
||||
|
||||
protected override GameObject CellPrefab => cellPrefab;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
scroller.OnValueChanged(UpdatePosition);
|
||||
}
|
||||
|
||||
public void UpdateData(IList<ItemData> items)
|
||||
{
|
||||
UpdateContents(items);
|
||||
scroller.SetTotalCount(items.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c7e0222f92bdad84c9ee57a127efe088
|
||||
timeCreated: 1487262733
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,27 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class UI_Button_Character : MonoBehaviour
|
||||
{
|
||||
public Toggle Toggle;
|
||||
public TMP_Text Text;
|
||||
public Character_Data_SO so;
|
||||
private void Awake()
|
||||
{
|
||||
Toggle.onValueChanged.AddListener(Click);
|
||||
}
|
||||
public void Init()
|
||||
{
|
||||
Toggle.onValueChanged.RemoveListener(Click);
|
||||
Toggle.onValueChanged.AddListener(Click);
|
||||
Toggle.isOn = true;
|
||||
}
|
||||
void Click(bool isOn)
|
||||
{
|
||||
Toggle.interactable = !isOn;
|
||||
Toggle.image.gameObject.SetActive(!isOn);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 79ecac4eaa15bce4c80bab018f9bc0f1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class UI_Button_Character_Head_Slot : MonoBehaviour
|
||||
{
|
||||
public int index;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fbbb25f6435a6ce4fa7b1442ef1b0f9b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,71 @@
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
[DisallowMultipleComponent]
|
||||
[RequireComponent(typeof(RectTransform))]
|
||||
[RequireComponent(typeof(CanvasRenderer))]
|
||||
[AddComponentMenu("UI/UI_Image", 99)]
|
||||
[ExecuteInEditMode]
|
||||
public class UI_Image : Image {
|
||||
[SerializeField]
|
||||
private Vector3 offsetLeftButtom = Vector3.zero;
|
||||
public Vector3 OffsetLeftButtom{
|
||||
get{return offsetLeftButtom;}
|
||||
set{
|
||||
offsetLeftButtom = value;
|
||||
SetAllDirty();
|
||||
}
|
||||
}
|
||||
[SerializeField]
|
||||
private Vector3 offsetRightButtom = Vector3.zero;
|
||||
public Vector3 OffsetRightButtom{
|
||||
get{return offsetRightButtom;}
|
||||
set{
|
||||
offsetRightButtom = value;
|
||||
SetAllDirty();
|
||||
}
|
||||
}
|
||||
[SerializeField]
|
||||
private Vector3 offsetLeftTop = Vector3.zero;
|
||||
public Vector3 OffsetLeftTop{
|
||||
get{return offsetLeftTop;}
|
||||
set{
|
||||
offsetLeftTop = value;
|
||||
SetAllDirty();
|
||||
}
|
||||
}
|
||||
[SerializeField]
|
||||
private Vector3 offsetRightTop = Vector3.zero;
|
||||
public Vector3 OffsetRightTop{
|
||||
get{return offsetRightTop;}
|
||||
set{
|
||||
offsetRightTop = value;
|
||||
SetAllDirty();
|
||||
}
|
||||
}
|
||||
Vector3 GetOffsetVector(int i){
|
||||
if (i == 0){
|
||||
return offsetLeftButtom;
|
||||
}else if (i == 1){
|
||||
return offsetLeftTop;
|
||||
}else if (i == 2){
|
||||
return offsetRightTop;
|
||||
}else {
|
||||
return offsetRightButtom;
|
||||
}
|
||||
}
|
||||
protected override void OnPopulateMesh(VertexHelper toFill){
|
||||
base.OnPopulateMesh(toFill);
|
||||
int count = toFill.currentVertCount;
|
||||
for(int i=0;i<count;i++){
|
||||
UIVertex vertex = new UIVertex();
|
||||
toFill.PopulateUIVertex(ref vertex, i);
|
||||
// Debug.Log(i.ToString() + ": " + oldPosition[i].ToString());
|
||||
vertex.position += GetOffsetVector(i);
|
||||
toFill.SetUIVertex(vertex, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 56caaebe706267c419c17572b87c356e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,77 @@
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
|
||||
public class UI_Text_Mesh_Modify : MonoBehaviour //BaseMeshEffect
|
||||
{
|
||||
public TextMeshProUGUI tmp;
|
||||
public float value = 0;
|
||||
public Vector3 offset = new();
|
||||
public Vector2Int index;
|
||||
|
||||
public void Prv()
|
||||
{
|
||||
LateUpdate();
|
||||
}
|
||||
private void Awake()
|
||||
{
|
||||
if (tmp == null)
|
||||
{
|
||||
tmp = GetComponent<TextMeshProUGUI>();
|
||||
}
|
||||
}
|
||||
void LateUpdate()
|
||||
{
|
||||
if (tmp == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
tmp.ForceMeshUpdate();
|
||||
|
||||
var textInfo = tmp.textInfo;
|
||||
for (int i = 0; i < textInfo.characterCount; i++)
|
||||
{
|
||||
TMP_CharacterInfo char_Info_Cur = textInfo.characterInfo[i];
|
||||
TMP_MeshInfo mesh_Info_Cur = textInfo.meshInfo[char_Info_Cur.materialReferenceIndex];
|
||||
|
||||
|
||||
int Vertex_Index;
|
||||
if (i < textInfo.characterCount - 1)
|
||||
{
|
||||
TMP_CharacterInfo nextCharInfo = textInfo.characterInfo[i + 1];
|
||||
Vertex_Index = nextCharInfo.vertexIndex - char_Info_Cur.vertexIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
Vertex_Index = mesh_Info_Cur.vertices.Length - char_Info_Cur.vertexIndex;
|
||||
}
|
||||
|
||||
int Vertex_Index_Cur_Start = char_Info_Cur.vertexIndex;
|
||||
|
||||
|
||||
Vector3 pos = new();
|
||||
|
||||
Vector3[] mesh_Vertices = mesh_Info_Cur.vertices;
|
||||
for (int j = Vertex_Index_Cur_Start; j < Vertex_Index_Cur_Start + Vertex_Index; j++)
|
||||
{
|
||||
pos = new Vector3(0, offset.y * i, 0);
|
||||
if (j % 4 == index.x)
|
||||
{
|
||||
pos += new Vector3(0, value, 0);
|
||||
}
|
||||
if (j % 4 == index.y)
|
||||
{
|
||||
pos += new Vector3(0, value, 0);
|
||||
}
|
||||
mesh_Vertices[j] = mesh_Vertices[j] + pos;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (int i = 0; i < textInfo.meshInfo.Length; i++)
|
||||
{
|
||||
var meshInfo = textInfo.meshInfo[i];
|
||||
meshInfo.mesh.vertices = meshInfo.vertices;
|
||||
tmp.UpdateGeometry(meshInfo.mesh, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3233b62805d53754ca34f41100fa7d49
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
[RequireComponent(typeof(Toggle))]
|
||||
public class UI_Toggle : MonoBehaviour
|
||||
{
|
||||
Toggle toggle;
|
||||
void Awake()
|
||||
{
|
||||
TryGetComponent(out toggle);
|
||||
Active(toggle.isOn);
|
||||
toggle.onValueChanged.AddListener(Active);
|
||||
}
|
||||
void Active(bool isOn)
|
||||
{
|
||||
toggle.graphic.gameObject.SetActive(isOn);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 21d6f4132530e8f43a7e425e714f0125
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user