webgl版初始化
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
|||||||
|
# Build and Release Folders
|
||||||
|
bin-debug/
|
||||||
|
bin-release/
|
||||||
|
[Oo]bj/
|
||||||
|
[Bb]in/
|
||||||
|
/.vs/
|
||||||
|
.vs/
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
# Other files and folders
|
||||||
|
.settings/
|
||||||
|
|
||||||
|
# Executables
|
||||||
|
*.swf
|
||||||
|
*.air
|
||||||
|
*.ipa
|
||||||
|
*.apk
|
||||||
|
|
||||||
|
# dll
|
||||||
|
!*.dll
|
||||||
|
|
||||||
|
|
||||||
|
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
|
||||||
|
# should NOT be excluded as they contain compiler settings and other important
|
||||||
|
# information for Eclipse / Flash Builder.
|
||||||
|
/Developer/DLLDev/.idea
|
||||||
|
/Developer/DLLDev/CentralizeLog/.vs
|
||||||
|
/Developer/DLLDev/Deconstruction/.vs
|
||||||
|
/Developer/DLLDev/EditorLevel/.vs
|
||||||
|
/Developer/DLLDev/MainSolution/.vs
|
||||||
|
/Developer/DLLDev/ManagerStyle/.vs
|
||||||
|
/Developer/DLLDev/RescissionRework/.vs
|
||||||
|
/Developer/DLLDev/XericLibrary/.vs
|
||||||
+139
@@ -0,0 +1,139 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## [0.3.4] - 2025-04-23
|
||||||
|
|
||||||
|
增加了文本格式包裹器。
|
||||||
|
|
||||||
|
## [0.3.3] - 2025-04-17
|
||||||
|
|
||||||
|
增加了版本发布仓库,插件可以在library里享受缓存待遇了,真舒服啊。
|
||||||
|
添加一种在运行时可以使用的Guidance(先导)方法,在这里可以执行初始化操作,而不用等待awake。
|
||||||
|
添加了布尔计算器。
|
||||||
|
添加了文本池。
|
||||||
|
添加了用于自动菜单构建的布局特性管理器系统。
|
||||||
|
更新枚举封装器(用法有变更)。
|
||||||
|
重写了联合对象池(旧版联合对象池用的较少没有过度版本)。
|
||||||
|
TimeStamp过时。
|
||||||
|
添加TimingStamp用于代替TimeStamp。
|
||||||
|
|
||||||
|
## [0.3.2] - 2025-03-14
|
||||||
|
|
||||||
|
修复sql数据库封装器的部分问题。
|
||||||
|
|
||||||
|
## [0.3.1] - 2025-01-10
|
||||||
|
|
||||||
|
一个大功能更新:数据库宏
|
||||||
|
添加了一个关于数据库读写的部分,将数据库的sql语言用更易管理的方式封装。
|
||||||
|
数据库宏需要对应的数据库dll支持,为了便于分发,暂时没有纳入自动封装的范围
|
||||||
|
数据库宏分为两个部分:
|
||||||
|
一个以order为基础,封装了基本操作指令的操作库。
|
||||||
|
一个以关键字函数式为基础,允许使用链式语法构建指令的指令集,依靠编译器实现语法。
|
||||||
|
|
||||||
|
自上次以来,添加其他的一些小功能:
|
||||||
|
可以对一个字符串使用.InXml_xxx来快速使用xml格式包裹文本。
|
||||||
|
调整了mono单例的一些单例模式,添加了惰性单例,编辑时单例,匿名单例,旁路优先单例,终端单例,现在一共可以用9种单例。
|
||||||
|
添加了一个关于user32.dll的控制宏。
|
||||||
|
|
||||||
|
## [0.2.6] - 2024-10-10
|
||||||
|
|
||||||
|
添加了程序宏:
|
||||||
|
单例类中添加了对自源与他源的区分,替代了之前的抛出异常,而是可以通过不同的属性分别获取自己的单例和源自自己的单例.
|
||||||
|
添加了ui变换宏;
|
||||||
|
添加了摄像机宏:可以在编辑器下获取屏幕尺寸(用于解决当前高版本下获取低版本untiy的screen参数时总是不对的问题);
|
||||||
|
|
||||||
|
## [0.2.5] - 2024-8-12
|
||||||
|
|
||||||
|
添加了列表宏:列表二分法迭代器,合并迭代器之前,合并迭代器之后,获取子迭代器片段,。
|
||||||
|
添加了对象宏:广度优先节点迭代器,深度优先节点迭代器,获取家族序列,从家族序列查找对象。
|
||||||
|
添加了树型结构:目录树。
|
||||||
|
添加了超驰宏。
|
||||||
|
添加了硬件信息查询,不过相关命令在unity里无法执行,需要系统权限。
|
||||||
|
添加了一维到三维布尔数据结构。
|
||||||
|
添加了按键宏,可以识别点击,长按,双击,连击,长按释放等操作,支持动作触发,时间触发,坐标触发。
|
||||||
|
添加了一个测试用的角色控制器,默认使用旧输入系统,不过有提供便捷的重写结构。
|
||||||
|
添加了编辑距离检查算法。
|
||||||
|
添加了3d贝塞尔曲线(样条曲线),适用于3d世界场景。
|
||||||
|
添加了2d界面的贝塞尔曲线,适用于ui界面,可以跟随界面定位缩放。
|
||||||
|
添加了注册器。
|
||||||
|
|
||||||
|
之前更改的weaklyMono类在判断空方面有点繁琐,所以添加了 <code>IsNull</code> 和 <code>sNotNull</code> 来判断 weaklyMono 是否为空。
|
||||||
|
|
||||||
|
修复了颜色梯度图表的一个编辑时错误,现在不会在每次展开inspector时添加默认值在0点了。
|
||||||
|
修复了一些快捷枚举位操作宏会出现计算错误的情况。
|
||||||
|
修复了数学库中的clamp计算错误。
|
||||||
|
|
||||||
|
## [0.2.4] - 2024-06-19
|
||||||
|
|
||||||
|
添加了更多的关于快速文件保存,数据算法,html解析,http连接的扩展实现。
|
||||||
|
对于线路绘制库没有进行过多更改,但修复了一些可能存在的问题。
|
||||||
|
添加了基于机器码的简易认证。
|
||||||
|
|
||||||
|
## [0.2.3-alpha] - 2024-06-14
|
||||||
|
|
||||||
|
主要添加了一些关于弱元素的扩展
|
||||||
|
这是一个测试版本,基于上一版本进行更新,并调整了部分实验性API。
|
||||||
|
|
||||||
|
* 注意
|
||||||
|
现在想要判断一个线路绘制库的元素是否为空,必须明确指出其空类型,或者使用 <code>is null</code> 以及 <code>is not null</code> 来更规范地检查是否为空。
|
||||||
|
另外我在测试环境中的代码在此次更新中没有发生任何报错或警告,所以我认为这依然是一个小更新。
|
||||||
|
但在未来可能会将此类语法扩展到其他类成员中,请悉知。
|
||||||
|
|
||||||
|
* 新增
|
||||||
|
增加一些许可证行为。
|
||||||
|
增加一些基础网络相关库。
|
||||||
|
|
||||||
|
* API调整
|
||||||
|
重新设计了线路绘制库中序列化联盟的结构扩展,链式语法更紧凑了。
|
||||||
|
同时反序列化的内容可以直接用于复制,同化等操作,并且逐组件同化的操作也可以使用快速链式调用了。
|
||||||
|
已经被移除的旧方法大部分是非公开的,所以这算小更新,如果你通过软引用调用了旧api,请参考组件中新的反序列化进行调整。
|
||||||
|
相连结构的检查接口包含新增与修改。
|
||||||
|
|
||||||
|
* 修复
|
||||||
|
修复了线路绘制库中对线路的反序列化功能。
|
||||||
|
修复了序列化联盟中存在的一些索引问题。
|
||||||
|
|
||||||
|
* 已知问题
|
||||||
|
在电脑休眠后,untiy有几率会提示插件中的部分类missing the class attribute ‘ExtensionOfNativeClass’。
|
||||||
|
|
||||||
|
|
||||||
|
## [0.2.2-alpha] - 2024-05-22
|
||||||
|
|
||||||
|
主要对线路绘制库的更新,以及对少量数学库的更新。
|
||||||
|
这是一个测试版本,基于上一版本进行更新,并调整了部分实验性API。
|
||||||
|
|
||||||
|
* 新增
|
||||||
|
添加了uid的全局存在查找功能。
|
||||||
|
添加了序列化保存的功能。
|
||||||
|
添加了线路吸附,并实装在工具中。
|
||||||
|
添加了工具类的后台运行生命周期。
|
||||||
|
|
||||||
|
* API调整
|
||||||
|
将原先添加巨大成员对象的方法中外置的空间转换方法隐去,而在IPossessorTrajectory2中添加了对默认可扩展的两种世界空间的默认转换方法。由于只有具备可执行脚本能力的类才可以继承此接口,因此在此处添加世界空间的转换方法个人认为是较为恰当的。
|
||||||
|
移除了材质库,材质库现在独立为了新的插件。
|
||||||
|
|
||||||
|
* 修复
|
||||||
|
修复了圆弧计算时,步长会随着半径提高而边长的问题,经过测试是正比关系,依此完成的矫正。
|
||||||
|
|
||||||
|
|
||||||
|
## [0.2.1-alpha] - 2024-05-07
|
||||||
|
|
||||||
|
这是一个测试版本,但其中的api基本确定,可以进行基本的使用。
|
||||||
|
|
||||||
|
|
||||||
|
## [0.2.0] - 2024-04-18
|
||||||
|
|
||||||
|
开始加入线路库*解构*功能
|
||||||
|
|
||||||
|
添加点,线的计算与绘制功能,以及全局标识。
|
||||||
|
|
||||||
|
## [0.1.0] - 2024-01-30
|
||||||
|
|
||||||
|
插件源自一个简单的数学整合库。
|
||||||
|
现整合基本内容,并在此基础上编写线路库,期望通过dll封装形成大型但简洁的库。
|
||||||
|
|
||||||
|
简洁是可选的,移除不需要的dll功能即可。
|
||||||
|
|
||||||
|
|
||||||
|
### This is the first release of *\<Sesotho Line\>*.
|
||||||
|
|
||||||
|
*Short description of this release*
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6a087633678869240ab81fb5063f68ba
|
||||||
|
TextScriptImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7758a0679c9038144a4b0d007d44618f
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"name": "Lrss3.ConfigUIElement",
|
||||||
|
"rootNamespace": "",
|
||||||
|
"references": [
|
||||||
|
"GUID:6055be8ebefd69e48b49212b09b47b2f",
|
||||||
|
"GUID:b1727b829ae4f0641acc8ad28ed624c2",
|
||||||
|
"GUID:343deaaf83e0cee4ca978e7df0b80d21"
|
||||||
|
],
|
||||||
|
"includePlatforms": [],
|
||||||
|
"excludePlatforms": [],
|
||||||
|
"allowUnsafeCode": false,
|
||||||
|
"overrideReferences": false,
|
||||||
|
"precompiledReferences": [],
|
||||||
|
"autoReferenced": true,
|
||||||
|
"defineConstraints": [],
|
||||||
|
"versionDefines": [],
|
||||||
|
"noEngineReferences": false
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 25409440eb1d34849a42df21f5989356
|
||||||
|
AssemblyDefinitionImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d53a566643e99d74292ec8e451eb7356
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d98e03d6c3f900341838908516882fd0
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
namespace LRC
|
||||||
|
{
|
||||||
|
public class ConfigButton : ConfigSelectableItem
|
||||||
|
{
|
||||||
|
#region 属性字段
|
||||||
|
|
||||||
|
public Button targetButton;
|
||||||
|
|
||||||
|
public override bool AllowInput
|
||||||
|
{
|
||||||
|
get => base.AllowInput;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (targetButton != null)
|
||||||
|
targetButton.interactable = !value;
|
||||||
|
base.AllowInput = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 实现
|
||||||
|
|
||||||
|
protected override void SetValue(object newValue)
|
||||||
|
{
|
||||||
|
throw new System.NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void RefreshValueWithoutEvent(object newValue, bool forceSet = false)
|
||||||
|
{
|
||||||
|
base.RefreshValueWithoutEvent(newValue, forceSet);
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool _doOnce = false;
|
||||||
|
protected override void Initialization_ChildConstruction(UIBehaviour component)
|
||||||
|
{
|
||||||
|
base.Initialization_ChildConstruction(component);
|
||||||
|
|
||||||
|
var name = component.transform.name;
|
||||||
|
if (name is not "button") return;
|
||||||
|
if (_doOnce)
|
||||||
|
{
|
||||||
|
Debug.LogError("存在重复命名的属性模块:" + name);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (component is Button button)
|
||||||
|
{
|
||||||
|
_doOnce = true;
|
||||||
|
if (targetButton != null)
|
||||||
|
targetButton = button;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 73f7a373611d15741b1093e0669abea9
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,153 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using TMPro;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
namespace LRC
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 一种数值增减输入框,将使用浮点值作为默认
|
||||||
|
/// </summary>
|
||||||
|
public class ConfigDigitalInputField : ConfigSelectableItem
|
||||||
|
{
|
||||||
|
#region 属性字段
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
public float editorInput;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public TMP_InputField targetInput;
|
||||||
|
|
||||||
|
public Button digitalAddButton;
|
||||||
|
public Button digitalSubButton;
|
||||||
|
|
||||||
|
public double maxValue = 114514;
|
||||||
|
public double minValue = -114515;
|
||||||
|
public int digits = 6;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 增量
|
||||||
|
/// </summary>
|
||||||
|
public double delta = 1;
|
||||||
|
|
||||||
|
public override bool AllowInput
|
||||||
|
{
|
||||||
|
get => base.AllowInput;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (targetInput != null)
|
||||||
|
targetInput.readOnly = !value;
|
||||||
|
if (digitalAddButton != null)
|
||||||
|
digitalAddButton.interactable = value;
|
||||||
|
if (digitalSubButton != null)
|
||||||
|
digitalSubButton.interactable = value;
|
||||||
|
base.AllowInput = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 生命周期
|
||||||
|
|
||||||
|
protected override void OnValidate()
|
||||||
|
{
|
||||||
|
base.OnValidate();
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
if (targetInput != null)
|
||||||
|
targetInput.text = editorInput.ToString();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Awake()
|
||||||
|
{
|
||||||
|
base.Awake();
|
||||||
|
if (ReferenceEquals(targetInput, null))
|
||||||
|
{
|
||||||
|
Debug.LogError($"{name}配置项目条目的基本元素不存在");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
targetInput.onSelect.AddListener(a =>
|
||||||
|
{
|
||||||
|
WhenStartEdit();
|
||||||
|
});
|
||||||
|
targetInput.onValueChanged.AddListener(o =>
|
||||||
|
{
|
||||||
|
double value = 0;
|
||||||
|
if (double.TryParse(o, out value))
|
||||||
|
{
|
||||||
|
SetValue(value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
targetInput.onEndEdit.AddListener(delegate
|
||||||
|
{
|
||||||
|
WhenEndEdit();
|
||||||
|
});
|
||||||
|
if (!ReferenceEquals(digitalAddButton, null))
|
||||||
|
digitalAddButton.onClick.AddListener(delegate
|
||||||
|
{
|
||||||
|
SetValue(CastDigitalNumber(Value) + delta);
|
||||||
|
RefreshFormatValue(Value);
|
||||||
|
});
|
||||||
|
if (!ReferenceEquals(digitalSubButton, null))
|
||||||
|
digitalSubButton.onClick.AddListener(delegate
|
||||||
|
{
|
||||||
|
SetValue(CastDigitalNumber(Value) - delta);
|
||||||
|
RefreshFormatValue(Value);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 实现
|
||||||
|
|
||||||
|
protected override void SetValue(object newValue)
|
||||||
|
{
|
||||||
|
base.SetValue(CastDigitalNumber(newValue, minValue, maxValue, digits));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void RefreshValueWithoutEvent(object newValue, bool forceSet = false)
|
||||||
|
{
|
||||||
|
base.RefreshValueWithoutEvent(CastDigitalNumber(newValue, minValue, maxValue, digits), forceSet);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Initialization_ChildConstruction(UIBehaviour component)
|
||||||
|
{
|
||||||
|
base.Initialization_ChildConstruction(component);
|
||||||
|
|
||||||
|
|
||||||
|
if (component is TMP_InputField inputField)
|
||||||
|
{
|
||||||
|
if (targetInput != null)
|
||||||
|
targetInput = inputField;
|
||||||
|
}
|
||||||
|
else if(component is Button button)
|
||||||
|
{
|
||||||
|
var name = component.transform.name;
|
||||||
|
switch (name)
|
||||||
|
{
|
||||||
|
case "subbutton":
|
||||||
|
case "SubButton":
|
||||||
|
if (digitalSubButton != null)
|
||||||
|
digitalSubButton = button;
|
||||||
|
break;
|
||||||
|
case "addbutton":
|
||||||
|
case "AddButton":
|
||||||
|
if (digitalAddButton != null)
|
||||||
|
digitalAddButton = button;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void RefreshFormatValue(object newValue)
|
||||||
|
{
|
||||||
|
base.RefreshFormatValue(newValue);
|
||||||
|
targetInput.text = CastDigitalNumber(newValue).ToString(numberFormat);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d84fd414ac6743e46909249427b18364
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using TMPro;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
using UnityEngine.Serialization;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
namespace LRC
|
||||||
|
{
|
||||||
|
public class ConfigDropdown : ConfigSelectableItem
|
||||||
|
{
|
||||||
|
#region ÊôÐÔ×Ö¶Î
|
||||||
|
|
||||||
|
public TMP_Dropdown targetDropdown;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region ÉúÃüÖÜÆÚ
|
||||||
|
|
||||||
|
protected override void Awake()
|
||||||
|
{
|
||||||
|
base.Awake();
|
||||||
|
targetDropdown.onValueChanged.AddListener(index =>
|
||||||
|
{
|
||||||
|
SetValue(index);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InitializationDropdown(IEnumerable<string> options)
|
||||||
|
{
|
||||||
|
targetDropdown.options = options
|
||||||
|
.Select(option => new TMP_Dropdown.OptionData(option)).ToList();
|
||||||
|
targetDropdown.RefreshShownValue();
|
||||||
|
if (IsValueInitNull)
|
||||||
|
RefreshValueWithoutEvent(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region ʵÏÖ
|
||||||
|
|
||||||
|
protected override void SetValue(object newValue)
|
||||||
|
{
|
||||||
|
base.SetValue(CastIntNumber(newValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void RefreshValueWithoutEvent(object newValue, bool forceSet = false)
|
||||||
|
{
|
||||||
|
base.RefreshValueWithoutEvent(CastIntNumber(newValue), forceSet);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Initialization_ChildConstruction(UIBehaviour component)
|
||||||
|
{
|
||||||
|
base.Initialization_ChildConstruction(component);
|
||||||
|
|
||||||
|
var name = component.transform.name;
|
||||||
|
if (name is not "dropdown") return;
|
||||||
|
if (component is TMP_Dropdown dropdown)
|
||||||
|
{
|
||||||
|
if (targetDropdown != null)
|
||||||
|
targetDropdown = dropdown;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void RefreshFormatValue(object newValue)
|
||||||
|
{
|
||||||
|
base.RefreshFormatValue(newValue);
|
||||||
|
if (newValue == null)
|
||||||
|
return;
|
||||||
|
targetDropdown.value = CastIntNumber(newValue);
|
||||||
|
targetDropdown.RefreshShownValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 471d16b38f4449a46b9fcf5b312f65d0
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,712 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Reflection;
|
||||||
|
using TMPro;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
using UnityEngine.Serialization;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
using XericLibrary.Runtime.CustomEditor;
|
||||||
|
using XericLibrary.Runtime.MacroLibrary;
|
||||||
|
|
||||||
|
namespace LRC
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 一种用于基础面板设置条目的类
|
||||||
|
/// <code>
|
||||||
|
/// 在此类中提供了双向的属性委托修改,并且拥有脏标记。
|
||||||
|
/// 该类在初始化时以输入为优先。
|
||||||
|
/// 脏标记仅当界面首次发生改变时进行记录,并不会影响值。
|
||||||
|
/// </code>
|
||||||
|
/// </summary>
|
||||||
|
public abstract class ConfigSelectableItem : MonoBehaviour
|
||||||
|
{
|
||||||
|
#region 静态事件
|
||||||
|
|
||||||
|
private static event Action<bool, bool> ForceUpdateAllConfigEvent;
|
||||||
|
/// <summary>
|
||||||
|
/// 强制所有激活的成员产生请求更新的事件(比如初始化时,外部更新时)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="resetDirty"></param>
|
||||||
|
public static void ForceUpdateAll(bool resetDirty = false, bool forceSet = false)
|
||||||
|
{
|
||||||
|
ForceUpdateAllConfigEvent?.Invoke(resetDirty, forceSet);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static event Action ForceSetAllSourceValueEvent;
|
||||||
|
/// <summary>
|
||||||
|
/// 强制所有激活的成员产生请求设置的事件(比如按下应用按钮时)
|
||||||
|
/// </summary>
|
||||||
|
public static void ForceSetAllSourceValue()
|
||||||
|
{
|
||||||
|
ForceSetAllSourceValueEvent?.Invoke();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数值遭到修改时
|
||||||
|
/// </summary>
|
||||||
|
public static event Action<ConfigSelectableItem> OnAnyValueDirty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 当数值收到修改时,产生事件,其中值的含义是修改前的值
|
||||||
|
/// </summary>
|
||||||
|
public static event Action<ConfigSelectableItem, object> OnAnyValueChange;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 静态成员
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 所有有效的配置项目,当项目被隐藏(不处于激活状态时)就会从列表中删除。
|
||||||
|
/// </summary>
|
||||||
|
private static readonly List<ConfigSelectableItem> ConfigItemList = new List<ConfigSelectableItem>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目列表有效成员的数量
|
||||||
|
/// </summary>
|
||||||
|
public static int ConfigItemListCount => ConfigItemList.Count;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="index"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static ConfigSelectableItem GetConfigItemByIndex(int index) => ConfigItemList[index];
|
||||||
|
public static IEnumerable<ConfigSelectableItem> ConfigItemLists => ConfigItemList;
|
||||||
|
|
||||||
|
private static bool autoUpdateValueAll;
|
||||||
|
/// <summary>
|
||||||
|
/// 自动更新所有数值
|
||||||
|
/// </summary>
|
||||||
|
public static bool AutoUpdateValueAll
|
||||||
|
{
|
||||||
|
get => autoUpdateValueAll;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
foreach (var item in ConfigItemList)
|
||||||
|
item.autoUpdateValue = value;
|
||||||
|
autoUpdateValueAll = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 状态
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数值遭到修改时,标记脏,这样在后续的应用中有可以保存的变化
|
||||||
|
/// <code>
|
||||||
|
/// 建议:这是可选的
|
||||||
|
/// 这会立刻发生在值修改时,且比OnValueChange更早,但在复位之前只会调用一次。
|
||||||
|
/// </code>
|
||||||
|
/// </summary>
|
||||||
|
public event Action<ConfigSelectableItem> OnValueDirty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 当数值收到修改时,产生事件,其中值的含义是修改前的值
|
||||||
|
/// <code>
|
||||||
|
/// 建议:这是可选的
|
||||||
|
/// 这会立刻发生在值修改时,所以如果需要进行页面刷新的话,建议进行等待
|
||||||
|
/// </code>
|
||||||
|
/// </summary>
|
||||||
|
public event Action<ConfigSelectableItem, object> OnValueChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 当数值结束修改时
|
||||||
|
/// </summary>
|
||||||
|
public event Action<ConfigSelectableItem, object> OnEndEdit;
|
||||||
|
/// <summary>
|
||||||
|
/// 当前属性请求获取属性值
|
||||||
|
/// <code>
|
||||||
|
/// 建议:这是必要的
|
||||||
|
/// 当发生刷新事件时,将产生调用。
|
||||||
|
/// 含义是将外部的值设定到此。
|
||||||
|
/// </code>
|
||||||
|
/// </summary>
|
||||||
|
public event Func<ConfigSelectableItem, object> GetSourceValue;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 当前属性请求设置属性值
|
||||||
|
/// <code>
|
||||||
|
/// 建议:这是必要的
|
||||||
|
/// 当被应用时,比如调用了ForceSetAllSourceValue,将产生调用。
|
||||||
|
/// 含义是将此处的界面值返回到属性中。
|
||||||
|
/// 警告:不要在这里面调用ForceSetAllSourceValue,SetSourceValueRequest等方法,
|
||||||
|
/// 这会造成死循环以及内存溢出等问题。
|
||||||
|
/// </code>
|
||||||
|
/// </summary>
|
||||||
|
public event Action<ConfigSelectableItem, object> SetSourceValue;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 当前属性的自动更新请求获取
|
||||||
|
/// <code>
|
||||||
|
/// 建议:这是条件可选的
|
||||||
|
/// 当被管理的目标中存在Toggle时(对应autoUpdateValueToggle项目)
|
||||||
|
/// 此处将用于从外部的值是否勾选值设定到此
|
||||||
|
/// </code>
|
||||||
|
/// </summary>
|
||||||
|
public event Func<ConfigSelectableItem, bool> GetSourceValueAutoUpdate;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 当前属性的自动更新请求设置
|
||||||
|
/// <code>
|
||||||
|
/// 建议:这是条件可选的
|
||||||
|
/// 当被管理的目标中存在Toggle时(对应autoUpdateValueToggle项目)
|
||||||
|
/// 此处将用于设置到外部的是否勾选值设定到此
|
||||||
|
/// </code>
|
||||||
|
/// </summary>
|
||||||
|
public event Action<bool> SetSourceValueAutoUpdate;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 请求此属性设置值(将值应用到寄存中)
|
||||||
|
/// </summary>
|
||||||
|
public void SetSourceValueRequest()
|
||||||
|
{
|
||||||
|
SetSourceValue?.Invoke(this, Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 属性字段
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目对应的标记tag
|
||||||
|
/// </summary>
|
||||||
|
[Rename("映射标记")]
|
||||||
|
public string configTag;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设定是否有效。
|
||||||
|
/// 如果无效,则不允许输入
|
||||||
|
/// </summary>
|
||||||
|
[SerializeField]
|
||||||
|
[Rename("允许输入")]
|
||||||
|
private bool allowInput = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 自动更新数值
|
||||||
|
/// </summary>
|
||||||
|
[SerializeField]
|
||||||
|
[Rename("主动更新")]
|
||||||
|
private bool autoUpdateValue = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 允许阻塞自动更新,表示此项目可以脱离自动更新状态选框的状态运行
|
||||||
|
/// </summary>
|
||||||
|
[SerializeField]
|
||||||
|
[Rename("允许阻塞自动更新")]
|
||||||
|
private bool allowBlockUpdate = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 阻塞自动更新,一般由程序自动根据焦点更新
|
||||||
|
/// </summary>
|
||||||
|
[SerializeField]
|
||||||
|
[Rename("阻塞自动更新")]
|
||||||
|
private bool forceBlockUpdate = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 格式化文本
|
||||||
|
/// </summary>
|
||||||
|
public string numberFormat = "0.##";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目标题组件
|
||||||
|
/// </summary>
|
||||||
|
public TextMeshProUGUI titleLabel;
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
[SerializeField]
|
||||||
|
#endif
|
||||||
|
private string titleTextContext;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 帮助文本组件
|
||||||
|
/// </summary>
|
||||||
|
public TextMeshProUGUI helpLabel;
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
[SerializeField]
|
||||||
|
#endif
|
||||||
|
private string helpTextContext;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位文本组件
|
||||||
|
/// </summary>
|
||||||
|
public TextMeshProUGUI unitLabel;
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
[SerializeField]
|
||||||
|
#endif
|
||||||
|
private string unitTextContext;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 条目前的选框,与autoUpdateValue对应
|
||||||
|
/// </summary>
|
||||||
|
[Rename("自动更新状态选框")]
|
||||||
|
public Toggle autoUpdateValueToggle;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 反转选框状态
|
||||||
|
/// </summary>
|
||||||
|
[Rename("反转自动更新按钮状态")]
|
||||||
|
public bool autoUpdateValueToggleReversalState;
|
||||||
|
|
||||||
|
[Rename("反转自动更新状态")]
|
||||||
|
public bool autoUpdateValueReversalState;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 脏属性自动复位。
|
||||||
|
/// 当属性被重新开关时,将取消脏状态
|
||||||
|
/// </summary>
|
||||||
|
[Rename("脏标记自动复位")]
|
||||||
|
public bool dirtyAutoReset = false;
|
||||||
|
|
||||||
|
// ==== 属性 ==== //
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设定是否输入有效
|
||||||
|
/// </summary>
|
||||||
|
public virtual bool AllowInput
|
||||||
|
{
|
||||||
|
get => allowInput;
|
||||||
|
set => allowInput = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 此属性项目已经初始化
|
||||||
|
/// </summary>
|
||||||
|
[HideInInspector]
|
||||||
|
public bool IsValueInitNull { get; private set; } = true;
|
||||||
|
|
||||||
|
// [Obsolete("请使用访问器")]
|
||||||
|
private bool _isDirty;
|
||||||
|
/// <summary>
|
||||||
|
/// 脏属性标记,首次脏会进行广播
|
||||||
|
/// </summary>
|
||||||
|
private bool IsDirty
|
||||||
|
{
|
||||||
|
get => _isDirty;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_isDirty)
|
||||||
|
{
|
||||||
|
if (!value)
|
||||||
|
_isDirty = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!value) return;
|
||||||
|
|
||||||
|
_isDirty = true;
|
||||||
|
OnAnyValueDirty?.Invoke(this);
|
||||||
|
OnValueDirty?.Invoke(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设定自动更新状态,并同步选框
|
||||||
|
/// <code>
|
||||||
|
/// 为了书写方便,保存的状态是和外部暂存值一致,
|
||||||
|
/// 此访问器将作为本地状态的标准访问。
|
||||||
|
///
|
||||||
|
/// 访问将自动进行转换,而设置则不进行转换,
|
||||||
|
/// 所以应当使用此访问器进行设置或内部访问,而与外部通讯应当使用字段。
|
||||||
|
///
|
||||||
|
/// 如果需要将此内部判断状态转为界面状态:
|
||||||
|
/// 应当先通过autoUpdateValueReversalState转为暂存值,
|
||||||
|
/// 然后再通过autoUpdateValueToggleReversalState转为界面值。
|
||||||
|
/// </code>
|
||||||
|
/// </summary>
|
||||||
|
public bool AutoUpdateValue
|
||||||
|
{
|
||||||
|
get => autoUpdateValueReversalState ^ autoUpdateValue;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
autoUpdateValue = value;
|
||||||
|
if (autoUpdateValueToggle != null)
|
||||||
|
autoUpdateValueToggle.isOn = autoUpdateValueToggleReversalState ^ value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设定阻塞自动更新
|
||||||
|
/// </summary>
|
||||||
|
public bool ForceBlockUpdate
|
||||||
|
{
|
||||||
|
get => forceBlockUpdate;
|
||||||
|
set => forceBlockUpdate = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目标题
|
||||||
|
/// </summary>
|
||||||
|
public string TitleName
|
||||||
|
{
|
||||||
|
get => titleLabel.text;
|
||||||
|
set => titleLabel.text = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 帮助文本,再默认情况下应该是不显示的通过赋予空文本来关闭显示
|
||||||
|
/// </summary>
|
||||||
|
public string HelpName
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (helpLabel != null) return helpLabel.text;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (helpLabel != null)
|
||||||
|
{
|
||||||
|
if (value != null)
|
||||||
|
{
|
||||||
|
helpLabel.text = value;
|
||||||
|
helpLabel.gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
helpLabel.gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string UnitName
|
||||||
|
{
|
||||||
|
get => unitLabel.text;
|
||||||
|
set => unitLabel.text = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
// [Obsolete("请使用访问器")]
|
||||||
|
private object _value;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目值
|
||||||
|
/// </summary>
|
||||||
|
public object Value
|
||||||
|
{
|
||||||
|
get => _value;
|
||||||
|
protected set
|
||||||
|
{
|
||||||
|
if (IsValueInitNull && value != null)
|
||||||
|
IsValueInitNull = false;
|
||||||
|
_value = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==== 暂存 ==== //
|
||||||
|
|
||||||
|
public FieldInfo FieldInfo;
|
||||||
|
|
||||||
|
public Type FieldType;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 生命周期
|
||||||
|
|
||||||
|
protected virtual void OnValidate()
|
||||||
|
{
|
||||||
|
if (titleLabel != null)
|
||||||
|
TitleName = titleTextContext;
|
||||||
|
if (helpLabel != null)
|
||||||
|
HelpName = helpTextContext;
|
||||||
|
if (unitLabel != null)
|
||||||
|
UnitName = unitTextContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void Awake()
|
||||||
|
{
|
||||||
|
foreach (var child in transform.GetChildren())
|
||||||
|
{
|
||||||
|
var component = child.GetComponent<UIBehaviour>();
|
||||||
|
if (component != null)
|
||||||
|
Initialization_ChildConstruction(component);
|
||||||
|
}
|
||||||
|
|
||||||
|
Initialization_EventBinding();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void OnEnable()
|
||||||
|
{
|
||||||
|
ConfigItemList.Add(this);
|
||||||
|
ForceUpdateAllConfigEvent += ForceUpdate;
|
||||||
|
ForceSetAllSourceValueEvent += SetSourceValueRequest;
|
||||||
|
|
||||||
|
if (dirtyAutoReset)
|
||||||
|
IsDirty = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void OnDisable()
|
||||||
|
{
|
||||||
|
ConfigItemList.Remove(this);
|
||||||
|
ForceUpdateAllConfigEvent -= ForceUpdate;
|
||||||
|
ForceSetAllSourceValueEvent -= SetSourceValueRequest;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void Start()
|
||||||
|
{
|
||||||
|
ForceUpdate(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
if (IsValueInitNull || (AutoUpdateValue && !(allowBlockUpdate && forceBlockUpdate)))
|
||||||
|
{
|
||||||
|
ForceUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDestroy()
|
||||||
|
{
|
||||||
|
ForceUpdateAllConfigEvent -= ForceUpdate;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 换算与转换
|
||||||
|
|
||||||
|
protected static double CastDigitalNumber(object newValue)
|
||||||
|
{
|
||||||
|
if (double.TryParse(newValue.ToString(), out var value))
|
||||||
|
{
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 转换到数值类型(数值钳制与四舍五入)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="newValue"></param>
|
||||||
|
/// <param name="minValue"></param>
|
||||||
|
/// <param name="maxValue"></param>
|
||||||
|
/// <param name="digits"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
protected static double CastDigitalNumber(object newValue, double minValue, double maxValue, int digits)
|
||||||
|
{
|
||||||
|
// var resultValue = newValue switch
|
||||||
|
// {
|
||||||
|
// bool boolValue => boolValue ? 1 : 0,
|
||||||
|
// short intValue => intValue,
|
||||||
|
// int intValue => intValue,
|
||||||
|
// long intValue => intValue,
|
||||||
|
// float floatValue => Math.Round(floatValue, digits),
|
||||||
|
// double doubleValue => Math.Round(doubleValue, digits),
|
||||||
|
// _ => 0
|
||||||
|
// };
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
if (newValue == null)
|
||||||
|
{
|
||||||
|
Debug.LogError($"参数转换错误:目标是一个空值,请在发生空值时提前退出");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (double.TryParse(newValue.ToString(), out var value))
|
||||||
|
{
|
||||||
|
var resultValue = Math.Round(value, digits);
|
||||||
|
return Math.Clamp(resultValue, minValue, maxValue);
|
||||||
|
}
|
||||||
|
Debug.LogError($"参数转换错误:{newValue}可能不是一个有效的数值");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static int CastIntNumber(object newValue)
|
||||||
|
{
|
||||||
|
var resultValue = Convert.ToInt32(newValue);
|
||||||
|
return resultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static Vector2 CastVector2(object newValue)
|
||||||
|
{
|
||||||
|
return newValue switch
|
||||||
|
{
|
||||||
|
Vector2 vec2Value => vec2Value,
|
||||||
|
System.Numerics.Vector2 sysVec2Value => new Vector2(sysVec2Value.X, sysVec2Value.Y),
|
||||||
|
_ => Vector2.zero
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static Vector3 CastVector3(object newValue)
|
||||||
|
{
|
||||||
|
return newValue switch
|
||||||
|
{
|
||||||
|
Vector3 vec3Value => vec3Value,
|
||||||
|
System.Numerics.Vector3 sysVec3Value => new Vector3(sysVec3Value.X, sysVec3Value.Y, sysVec3Value.Z),
|
||||||
|
_ => Vector3.zero
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 初始化方法
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 可选的基本初始化
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="autoUpdateValue">设定自动更新</param>
|
||||||
|
protected void Initialization(bool autoUpdateValue = true)
|
||||||
|
{
|
||||||
|
AutoUpdateValue = autoUpdateValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool _doOnce = false;
|
||||||
|
/// <summary>
|
||||||
|
/// 构建属性,在初始化过程中,通过识别项目来构建域
|
||||||
|
/// </summary>
|
||||||
|
protected virtual void Initialization_ChildConstruction(UIBehaviour component)
|
||||||
|
{
|
||||||
|
// 跟踪节点的名称
|
||||||
|
var name = component.gameObject.name;
|
||||||
|
// 初始化自动更新对勾
|
||||||
|
if (name == "toggle" && component is Toggle toggle)
|
||||||
|
{
|
||||||
|
if (autoUpdateValueToggle == null)
|
||||||
|
autoUpdateValueToggle = toggle;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (name is not ("title" or "name")) return;
|
||||||
|
if (_doOnce)
|
||||||
|
{
|
||||||
|
Debug.LogError("存在重复命名的属性模块:" + name);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (component is TextMeshProUGUI textMeshProUGUI)
|
||||||
|
{
|
||||||
|
_doOnce = true;
|
||||||
|
if (titleLabel != null)
|
||||||
|
titleLabel = textMeshProUGUI;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 构建事件,在初始化结束前,需要对所有动态绑定的按键进行事件绑定
|
||||||
|
/// </summary>
|
||||||
|
protected virtual void Initialization_EventBinding()
|
||||||
|
{
|
||||||
|
// 无论如何,事件需要被注册
|
||||||
|
if (autoUpdateValueToggle != null)
|
||||||
|
{
|
||||||
|
autoUpdateValueToggle.onValueChanged.AddListener(a =>
|
||||||
|
{
|
||||||
|
autoUpdateValue = autoUpdateValueToggleReversalState ^ a;
|
||||||
|
// 访问器将会自动转换,所以使用字段
|
||||||
|
SetSourceValueAutoUpdate?.Invoke(autoUpdateValue);
|
||||||
|
// 可能不会脏
|
||||||
|
// OnValueDirty?.Invoke(this);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 更新方法
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新函数
|
||||||
|
/// <code>
|
||||||
|
/// 在其他任意时刻调用时,将强制刷新其中的功能,如果已经是脏属性则不会有任何行为。
|
||||||
|
/// 更新是指从本地数据中更新,这会立刻产生值获取回调。
|
||||||
|
/// </code>
|
||||||
|
/// </summary>
|
||||||
|
public virtual void ForceUpdate(bool resetDirty = false, bool forceSet = false)
|
||||||
|
{
|
||||||
|
if (resetDirty)
|
||||||
|
IsDirty = false;
|
||||||
|
var value = GetSourceValue?.Invoke(this);
|
||||||
|
if (value == null)
|
||||||
|
return ;
|
||||||
|
RefreshValueWithoutEvent(value, forceSet);
|
||||||
|
RefreshAutoUpdateValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设置值,并触发更改事件,通常由界面发起所以不会主动更新界面
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="newValue"></param>
|
||||||
|
protected virtual void SetValue(object newValue)
|
||||||
|
{
|
||||||
|
if (Value == newValue)
|
||||||
|
return;
|
||||||
|
var lastValue = Value;
|
||||||
|
// 如果不允许输入,将复位为现在的值
|
||||||
|
if (!allowInput)
|
||||||
|
RefreshValueWithoutEvent(Value);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Value = newValue;
|
||||||
|
IsDirty = true;
|
||||||
|
|
||||||
|
OnAnyValueChange?.Invoke(this, lastValue);
|
||||||
|
OnValueChange?.Invoke(this, lastValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设置值,不触发更改时的事件,但应该进行界面数值更新。
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="newValue"></param>
|
||||||
|
/// <param name="forceSet"></param>
|
||||||
|
public virtual void RefreshValueWithoutEvent(object newValue, bool forceSet = false)
|
||||||
|
{
|
||||||
|
if (!AutoUpdateValue && !forceSet)
|
||||||
|
return;
|
||||||
|
if (newValue == null)
|
||||||
|
return;
|
||||||
|
if (Value != null && (Value.ToString() == newValue.ToString()))
|
||||||
|
return;
|
||||||
|
Value = newValue;
|
||||||
|
RefreshFormatValue(newValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新自动更新状态
|
||||||
|
/// </summary>
|
||||||
|
protected void RefreshAutoUpdateValue()
|
||||||
|
{
|
||||||
|
var isSourceValueAutoUpdate = GetSourceValueAutoUpdate?.Invoke(this);
|
||||||
|
if (isSourceValueAutoUpdate != null)
|
||||||
|
AutoUpdateValue = isSourceValueAutoUpdate.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 刷新格式化文本,在触发刷新时将产生更新
|
||||||
|
/// </summary>
|
||||||
|
protected virtual void RefreshFormatValue(object newValue)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void WhenStartEdit()
|
||||||
|
{
|
||||||
|
// Debug.Log("开始编辑");
|
||||||
|
ForceBlockUpdate = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数值输入完毕,或焦点移除时调用。
|
||||||
|
/// </summary>
|
||||||
|
protected void WhenEndEdit()
|
||||||
|
{
|
||||||
|
// Debug.Log("结束编辑");
|
||||||
|
ForceBlockUpdate = false;
|
||||||
|
OnEndEdit?.Invoke(this, Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 外观设定
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 销毁自动更新复选框,并设定当前是否允许自动更新
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="autoUpdateValue"></param>
|
||||||
|
public void DestroyAutoUpdateValue(bool autoUpdateValue)
|
||||||
|
{
|
||||||
|
Destroy(autoUpdateValueToggle.gameObject);
|
||||||
|
this.autoUpdateValue = autoUpdateValueReversalState ^ autoUpdateValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3e3c729eeb8e03f459a9c95dc6e239d8
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using TMPro;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
namespace LRC
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 一种普通文本输入框
|
||||||
|
/// </summary>
|
||||||
|
public class ConfigTextInputField : ConfigSelectableItem
|
||||||
|
{
|
||||||
|
#region 属性字段
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
public string editorInput;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public TMP_InputField targetInput;
|
||||||
|
|
||||||
|
|
||||||
|
public override bool AllowInput
|
||||||
|
{
|
||||||
|
get => base.AllowInput;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (targetInput != null)
|
||||||
|
targetInput.readOnly = !value;
|
||||||
|
base.AllowInput = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 生命周期
|
||||||
|
|
||||||
|
protected override void OnValidate()
|
||||||
|
{
|
||||||
|
base.OnValidate();
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
if (targetInput != null)
|
||||||
|
targetInput.text = editorInput;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Awake()
|
||||||
|
{
|
||||||
|
base.Awake();
|
||||||
|
targetInput.onSelect.AddListener(a =>
|
||||||
|
{
|
||||||
|
WhenStartEdit();
|
||||||
|
});
|
||||||
|
targetInput.onValueChanged.AddListener(o =>
|
||||||
|
{
|
||||||
|
if(double.TryParse(o, out var value))
|
||||||
|
SetValue(value);
|
||||||
|
});
|
||||||
|
targetInput.onEndEdit.AddListener(delegate
|
||||||
|
{
|
||||||
|
WhenEndEdit();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 实现
|
||||||
|
|
||||||
|
protected override void SetValue(object newValue)
|
||||||
|
{
|
||||||
|
base.SetValue(newValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void RefreshValueWithoutEvent(object newValue, bool forceSet = false)
|
||||||
|
{
|
||||||
|
base.RefreshValueWithoutEvent(newValue, forceSet);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Initialization_ChildConstruction(UIBehaviour component)
|
||||||
|
{
|
||||||
|
base.Initialization_ChildConstruction(component);
|
||||||
|
|
||||||
|
if (component is TMP_InputField inputField)
|
||||||
|
{
|
||||||
|
if (targetInput != null)
|
||||||
|
targetInput = inputField;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void RefreshFormatValue(object newValue)
|
||||||
|
{
|
||||||
|
base.RefreshFormatValue(newValue);
|
||||||
|
targetInput.text = newValue.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c9b27b4ed9920c947b157c1d7702372c
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
using UnityEngine.Serialization;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
namespace LRC
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 单选项控制组,将返回一个代表当前有效单选项索引作为值。
|
||||||
|
/// </summary>
|
||||||
|
public class ConfigToggleGroup : ConfigSelectableItem
|
||||||
|
{
|
||||||
|
#region 属性字段
|
||||||
|
|
||||||
|
public ToggleGroup targetToggle;
|
||||||
|
|
||||||
|
public List<Toggle> toggles;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 生命周期
|
||||||
|
|
||||||
|
protected override void Awake()
|
||||||
|
{
|
||||||
|
base.Awake();
|
||||||
|
|
||||||
|
for (int i = 0; i < toggles.Count; i++)
|
||||||
|
{
|
||||||
|
void BuildInGroupInit()
|
||||||
|
{
|
||||||
|
var index = i;
|
||||||
|
var toggle = toggles[i];
|
||||||
|
toggle.onValueChanged.AddListener(a =>
|
||||||
|
{
|
||||||
|
if (a)
|
||||||
|
SetValue(index);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
BuildInGroupInit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 实现
|
||||||
|
|
||||||
|
protected override void SetValue(object newValue)
|
||||||
|
{
|
||||||
|
base.SetValue(CastIntNumber(newValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void RefreshValueWithoutEvent(object newValue, bool forceSet = false)
|
||||||
|
{
|
||||||
|
base.RefreshValueWithoutEvent(CastIntNumber(newValue), forceSet);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Initialization_ChildConstruction(UIBehaviour component)
|
||||||
|
{
|
||||||
|
base.Initialization_ChildConstruction(component);
|
||||||
|
|
||||||
|
if (component is Toggle toggle &&
|
||||||
|
!toggles.Contains(toggle))
|
||||||
|
toggles.Add(toggle);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void RefreshFormatValue(object newValue)
|
||||||
|
{
|
||||||
|
base.RefreshFormatValue(newValue);
|
||||||
|
var newIndex = CastIntNumber(newValue);
|
||||||
|
// var index = 0;
|
||||||
|
// foreach (var toggle in targetToggle.ActiveToggles())
|
||||||
|
// {
|
||||||
|
// if (newIndex != index++)
|
||||||
|
// continue;
|
||||||
|
// toggle.isOn = true;
|
||||||
|
// Debug.Log(TitleName +":设置布尔项目");
|
||||||
|
// }
|
||||||
|
toggles[newIndex].SetIsOnWithoutNotify(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1b1b61fd3a211734eb3d51cedcbe579f
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Reflection;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace LRC
|
||||||
|
{
|
||||||
|
[AttributeUsage(AttributeTargets.Field)]
|
||||||
|
public class ConfigTypeOverrideAttribute : PropertyAttribute
|
||||||
|
{
|
||||||
|
public readonly string TypeName;
|
||||||
|
|
||||||
|
public ConfigTypeOverrideAttribute(string name)
|
||||||
|
{
|
||||||
|
TypeName = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 尝试获取其中的rename定义名称
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="field"></param>
|
||||||
|
/// <param name="name">通过特性获取的名称,如果没有则为原生的名称</param>
|
||||||
|
/// <returns>是否成功通过特性获取名称,否则是普通类型名称</returns>
|
||||||
|
public static bool TryGetMemberName(FieldInfo field, out string name)
|
||||||
|
{
|
||||||
|
if (field.GetCustomAttribute(typeof(ConfigTypeOverrideAttribute)) is ConfigTypeOverrideAttribute rename)
|
||||||
|
{
|
||||||
|
name = rename.TypeName;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
name = field.FieldType.Name;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a130623ae66ff564a9e14580549d2858
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,129 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using TMPro;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
namespace LRC
|
||||||
|
{
|
||||||
|
public class ConfigVec2InputField : ConfigSelectableItem
|
||||||
|
{
|
||||||
|
#region ÊôÐÔ×Ö¶Î
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
public Vector2 editorInput;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public TMP_InputField targetInputX;
|
||||||
|
public TMP_InputField targetInputY;
|
||||||
|
|
||||||
|
public override bool AllowInput
|
||||||
|
{
|
||||||
|
get => base.AllowInput;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (targetInputX != null)
|
||||||
|
targetInputX.readOnly = !value;
|
||||||
|
if (targetInputY != null)
|
||||||
|
targetInputY.readOnly = value;
|
||||||
|
base.AllowInput = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region ÉúÃüÖÜÆÚ
|
||||||
|
protected override void OnValidate()
|
||||||
|
{
|
||||||
|
base.OnValidate();
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
if (targetInputX != null)
|
||||||
|
targetInputX.text = editorInput.x.ToString();
|
||||||
|
if (targetInputY != null)
|
||||||
|
targetInputY.text = editorInput.y.ToString();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
protected override void Awake()
|
||||||
|
{
|
||||||
|
base.Awake();
|
||||||
|
|
||||||
|
targetInputX.onSelect.AddListener(a =>
|
||||||
|
{
|
||||||
|
WhenStartEdit();
|
||||||
|
});
|
||||||
|
targetInputY.onSelect.AddListener(a =>
|
||||||
|
{
|
||||||
|
WhenStartEdit();
|
||||||
|
});
|
||||||
|
targetInputX.onValueChanged.AddListener(a =>
|
||||||
|
{
|
||||||
|
var value = CastVector3(Value);
|
||||||
|
value.x = float.Parse(a);
|
||||||
|
SetValue(value);
|
||||||
|
});
|
||||||
|
targetInputY.onValueChanged.AddListener(a =>
|
||||||
|
{
|
||||||
|
var value = CastVector3(Value);
|
||||||
|
value.y = float.Parse(a);
|
||||||
|
SetValue(value);
|
||||||
|
});
|
||||||
|
targetInputX.onEndEdit.AddListener(delegate
|
||||||
|
{
|
||||||
|
WhenEndEdit();
|
||||||
|
});
|
||||||
|
targetInputY.onEndEdit.AddListener(delegate
|
||||||
|
{
|
||||||
|
WhenEndEdit();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region ʵÏÖ
|
||||||
|
|
||||||
|
protected override void SetValue(object newValue)
|
||||||
|
{
|
||||||
|
base.SetValue(CastVector2(newValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void RefreshValueWithoutEvent(object newValue, bool forceSet = false)
|
||||||
|
{
|
||||||
|
base.RefreshValueWithoutEvent(CastVector2(newValue), forceSet);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Initialization_ChildConstruction(UIBehaviour component)
|
||||||
|
{
|
||||||
|
base.Initialization_ChildConstruction(component);
|
||||||
|
|
||||||
|
var name = component.transform.name;
|
||||||
|
if (component is not TMP_InputField inputField)
|
||||||
|
return;
|
||||||
|
switch (name)
|
||||||
|
{
|
||||||
|
case "inputx":
|
||||||
|
case "inputX":
|
||||||
|
if (targetInputX != null)
|
||||||
|
targetInputX = inputField;
|
||||||
|
break;
|
||||||
|
case "inputy":
|
||||||
|
case "inputY":
|
||||||
|
if (targetInputY != null)
|
||||||
|
targetInputY = inputField;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void RefreshFormatValue(object newValue)
|
||||||
|
{
|
||||||
|
base.RefreshFormatValue(newValue);
|
||||||
|
var value = CastVector2(newValue);
|
||||||
|
targetInputX.text = value.x.ToString(numberFormat);
|
||||||
|
targetInputY.text = value.y.ToString(numberFormat);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 118ff8f18137da54087c6d572fc5db75
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,158 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using TMPro;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
namespace LRC
|
||||||
|
{
|
||||||
|
|
||||||
|
public class ConfigVec3InputField : ConfigSelectableItem
|
||||||
|
{
|
||||||
|
#region ÊôÐÔ×Ö¶Î
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
public Vector3 editorInput;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public TMP_InputField targetInputX;
|
||||||
|
public TMP_InputField targetInputY;
|
||||||
|
public TMP_InputField targetInputZ;
|
||||||
|
|
||||||
|
public override bool AllowInput
|
||||||
|
{
|
||||||
|
get => base.AllowInput;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (targetInputX != null)
|
||||||
|
targetInputX.readOnly = !value;
|
||||||
|
if (targetInputY != null)
|
||||||
|
targetInputY.readOnly = value;
|
||||||
|
if (targetInputZ != null)
|
||||||
|
targetInputZ.readOnly = value;
|
||||||
|
base.AllowInput = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region ÉúÃüÖÜÆÚ
|
||||||
|
|
||||||
|
protected override void OnValidate()
|
||||||
|
{
|
||||||
|
base.OnValidate();
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
if (targetInputX != null)
|
||||||
|
targetInputX.text = editorInput.x.ToString();
|
||||||
|
if (targetInputY != null)
|
||||||
|
targetInputY.text = editorInput.y.ToString();
|
||||||
|
if (targetInputZ != null)
|
||||||
|
targetInputZ.text = editorInput.z.ToString();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Awake()
|
||||||
|
{
|
||||||
|
base.Awake();
|
||||||
|
|
||||||
|
targetInputX.onSelect.AddListener(a =>
|
||||||
|
{
|
||||||
|
WhenStartEdit();
|
||||||
|
});
|
||||||
|
targetInputY.onSelect.AddListener(a =>
|
||||||
|
{
|
||||||
|
WhenStartEdit();
|
||||||
|
});
|
||||||
|
targetInputZ.onSelect.AddListener(a =>
|
||||||
|
{
|
||||||
|
WhenStartEdit();
|
||||||
|
});
|
||||||
|
targetInputX.onValueChanged.AddListener(a =>
|
||||||
|
{
|
||||||
|
var value = CastVector3(Value);
|
||||||
|
value.x = float.Parse(a);
|
||||||
|
SetValue(value);
|
||||||
|
});
|
||||||
|
targetInputY.onValueChanged.AddListener(a =>
|
||||||
|
{
|
||||||
|
var value = CastVector3(Value);
|
||||||
|
value.y = float.Parse(a);
|
||||||
|
SetValue(value);
|
||||||
|
});
|
||||||
|
targetInputZ.onValueChanged.AddListener(a =>
|
||||||
|
{
|
||||||
|
var value = CastVector3(Value);
|
||||||
|
value.z = float.Parse(a);
|
||||||
|
SetValue(value);
|
||||||
|
});
|
||||||
|
targetInputX.onEndEdit.AddListener(delegate
|
||||||
|
{
|
||||||
|
WhenEndEdit();
|
||||||
|
});
|
||||||
|
targetInputY.onEndEdit.AddListener(delegate
|
||||||
|
{
|
||||||
|
WhenEndEdit();
|
||||||
|
});
|
||||||
|
targetInputZ.onEndEdit.AddListener(delegate
|
||||||
|
{
|
||||||
|
WhenEndEdit();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region ʵÏÖ
|
||||||
|
|
||||||
|
protected override void SetValue(object newValue)
|
||||||
|
{
|
||||||
|
base.SetValue(CastVector3(newValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void RefreshValueWithoutEvent(object newValue, bool forceSet = false)
|
||||||
|
{
|
||||||
|
base.RefreshValueWithoutEvent(CastVector3(newValue), forceSet);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Initialization_ChildConstruction(UIBehaviour component)
|
||||||
|
{
|
||||||
|
base.Initialization_ChildConstruction(component);
|
||||||
|
|
||||||
|
var name = component.transform.name;
|
||||||
|
if (component is not TMP_InputField inputField)
|
||||||
|
return;
|
||||||
|
switch (name)
|
||||||
|
{
|
||||||
|
case "inputx":
|
||||||
|
case "inputX":
|
||||||
|
if (targetInputX != null)
|
||||||
|
targetInputX = inputField;
|
||||||
|
break;
|
||||||
|
case "inputy":
|
||||||
|
case "inputY":
|
||||||
|
if (targetInputY != null)
|
||||||
|
targetInputY = inputField;
|
||||||
|
break;
|
||||||
|
case "inputz":
|
||||||
|
case "inputZ":
|
||||||
|
if (targetInputZ != null)
|
||||||
|
targetInputZ = inputField;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void RefreshFormatValue(object newValue)
|
||||||
|
{
|
||||||
|
base.RefreshFormatValue(newValue);
|
||||||
|
var value = CastVector3(newValue);
|
||||||
|
targetInputX.text = value.x.ToString(numberFormat);
|
||||||
|
targetInputY.text = value.y.ToString(numberFormat);
|
||||||
|
targetInputZ.text = value.z.ToString(numberFormat);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b6e1779348dcc2b48a6f009b828e9b5d
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ec7555a0fb642c542aee477a7fbfcdb7
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
@@ -0,0 +1,33 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bcbfe98d29b703044a524e421fcacc2a
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 0
|
||||||
|
isOverridable: 1
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
- first:
|
||||||
|
Windows Store Apps: WindowsStoreApps
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6116f350f3c2bca4dbb63afc5febe614
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 23a5c2ef10b97d944a21755c6a5c520e
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,154 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Serialization;
|
||||||
|
|
||||||
|
namespace SesothoLine
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 线路绘制编辑器
|
||||||
|
/// </summary>
|
||||||
|
[CustomEditor(typeof(SesothoPeManager))]
|
||||||
|
public class SesothoPeManagerEditor : Editor
|
||||||
|
{
|
||||||
|
#region 委托事件
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 当前主要的鼠标动作
|
||||||
|
/// </summary>
|
||||||
|
private event Action CurrenMouseAction;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 字段属性
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是编辑绘制模式
|
||||||
|
/// </summary>
|
||||||
|
public bool IsDebugDrawMode;
|
||||||
|
|
||||||
|
private Vector3 _currentPosition;
|
||||||
|
|
||||||
|
private bool OpKey_ForceStr;
|
||||||
|
private bool OpKey_90Arc;
|
||||||
|
private bool OpKey_180Arc;
|
||||||
|
private bool OpKey_RevCisoid;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 生命周期
|
||||||
|
|
||||||
|
// private void OnEnable()
|
||||||
|
// {
|
||||||
|
// throw new NotImplementedException();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private void OnDisable()
|
||||||
|
// {
|
||||||
|
// throw new NotImplementedException();
|
||||||
|
// }
|
||||||
|
|
||||||
|
private void OnSceneGUI()
|
||||||
|
{
|
||||||
|
if (!IsDebugDrawMode) return;
|
||||||
|
|
||||||
|
int controlID = GUIUtility.GetControlID(FocusType.Keyboard);
|
||||||
|
if(GUIUtility.hotControl == 0)
|
||||||
|
HandleUtility.AddDefaultControl(controlID);
|
||||||
|
|
||||||
|
OpKey_ForceStr = false;
|
||||||
|
OpKey_90Arc = false;
|
||||||
|
OpKey_180Arc = false;
|
||||||
|
OpKey_RevCisoid = false;
|
||||||
|
|
||||||
|
if (Event.current.GetTypeForControl(controlID) == EventType.KeyDown)
|
||||||
|
{
|
||||||
|
switch (Event.current.keyCode)
|
||||||
|
{
|
||||||
|
case KeyCode.Escape:
|
||||||
|
IsDebugDrawMode = false;
|
||||||
|
break;
|
||||||
|
case KeyCode.LeftControl:
|
||||||
|
OpKey_ForceStr = true;
|
||||||
|
break;
|
||||||
|
case KeyCode.LeftAlt:
|
||||||
|
OpKey_90Arc = true;
|
||||||
|
break;
|
||||||
|
case KeyCode.LeftShift:
|
||||||
|
OpKey_180Arc = true;
|
||||||
|
break;
|
||||||
|
case KeyCode.R:
|
||||||
|
OpKey_RevCisoid = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var mousePos = Event.current.mousePosition;
|
||||||
|
if (Physics.Raycast(HandleUtility.GUIPointToWorldRay(mousePos), out var hit, float.MaxValue, 0xffff))
|
||||||
|
{
|
||||||
|
_currentPosition = hit.point;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Event.current.type == EventType.MouseUp && GUIUtility.hotControl == 0)
|
||||||
|
{
|
||||||
|
if (Event.current.button == 0)
|
||||||
|
{
|
||||||
|
CurrenMouseAction?.Invoke();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnInspectorGUI()
|
||||||
|
{
|
||||||
|
if (GUILayout.Button(IsDebugDrawMode ? "退出绘制模式" : "进入绘制模式"))
|
||||||
|
IsDebugDrawMode = !IsDebugDrawMode;
|
||||||
|
|
||||||
|
base.OnInspectorGUI();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 画线
|
||||||
|
|
||||||
|
private TerminalLine2T3 _line;
|
||||||
|
private TerminalPoint _startPoint;
|
||||||
|
private TerminalPoint _endPoint;
|
||||||
|
|
||||||
|
private void DarwLine()
|
||||||
|
{
|
||||||
|
_endPoint.transform.position = _currentPosition;
|
||||||
|
|
||||||
|
// _line.SetLineSegment(
|
||||||
|
// _lastPointPosition, _currentPosition,
|
||||||
|
// _lastPointNormal, _helperNormal
|
||||||
|
// );
|
||||||
|
|
||||||
|
|
||||||
|
if (OpKey_ForceStr)
|
||||||
|
_line.DrawStraightLine();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var angle = -1;
|
||||||
|
if (OpKey_90Arc || OpKey_180Arc)
|
||||||
|
{
|
||||||
|
angle = 0;
|
||||||
|
if (OpKey_90Arc)
|
||||||
|
angle += 90;
|
||||||
|
if (OpKey_180Arc)
|
||||||
|
angle += 180;
|
||||||
|
}
|
||||||
|
_line.AutomaticDrawCircularLine(angle, OpKey_RevCisoid);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算完毕后执行渲染,这里调用有可能会带来空引用问题
|
||||||
|
// 但在此之前的阶段已经对此进行过了处理所以没有关系,如果要照抄的话需要进行一些修改。
|
||||||
|
_line.UpdateRender();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 557f21129700c2640b88cafb45f16ee1
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"name": "Lrss3.SesothoLine.Editor",
|
||||||
|
"rootNamespace": "SesothoLineEditor",
|
||||||
|
"references": [
|
||||||
|
"Lrss3.Deconstruction",
|
||||||
|
"UnityEditor.UI"
|
||||||
|
],
|
||||||
|
"includePlatforms": [
|
||||||
|
"Editor"
|
||||||
|
],
|
||||||
|
"excludePlatforms": [],
|
||||||
|
"allowUnsafeCode": false,
|
||||||
|
"overrideReferences": false,
|
||||||
|
"precompiledReferences": [],
|
||||||
|
"autoReferenced": true,
|
||||||
|
"defineConstraints": [],
|
||||||
|
"versionDefines": [],
|
||||||
|
"noEngineReferences": false
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2428b220c378e91419f25330ce465c75
|
||||||
|
AssemblyDefinitionImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: faed1afa5c53aa24c95131dcabd45eb9
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Deconstruction.Runtime.UI;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEditor.UI;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Deconstruction.Editor.UI
|
||||||
|
{
|
||||||
|
|
||||||
|
[CustomEditor(typeof(CircleSlider) , true)]
|
||||||
|
public class CircleSliderEditor : SelectableEditor
|
||||||
|
{
|
||||||
|
private SerializedProperty m_Value;
|
||||||
|
private SerializedProperty FillOrigin;
|
||||||
|
private SerializedProperty m_MaxValue;
|
||||||
|
private SerializedProperty m_MinValue;
|
||||||
|
private SerializedProperty m_FillRect;
|
||||||
|
private SerializedProperty m_HandleRect;
|
||||||
|
private SerializedProperty m_FillOrigin;
|
||||||
|
private SerializedProperty m_Radius;
|
||||||
|
private SerializedProperty m_ClockWise;
|
||||||
|
// private SerializedProperty m_MaxAngle;
|
||||||
|
// private SerializedProperty m_MinAngle;
|
||||||
|
private SerializedProperty m_WholeNumbers;
|
||||||
|
|
||||||
|
|
||||||
|
protected override void OnEnable()
|
||||||
|
{
|
||||||
|
base.OnEnable();
|
||||||
|
|
||||||
|
m_FillRect = serializedObject.FindProperty("m_FillRect");
|
||||||
|
m_HandleRect = serializedObject.FindProperty("m_HandleRect");
|
||||||
|
m_MinValue = serializedObject.FindProperty("m_MinValue");
|
||||||
|
m_MaxValue = serializedObject.FindProperty("m_MaxValue");
|
||||||
|
m_Value = serializedObject.FindProperty("m_Value");
|
||||||
|
m_FillOrigin = serializedObject.FindProperty("m_FillOrigin");
|
||||||
|
m_Radius = serializedObject.FindProperty("m_Radius");
|
||||||
|
m_ClockWise = serializedObject.FindProperty("m_ClockWise");
|
||||||
|
m_WholeNumbers = serializedObject.FindProperty("m_WholeNumbers");
|
||||||
|
// m_MaxAngle = serializedObject.FindProperty("m_MaxAngle");
|
||||||
|
// m_MinAngle = serializedObject.FindProperty("m_MinAngle");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnInspectorGUI()
|
||||||
|
{
|
||||||
|
base.OnInspectorGUI();
|
||||||
|
serializedObject.Update();
|
||||||
|
|
||||||
|
EditorGUILayout.PropertyField(m_FillRect);
|
||||||
|
EditorGUILayout.PropertyField(m_HandleRect);
|
||||||
|
|
||||||
|
if (m_FillRect.objectReferenceValue != null )
|
||||||
|
{
|
||||||
|
EditorGUILayout.PropertyField(m_MinValue);
|
||||||
|
EditorGUILayout.PropertyField(m_MaxValue);
|
||||||
|
EditorGUILayout.PropertyField(m_WholeNumbers);
|
||||||
|
EditorGUILayout.Slider(m_Value, m_MinValue.floatValue, m_MaxValue.floatValue);
|
||||||
|
EditorGUILayout.PropertyField(m_FillOrigin);
|
||||||
|
EditorGUILayout.PropertyField(m_ClockWise);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_HandleRect.objectReferenceValue != null)
|
||||||
|
{
|
||||||
|
EditorGUILayout.PropertyField(m_Radius);
|
||||||
|
}
|
||||||
|
|
||||||
|
serializedObject.ApplyModifiedProperties();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b1f1f581af3fd5f4f9bdeaedd7c27516
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
@@ -0,0 +1,69 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 65aae7f37e34be6409e0966d54c89b6d
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 0
|
||||||
|
isOverridable: 1
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
: Any
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
Exclude Editor: 0
|
||||||
|
Exclude Linux64: 1
|
||||||
|
Exclude OSXUniversal: 1
|
||||||
|
Exclude Win: 1
|
||||||
|
Exclude Win64: 1
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
OS: AnyOS
|
||||||
|
- first:
|
||||||
|
Standalone: Linux64
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
- first:
|
||||||
|
Standalone: OSXUniversal
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: None
|
||||||
|
- first:
|
||||||
|
Standalone: Win
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: x86
|
||||||
|
- first:
|
||||||
|
Standalone: Win64
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: x86_64
|
||||||
|
- first:
|
||||||
|
Windows Store Apps: WindowsStoreApps
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f6d9af83259f2a74bab221b541a1b2ed
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2024 纸飞机
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ffdeedb95e1b528419119bc9a549a667
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,481 @@
|
|||||||
|
<h2 align="center">Deconstruction</h2>
|
||||||
|
|
||||||
|
<a href="https://gitee.com/none_9_0/xeric-library2"> 发布页面</a>
|
||||||
|
|
||||||
|
## 简介
|
||||||
|
|
||||||
|
unity通用库插件,现已转为unity 6000版本。
|
||||||
|
|
||||||
|
此插件为XericDigitalTwinTool插件库的前置依赖项。与MateriaLibrary材质库一起使用更好哦!
|
||||||
|
|
||||||
|
单独使用可能会遇到编译报错,可以直接删除报错指向的文件。造成报错的原因可能是版本不兼容,依赖项uid错误等等。如果能力足够,请自行解决。
|
||||||
|
|
||||||
|
## 软件架构
|
||||||
|
|
||||||
|
* CentralizeLog: 小日志,unity本身的日志在调用时开销巨大,所以提供一个小日志的类型保存临时的日志内容。
|
||||||
|
* Deconstruction: 通过数学公式对线进行描述,进行标准的CAD线路参数计算,并支持在线路上进行导航,合理性计算等
|
||||||
|
* RescissionRework: 撤销重做 🕑
|
||||||
|
* SerializerHelper: 序列化库
|
||||||
|
* XericLibrary: 实用性unity宏库,包含一些实用扩展用法。
|
||||||
|
|
||||||
|
## Deconstruction (线路绘制,暂缓更新)
|
||||||
|
|
||||||
|
Deconstruction 部分由两个dll组成,一个是 Deconstruction,另一个是 Deconstruction Style 。
|
||||||
|
|
||||||
|
### 线路绘制
|
||||||
|
----
|
||||||
|
|
||||||
|
|
||||||
|
线路绘制组件支持二维,或三维的线条计算,线条继承自“可放置物”类,为了能够显示线条,需要向其提供渲染器和,同理,为了能够算出构成线的点集合,需要提供线计算器。
|
||||||
|
为此插件内默认提供了一个使用lineRenderer组件的线渲染器,以及二维的直线和圆弧的线计算器。
|
||||||
|
在计算平面上的CAD线路时,通过实现二维的线计算器,并实现它的坐标转换方法,即可在任意表面上实现线的绘制与保存。
|
||||||
|
|
||||||
|
另外如果希望快速构建具有特制绘制规则的对象,则需要另外的可放置物管理器 PlaceElementManager ,
|
||||||
|
它继承于 SingleMonoBase ,所以可以通过单例的方式访问它。
|
||||||
|
|
||||||
|
可放置物管理器管理的是所有的可放置物对象,和决策工具类 DecisionMakerToolBase ,以及它们的生命周期。
|
||||||
|
|
||||||
|
工具类则提供了细致的针对如何放置对象的操作规则,并提供了操作栈表结构,
|
||||||
|
可以通过操作栈来实现具有链表关系的行为树,栈中的每个节点是行为树上的一个节点,
|
||||||
|
每个节点可以访问到上一个对象和下一个对象成员的节点。
|
||||||
|
|
||||||
|
每个节点可以是正在绘制的线,正在计算寻路的ai,或其他任何行为,
|
||||||
|
在节点内可以直接通过 ReplaceThis(new Exit_OpSlot()); 方法类来切换行为树的节点到一个新的节点。
|
||||||
|
|
||||||
|
* 基础规则
|
||||||
|
建议在工具类中进行创建等操作,管理类中只进行管理操作,比如在插件的sesotho部分的非dll文件中,提供了SesothoPeManager和SesothoArrangementWiresTool,他们就是管理器与工具类的派生部分。
|
||||||
|
|
||||||
|
* 按键规则
|
||||||
|
在没有任何工具启动的情况下,管理器可以接收按键输入,直到被工具输入抢占。
|
||||||
|
不过,管理器到工具中并没有任何抢占逻辑,所以请根据工具激活逻辑适时关闭按键处理。
|
||||||
|
另外,在没有任何工具激活的情况下,工具本身的按键获取机制也不会激活,记得使用原生的按键获取逻辑。
|
||||||
|
|
||||||
|
* 线路规则
|
||||||
|
|
||||||
|
|
||||||
|
* 链路规则
|
||||||
|
链路是指实现了IConterminousness接口的对象,这个接口提供了一个获取ICoterminous接口的访问器;
|
||||||
|
ICoterminous接口通常是用于实现链接关系的抽象层,简单的通过输入和输出来定义链接的线路,在接口中可以通过GetOpposite在当前对象的链接结构上下文中访问另一个与当前访问者相对应的链接对象,通常这是与访问者同类的对象,但是会经过接口进行抽象;而GetIdentical则可以获取与访问者同类链接的对象成员。
|
||||||
|
|
||||||
|
链路方向使用LinkType进行标记,也可以直接使用LinkType.SwapType()来快速反转这个链接标记;
|
||||||
|
LinkType可以直接和LinkedPortType相互进行转换,也可以使用LinkType.ConvertType()来快速转换类型。
|
||||||
|
链路方向通常只用在内部作为方向标识,外部无法获取,一般只在设置时进行一次标识设置即可。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### 线路结构
|
||||||
|
----
|
||||||
|
|
||||||
|
线路绘制组件提供了线路连接引用关系,可以将一个线连接到另一个线上,也可以用点将它们连接起来,
|
||||||
|
默认线
|
||||||
|
|
||||||
|
|
||||||
|
### 生命周期
|
||||||
|
----
|
||||||
|
|
||||||
|
|
||||||
|
由于所有的成员都是通过批处理器完成生命周期的定义,批处理器的调用时机对于后续的流程来说至关重要。
|
||||||
|
为了便于使用,所有的批处理对象的生命周期都遵循以下规则:
|
||||||
|
|
||||||
|
```
|
||||||
|
开始和结束时间在LateUpdate阶段触发;
|
||||||
|
主线程更新事件在Update阶段触发;
|
||||||
|
异步更新事件在LateUpdate阶段触发;
|
||||||
|
|
||||||
|
主线程事件在所有事件之后才执行;
|
||||||
|
```
|
||||||
|
|
||||||
|
* 安全检查
|
||||||
|
在批处理期间是允许销毁的,目前的安全限制仅限在更新前会检查一遍批处理的key值是否为空,在其他时刻,可以通过其他的接口传递的安全检查来辅助更新检查。
|
||||||
|
比如在PromptLine2中,如果太早或太迟调用UpdateRender会导致在更新期间捕获到一个空引用的报错,来源是linerenderer组件在此时还不存在,具体原理不清楚,但是只会提示一次,所以此时的渲染操作可以直接跳过。
|
||||||
|
|
||||||
|
### 获取工具
|
||||||
|
----
|
||||||
|
|
||||||
|
|
||||||
|
如果希望获取放置物管理器中的工具:
|
||||||
|
|
||||||
|
```
|
||||||
|
// 获取当前激活的工具目标
|
||||||
|
DecisionMakerToolBase.ActiveDecisionMaker
|
||||||
|
// 以及这个工具目标是否有效
|
||||||
|
DecisionMakerToolBase.HasAciveDecisionMaker
|
||||||
|
```
|
||||||
|
|
||||||
|
### 示例文件
|
||||||
|
----
|
||||||
|
|
||||||
|
|
||||||
|
在Runtime/HorizonLineOrbit中已经提供了基本的用例,将SesothoPeManager挂到任意一个节点上就可以了。
|
||||||
|
运行后按下键盘L键,此时点击世界中layer为defualt的物体,就会点击处y轴为0的位置上生成一个线,移动光标,线也会跟着移动。
|
||||||
|
|
||||||
|
这些脚本提供了一个基本的示例,并且几乎将所有可以进行配置修改的要素都呈现了出来,可以在后续的扩展中通过参考这些文件来进行实现。
|
||||||
|
|
||||||
|
在示例脚本中主要分为对元素的实现,以及对过程的实现;
|
||||||
|
* terminalPoint, TerminalLine2T3, TerminalIland是后续创建的实例所挂载的具有确定空间,绘制方式的实现。
|
||||||
|
* 其他的都是管理器,工具,操作栈的实现。
|
||||||
|
|
||||||
|
其中管理器,工具,操作栈类都是层层嵌套的引用结构,尽量只让相邻的两个过程进行相互的引用,比如工具应该引用管理器的实现,开放给操作栈。
|
||||||
|
|
||||||
|
|
||||||
|
### 使用须知
|
||||||
|
----
|
||||||
|
|
||||||
|
|
||||||
|
现在已知的线路绘制问题:
|
||||||
|
* 如果同时创建大量的操作栈(>500),并在之后的某个时刻中将它们全部隐式地释放掉,有可能会在之后的某个时刻带来庞大的GC占用(>90ms)
|
||||||
|
* 逆时针绘制的曲线线路没法计算最近点。
|
||||||
|
|
||||||
|
## XericLibrary (主要核心库)
|
||||||
|
|
||||||
|
XericLibrary 部分由两个dll组成,一个是 Xeric Library,另一个是 Xeric Library Editor 。
|
||||||
|
|
||||||
|
### 宏库
|
||||||
|
|
||||||
|
#### 特性库
|
||||||
|
----
|
||||||
|
|
||||||
|
* CanFind$
|
||||||
|
其中包含多个特性类,用于查找类,字段,属性,方法等项目。
|
||||||
|
|
||||||
|
* ReName
|
||||||
|
重命名特性,在没有安装odin插件的旧版本引擎上可以直接替换细节面板中的参数名称,不过由于无法和odin兼容,所以odin的功能会覆盖掉这个特性。
|
||||||
|
主要作用是提供属性标签查找功能。
|
||||||
|
|
||||||
|
#### 协程宏
|
||||||
|
#### 调试宏
|
||||||
|
#### 模型网格宏
|
||||||
|
#### 机器标识宏
|
||||||
|
#### 摄像机宏
|
||||||
|
#### 颜色宏
|
||||||
|
#### 常数宏
|
||||||
|
#### 曲线宏
|
||||||
|
#### 枚举宏
|
||||||
|
|
||||||
|
枚举宏包含一个缓存封装器,可以通过<code>MacroEnum\<enum\></code>来定义。
|
||||||
|
定义枚举结构封装将允许像列表一样访问这个枚举,或将枚举实例赋予,通过枚举封装器来操作枚举值。
|
||||||
|
在新版中,枚举封装器可以使用单例写法访问,而不再需要手动声名保存实例了。
|
||||||
|
|
||||||
|
#### 方程宏
|
||||||
|
#### 事件宏
|
||||||
|
#### 文件宏
|
||||||
|
#### 步进宏
|
||||||
|
#### 按键宏
|
||||||
|
#### 集合宏
|
||||||
|
#### 数学宏
|
||||||
|
#### 消息库
|
||||||
|
|
||||||
|
预设一些消息处理流程。
|
||||||
|
|
||||||
|
* 全局业务分发器,消息入口Entry。
|
||||||
|
|
||||||
|
特点是需要通过指定消息入口(<code>RedirectReceiverMessage</code>)和出口(<code>RedirectReceiver</code>)来中转消息。
|
||||||
|
完成后消息发送时会被进行一次包装,将带有入口名称的内容一同发送;而在消息处理的另一端,也需要用相同的逻辑处理这个包,就能获得这个包来自哪,并自动定位到对应的预定义委托上进行处理。
|
||||||
|
下面是一个接收示例:
|
||||||
|
```
|
||||||
|
// 声名一个消息处理器委托
|
||||||
|
// 接收器形参可以是任何可以序列化的结构,或是无形参接收器。
|
||||||
|
public MacroMessage.ReceiverObject<int> myFunc;
|
||||||
|
public void Awake()
|
||||||
|
{
|
||||||
|
// 初始化函数中注册这个委托,并赋予一个名称用于标识
|
||||||
|
myFunc.RedirectReceiver(nameof(myFunc));
|
||||||
|
myFunc += Func;
|
||||||
|
}
|
||||||
|
// 处理消息
|
||||||
|
public void Func(int number)
|
||||||
|
{
|
||||||
|
// 消息处理
|
||||||
|
}
|
||||||
|
```
|
||||||
|
下面是一个发送示例:
|
||||||
|
```
|
||||||
|
// 在收到文本消息后,立刻发送给重定向器
|
||||||
|
void OnMessage(string message)
|
||||||
|
{
|
||||||
|
MacroMessage.RedirectReceiverMessage(message);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
最后,需要定义何时处理消息:
|
||||||
|
```
|
||||||
|
// 比如放在帧更新事件中,消息会作为队列加入,然后逐个处理。
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
MacroMessage.MainThreadProcessingMessage();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
* 方法封装器
|
||||||
|
提供一个方法软引用封装器,首先需要将一个可执行流程转换为<code>CallableTarget</code>对象。然后通过<code>AddCallableFunction</code>添加到全局字典中,随后可以通过<code>TryEvocation</code>或者<code>Evocation</code>调用。
|
||||||
|
方法封装器默认可以搜索所有静态,实例,私有,公共的方法
|
||||||
|
|
||||||
|
|
||||||
|
#### 对象宏
|
||||||
|
#### PID宏
|
||||||
|
#### 对象池宏
|
||||||
|
|
||||||
|
预设快速设置的对象池(CreatSimplePool)与顺序对象池(CreatObjectInOrderPool),传入预制体与父级,将直接返回一个预设的对象池。
|
||||||
|
|
||||||
|
提供一个联合对象池(预设的)<code>MacroPool.UnionSet</code>,支持开放预制体目标与父级目标参数到inspector。
|
||||||
|
联合对象池需要手动调用Init函数进行初始化。
|
||||||
|
|
||||||
|
#### 矩形变换宏
|
||||||
|
#### 超驰宏
|
||||||
|
#### 仓库宏
|
||||||
|
#### 材质宏
|
||||||
|
#### 平滑宏
|
||||||
|
#### 排序宏
|
||||||
|
|
||||||
|
c#自带的排序很好用,但是选择何种排序模式是根据数据类型自动切换的。
|
||||||
|
在这里,排序宏中提供了一些可以手动选择的排序算法。
|
||||||
|
注:没有猴子排序。
|
||||||
|
|
||||||
|
#### 文本宏
|
||||||
|
|
||||||
|
提供:
|
||||||
|
* StringBuilderPool: 文本构建池
|
||||||
|
* join: 文本序列拼接。
|
||||||
|
* 文本判断:空判断,空格判断,相等判断,字符集判断
|
||||||
|
* 格式包裹:支持TMP的26个富文本标签,或者自行扩展更多包裹器。
|
||||||
|
包裹器可以依靠多态模型来构建文本,而不依赖字面量构建。下面是一个示例:
|
||||||
|
```
|
||||||
|
_blockBuilder = new TextBlockBuilder(
|
||||||
|
new ColorBlock(Color.white, "重量"),
|
||||||
|
new DelegateBlock(() => value.ToString()),
|
||||||
|
new SizeBlock(20, "kg")));
|
||||||
|
```
|
||||||
|
TextBlockBuilder 是所有blocker的基类,使用它包裹所有文本将起到单纯拼接文本的作用;TextBlockBuilder 里的三个block的作用是使用相应的富文本标签包裹,根据标签的类型,包裹器会自动决定标签格式。
|
||||||
|
<code>DelegateBlock</code>的作用是通过委托来实时获取一个变量,示例中直接获取value的文本值,拼接到结果中。
|
||||||
|
TextBlockBuilder 可以不依靠如<code>DelegateBlock</code>这样的包裹器,可以直接将返回字符串类型的方法委托传入,blocker 会自动识别;前提是开启对应 blocker 里的<code>compatibility</code>兼容性检查,但这会带来额外的性能开销,如果没有特别的需求,建议还是使用<code>DelegateBlock</code>进行多态封装,这样也会更安全。
|
||||||
|
|
||||||
|
在新的更新中,包裹器支持大括号写法,同时可以省略部分参数:
|
||||||
|
```
|
||||||
|
_blockBuilder = new TextBlockBuilder()
|
||||||
|
{
|
||||||
|
new ColorBlock()
|
||||||
|
{
|
||||||
|
"重量"
|
||||||
|
},
|
||||||
|
new DelegateBlock(() => value.ToString()),
|
||||||
|
new SizeBlock(20)
|
||||||
|
{
|
||||||
|
"kg"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
```
|
||||||
|
这里的作用与上面的示例完全一致,更新的包裹器中支持自动填入更多的默认值了,比如颜色默认为白色。
|
||||||
|
|
||||||
|
* 文本转换:自动值转换为文本。
|
||||||
|
* NumberToChinese:将数值转为中文大写。
|
||||||
|
* 沃格纳费舍尔拼写检查器:检查一对或多对文本是否相似,返回最相似的文本序列,及相似度。
|
||||||
|
|
||||||
|
#### 时间宏
|
||||||
|
#### 轴变换宏
|
||||||
|
#### 类型扩展
|
||||||
|
#### 矢量扩展
|
||||||
|
|
||||||
|
#### 导航宏
|
||||||
|
----
|
||||||
|
|
||||||
|
提供寻路算法核,寻路几何体构造器(未实装)。
|
||||||
|
|
||||||
|
* AStart寻路算法核
|
||||||
|
通过<code>AStart2</code>提供,算法核只包含计算过程,需要被计算的对象上实现接口<code>IAstartNavNeighborNode</code>。
|
||||||
|
接口中需要定义当前“可寻路对象”的距离模式,相邻代价,以及所有邻居。
|
||||||
|
如果需要定义管理器,可使用<code>AStartNode</code>进行快速封装。
|
||||||
|
|
||||||
|
|
||||||
|
#### 安全宏(计划废弃)
|
||||||
|
----
|
||||||
|
|
||||||
|
提供<code>ProgramFlowSecurity</code>类,以及相关的扩展和符属类型。
|
||||||
|
安全宏用于,当一个方法中需要通过委托等方法动态调用其他一个或多个方法时,如果其中的某个方法报错,会导致后续所有方法不可用,且调用这些方法的方法也会因为错误抛出而停止,且如果运行在unity关键阶段,比如awake时,可能还会导致脚本被disable。
|
||||||
|
|
||||||
|
使用安全宏封装要调用的委托,并指定调用时的标识位,当产生错误时,安全宏会捕获这个错误,并转为抛出错误信息,如果选择默认解决,那么这个错误将不会影响后续运行。
|
||||||
|
但当下次调用时,安全宏将再次抛出一个错误信息,表示已经发生错误的委托被再次调用。
|
||||||
|
|
||||||
|
#### 转换宏
|
||||||
|
----
|
||||||
|
|
||||||
|
|
||||||
|
### Spline组件
|
||||||
|
----
|
||||||
|
|
||||||
|
提供<code>XericSplinePath</code>,<code>XericRectSplinePath</code>组件。
|
||||||
|
他们的区别是,一个用于三维世界,另一个用于UI界面。
|
||||||
|
UI界面上的Spline组件会通过RectTransform控制,有区别与三维世界。
|
||||||
|
|
||||||
|
<code>XericSplinePath</code>可以直接在unity中进行挂载,并通过界面编辑点,在列表中可以增加和减少点,或改变点的顺序。
|
||||||
|
|
||||||
|
在脚本中使用<code>XericSplinePath</code>定义字段,可以让脚本在inspecter上呈现一个引用端口,引用组件以获取曲线实例。
|
||||||
|
|
||||||
|
曲线通常用于静态计算,在设计上并未考虑动态刷新,动态构建曲线的方法,如果希望动态地构建曲线,可以自行根据其中的结构提供点位数据。
|
||||||
|
|
||||||
|
在<code>XericSplinePath</code>曲线上初始时使用<code>BakePoint()</code>来烘焙一次数据,这个方法会在线组件上生成BakeData,有这个数据可以获得速度正确的的曲线映射,如果担心多个烘焙进行时的性能问题,可以使用协程方法<code>BakePointCoroutine()</code>推迟烘焙到来。
|
||||||
|
烘焙的速度与精度有关,<code>BakePoint()</code>包含一个形参用于输入烘焙精度,默认100,表示进行100次采样,理论上采样越多,精度越高,但实际上并非越高越好,采样数量保持在数倍于实际点数量即可。
|
||||||
|
烘焙后的曲线才可以使用重映射<code>RemappingTimeValue()</code>,同时也可以使用<code>SplineLength</code>获取曲线的长度。
|
||||||
|
|
||||||
|
在曲线实例上可以访问<code>Evaluate...()</code>方法来计算坐标,旋转,数值,颜色过度。
|
||||||
|
方法要求给定一个驱动值t,取值范围在0-1之间。
|
||||||
|
默认情况下,驱动值是几乎等分地控制着每条线路的,无论两个点之间的距离长短,都近似为“时间”相等的多段线,这意味着无法通过这样的一个线驱动一个物体平滑地从起点运动到终点。
|
||||||
|
而开头我们使用<code>BakePoint()</code>烘焙的数据就起作用了,通过调用线实例上的<code>RemappingTimeValue()</code>将时间驱动值转换为速度驱动值,这会带来非常平滑的效果。
|
||||||
|
|
||||||
|
2D的线路组件<code>XericRectSplinePath</code>工作在Rect上,如果屏幕的工作分辨率实际上是可变的,可能会导致实际线路有时会错位,这是因为线路工作的参考坐标系是静态的。
|
||||||
|
如果当前项目的窗口缩放易变,建议每帧调用<code>UpdateRectDepend()</code>(一般都很难遇到分辨率亘古不变的情况),这个方法可以刷新曲线构建所依赖的矩形空间坐标。
|
||||||
|
|
||||||
|
为了适配速度矫正后的线路,建议使用线路的长度作为循环的时间最大值,而不是强制所有线路从0-1取值,线路总长度可以使用<code>SplineLength</code>属性获取。
|
||||||
|
这里是一个示例:(这个示例中使用的是二维曲线,但设置ui的方法是世界空间的,并非屏幕空间,这是因为我驱动的目标对象还是世界空间的Sprite,同时较小的ui坐标便于计算尾迹的长度,避免结果速度太快)
|
||||||
|
```
|
||||||
|
public void UpdateBySpline(XericRectSplinePath spline)
|
||||||
|
{
|
||||||
|
totalTime = (float)spline.SplineLength;
|
||||||
|
var remappingTime = time / totalTime; // 这是没有速度矫正的值
|
||||||
|
remappingTime = spline.RemappingTimeValue(remappingTime); // 经过速度矫正
|
||||||
|
// 设置坐标
|
||||||
|
var pos = spline.EvaluatePosition(remappingTime); // 获得坐标
|
||||||
|
transform.position = pos;
|
||||||
|
// 设置旋转朝向运动方向
|
||||||
|
var lastOffset = (lastPosition - pos).normalized;
|
||||||
|
var ang = Mathf.Atan2(lastOffset.y, lastOffset.x) * Mathf.Rad2Deg;
|
||||||
|
transform.localRotation = Quaternion.Euler(0, 0, ang);
|
||||||
|
lastPosition = pos;
|
||||||
|
// 设置缩放,来自曲线上定义的浮点值
|
||||||
|
var size = spline.EvaluateValue(remappingTime);
|
||||||
|
transform.localScale = size;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### 简易批处理器
|
||||||
|
----
|
||||||
|
|
||||||
|
在代码中引用 XericLibrary.Runtime.Type.BatchProcess ,
|
||||||
|
并将需要进行批处理的对象实现 ICanBatchProcess<T> 接口,
|
||||||
|
其中提供了所有额外支持的生命周期事件,可以直接实现或显式实现。
|
||||||
|
|
||||||
|
缺点是只有异步方法的生命周期约束,且没有提供线程安全的数据类型。
|
||||||
|
|
||||||
|
和官方的相比没有什么优势,只是作为dll内部的部分程序的替代品,没事不要用这个。
|
||||||
|
|
||||||
|
### 多维布尔
|
||||||
|
----
|
||||||
|
|
||||||
|
提供<code>Bool1</code>,<code>Bool2</code>,<code>Bool3</code>,<code>Booln</code>。
|
||||||
|
其中除了<code>Booln</code>是类,其他都是结构体,在相互转换时需要注意。
|
||||||
|
|
||||||
|
不同的多维布尔对象之间可以互相转换,且参数不会遗失。
|
||||||
|
他们的区别是会在界面上绘制不同数量的参数。
|
||||||
|
|
||||||
|
其中bool1与普通布尔几乎无二,可以直接隐式转为bool,只是他存储的方式为int,可以用于bool隐式转为int。
|
||||||
|
|
||||||
|
### 时间节点
|
||||||
|
----
|
||||||
|
提供<code>TimingStamp</code>,<code>TimeStamp</code>。
|
||||||
|
|
||||||
|
TimingStamp用于时间快速转换,以及在unity界面上呈现的能力。
|
||||||
|
TimeStamp用于隐式的,在极短时间内(小于1tick)的时间戳的名称标记。
|
||||||
|
|
||||||
|
## DataBaseControl (快捷数据库)
|
||||||
|
|
||||||
|
数据库控制器,当前主要工作区域是SqlClient部分
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
### 基础使用
|
||||||
|
|
||||||
|
数据库操作的指令被抽象到Order类了(注释里会称为解释器),比如sqlClient就是sqlcOrder,其中sqlc代表sqlclient。
|
||||||
|
order类本质上是一个文本拼接器,为了方便管理,你可以使用对应类的order.GetOrder来获取池中的一条指令,比如:
|
||||||
|
```
|
||||||
|
var orderValues = SQLCHelper.GetOrder();
|
||||||
|
```
|
||||||
|
这个orderValues必须手动释放才会回到池中,比如:
|
||||||
|
```
|
||||||
|
orderValues.Dispost();
|
||||||
|
```
|
||||||
|
GetOrder指令可以在编译时静态调用,用作静态参数,不去释放,这样的话指令的生命周期会跟随程序释放而释放。
|
||||||
|
使用指令前建议先清空,避免指令污染:
|
||||||
|
```
|
||||||
|
orderValues.CleanOrder();
|
||||||
|
```
|
||||||
|
然后,可以在指令上调用对应的函数,里面预制了数据库连接增删改查,表增删改查,项增删改查,以及插入判断,筛选条件命令。
|
||||||
|
对于连接功能,可以参考下面的示例:
|
||||||
|
```
|
||||||
|
public void InitDataBase(string hostName, string databaseName, string tableName,
|
||||||
|
IEnumerable<MyData> valueData)
|
||||||
|
{
|
||||||
|
SQLCHelper.connectOrder.OrderSetServer(hostName, null);
|
||||||
|
// 数据库不存在,就创建一个
|
||||||
|
if ((int)orderValues.OrderIsDataBaseExist(databaseName)
|
||||||
|
.ExecuteScalar() <= 0)
|
||||||
|
orderValues.OrderCreatDataBase(databaseName)
|
||||||
|
.ExecuteNonQuery();
|
||||||
|
|
||||||
|
SQLCHelper.connectOrder.OrderSetServer(hostName, databaseName);
|
||||||
|
// 数据表不存在,就创建一个
|
||||||
|
if ((int)orderValues.OrderIsTableExist(tableName)
|
||||||
|
.ExecuteScalar() <= 0)
|
||||||
|
orderValues.OrderCreatTable(tableName)
|
||||||
|
.ExecuteNonQuery();
|
||||||
|
|
||||||
|
// 构建数据项目
|
||||||
|
orderValues.CleanValue();
|
||||||
|
orderValues.Values.AddRange(valueData.Select(a => new SqlCOrder.SqlCValue(a.name, a.value)));
|
||||||
|
|
||||||
|
// 数据项目不存在,就创建一个
|
||||||
|
if (valueData != null)
|
||||||
|
{
|
||||||
|
orderValues.OrderInsetTableItem(tableName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
可以看到前面会使用同一个order指令来执行命令构建,然后通过Execute方法来执行指令。
|
||||||
|
指令在构建时会将文本压入stringBuilder中,直到遇到Execute指令后,指令才会被拼接成具体的文本,存入历史指令中。
|
||||||
|
当这个指令中stringBuilder里没有待输出的指令时,会优先使用之前拼接过的文本,也就是说一条已经构建的指令可以被重复执行。
|
||||||
|
|
||||||
|
刚刚的示例代码也可以通过调用预制的扩展方法完成,比如:
|
||||||
|
```
|
||||||
|
orderValues.InitializationDataBase("localhost", "DEFAULT_DATABASE", "DEFAULT_TABLE");
|
||||||
|
```
|
||||||
|
上面这段指令会自动连接到地址localhost下,名为DEFAULT_DATABASE的DEFAULT_TABLE表中。
|
||||||
|
如果数据库中没有库或表,将会自动创建。这对于仅仅为了保存数据的情况来说会比较方便。
|
||||||
|
这种扩展指令根据其使用情景可能会相对于普通的方法有所区别,就比方说这个扩展方法会立刻执行,不需要手动调用Execute方法。
|
||||||
|
一般指令都仅仅只是将命令填入拼接池中,然后在Execute中执行order里的SubmitOrder()来持久化指令内容。
|
||||||
|
|
||||||
|
如果希望在内存中保留一个与数据库对应的数值,则可以使用order的Values属性;
|
||||||
|
一个order里的Values对应一个数据库表里的一列下的一个数据。
|
||||||
|
Value的name对应列名,value对应实际值。
|
||||||
|
|
||||||
|
还是上面那段完整的数据库创建函数实例中,最后的OrderInsetTableItem就是将values插入到表的指令,包括InitializationDataBase扩展中也会自动将当前执行的order里的values插入到表,所以这个指令会建议手动管理生命周期。
|
||||||
|
|
||||||
|
这里说明一下,指令里的方法名称是有特定规律的:
|
||||||
|
* 比如用于单段执行的指令方法,会使用Order开头,使用<code>.Order...</code>可以搜索到很多相关的指令。他们都会返回自身,用以支持链式的调用。
|
||||||
|
* 如果某个指令的后面可以继续添加指令,比如条件指令之类的,可以使用<code>.OrderJoin...</code>搜索到一些相关的预制指令。
|
||||||
|
* 而其他的指令则可以在扩展库中找到,扩展库中会专门针对特定的应用情景开放专门的方法。
|
||||||
|
|
||||||
|
#### 数据读写
|
||||||
|
|
||||||
|
在上面已经说过如何新建表,建表的时候会默认写入一次数据,而如果希望手动定义表格里的内容的话可以这么写:
|
||||||
|
```
|
||||||
|
order.OrderJoinValuesDefinitinOnly(orderValues.Values);
|
||||||
|
```
|
||||||
|
如果希望填入当前order里的Values的话,可以这么写:
|
||||||
|
```
|
||||||
|
```
|
||||||
|
|
||||||
|
读取可以使用:
|
||||||
|
```
|
||||||
|
orderValues.OrderSelect("DEFAULT_TABLE", null, null, true, true);
|
||||||
|
```
|
||||||
|
这段指令将orderValues里的value作为项目进行查询,由于两个null没有指定条件和排序,所以这会返回所有value的值。
|
||||||
|
记得使用ExecuteReader执行,并返回阅读器进行处理,在阅读器中,需要手动根据值名称一一对应地将值填回orderValues里。
|
||||||
|
|
||||||
|
不过在扩展类中也提供了自动地读取逻辑:
|
||||||
|
```
|
||||||
|
orderValues.ReadLatestValue("DEFAULT_TABLE");
|
||||||
|
```
|
||||||
|
这会读取数据库中的,orderValues中的值,并直接写在orderValues的每一项中。
|
||||||
|
然后直接对orderValues中的values进行处理姐可以了。
|
||||||
|
|
||||||
|
需要注意的是,这些指令虽然没有明确要求数据库连接,但还是至少需要连接过一次数据库,比如至少调用过一次InitializationDataBase方法,这样,后续的所有指令都可以不需要主动指定connectOrder项目。
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 019144fe8aedc3f499e254bf3e42bf14
|
||||||
|
TextScriptImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4a39969a6ab3a784a966b967e9bf6aa8
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8a2c41b83ca78de4db64f1a357f0af29
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 89918c623ee85524abc8f3b1392af91a
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4743ef177c5bfb546b5b9c72efc59b3b
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!21 &2100000
|
||||||
|
Material:
|
||||||
|
serializedVersion: 8
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: SceneGround
|
||||||
|
m_Shader: {fileID: -6465566751694194690, guid: c508188bc2ab04746ba729aded8434fa, type: 3}
|
||||||
|
m_ValidKeywords: []
|
||||||
|
m_InvalidKeywords: []
|
||||||
|
m_LightmapFlags: 4
|
||||||
|
m_EnableInstancingVariants: 0
|
||||||
|
m_DoubleSidedGI: 0
|
||||||
|
m_CustomRenderQueue: -1
|
||||||
|
stringTagMap: {}
|
||||||
|
disabledShaderPasses: []
|
||||||
|
m_SavedProperties:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TexEnvs:
|
||||||
|
- _BumpMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailAlbedoMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailMask:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailNormalMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _EmissionMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _MainTex:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _MetallicGlossMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _OcclusionMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _ParallaxMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _Texture2D:
|
||||||
|
m_Texture: {fileID: 10309, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _Texture2D_Normal:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- unity_Lightmaps:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- unity_LightmapsInd:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- unity_ShadowMasks:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
m_Ints: []
|
||||||
|
m_Floats:
|
||||||
|
- _BUILTIN_QueueControl: 0
|
||||||
|
- _BUILTIN_QueueOffset: 0
|
||||||
|
- _BumpScale: 1
|
||||||
|
- _Cutoff: 0.5
|
||||||
|
- _DetailNormalMapScale: 1
|
||||||
|
- _DstBlend: 0
|
||||||
|
- _GlossMapScale: 1
|
||||||
|
- _Glossiness: 0.5
|
||||||
|
- _GlossyReflections: 1
|
||||||
|
- _Metallic: 0
|
||||||
|
- _Mode: 0
|
||||||
|
- _OcclusionStrength: 1
|
||||||
|
- _Parallax: 0.02
|
||||||
|
- _QueueControl: -1
|
||||||
|
- _QueueOffset: 0
|
||||||
|
- _SmoothnessTextureChannel: 0
|
||||||
|
- _SpecularHighlights: 1
|
||||||
|
- _SrcBlend: 1
|
||||||
|
- _UVSec: 0
|
||||||
|
- _ZWrite: 1
|
||||||
|
m_Colors:
|
||||||
|
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||||
|
m_BuildTextureStacks: []
|
||||||
|
--- !u!114 &1580504613398626283
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 11
|
||||||
|
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: 639247ca83abc874e893eb93af2b5e44, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
version: 0
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b13df369c6ed3a64a9c4024a6333b4cf
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 2100000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c508188bc2ab04746ba729aded8434fa
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 44e5a14a3900d124bb47f540a23b0451
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,157 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!21 &2100000
|
||||||
|
Material:
|
||||||
|
serializedVersion: 8
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: UISelectionBoxDraw
|
||||||
|
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_ValidKeywords: []
|
||||||
|
m_InvalidKeywords:
|
||||||
|
- _BUILTIN_SURFACE_TYPE_TRANSPARENT
|
||||||
|
m_LightmapFlags: 4
|
||||||
|
m_EnableInstancingVariants: 0
|
||||||
|
m_DoubleSidedGI: 0
|
||||||
|
m_CustomRenderQueue: -1
|
||||||
|
stringTagMap: {}
|
||||||
|
disabledShaderPasses: []
|
||||||
|
m_SavedProperties:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TexEnvs:
|
||||||
|
- _AlphaTex:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _BumpMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailAlbedoMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailMask:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailNormalMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _EmissionMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _MainTex:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _MetallicGlossMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _OcclusionMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _ParallaxMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- unity_Lightmaps:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- unity_LightmapsInd:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- unity_ShadowMasks:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
m_Ints: []
|
||||||
|
m_Floats:
|
||||||
|
- PixelSnap: 0
|
||||||
|
- _Alpha: 0.2
|
||||||
|
- _BUILTIN_AlphaClip: 0
|
||||||
|
- _BUILTIN_Blend: 0
|
||||||
|
- _BUILTIN_CullMode: 2
|
||||||
|
- _BUILTIN_DstBlend: 10
|
||||||
|
- _BUILTIN_QueueControl: 0
|
||||||
|
- _BUILTIN_QueueOffset: 0
|
||||||
|
- _BUILTIN_SrcBlend: 5
|
||||||
|
- _BUILTIN_Surface: 1
|
||||||
|
- _BUILTIN_ZTest: 4
|
||||||
|
- _BUILTIN_ZWrite: 0
|
||||||
|
- _BUILTIN_ZWriteControl: 0
|
||||||
|
- _BumpScale: 1
|
||||||
|
- _ColorMask: 15
|
||||||
|
- _CullMode: 0
|
||||||
|
- _Cutoff: 0.5
|
||||||
|
- _DetailNormalMapScale: 1
|
||||||
|
- _DstBlend: 0
|
||||||
|
- _Edge: 5
|
||||||
|
- _EdgeAlpha: 0.8
|
||||||
|
- _EdgeThera: 0.0001
|
||||||
|
- _EnableExternalAlpha: 0
|
||||||
|
- _GlossMapScale: 1
|
||||||
|
- _Glossiness: 0.5
|
||||||
|
- _GlossyReflections: 1
|
||||||
|
- _Metallic: 0
|
||||||
|
- _Mode: 0
|
||||||
|
- _OcclusionStrength: 1
|
||||||
|
- _Parallax: 0.02
|
||||||
|
- _Precision: 100
|
||||||
|
- _QueueControl: -1
|
||||||
|
- _QueueOffset: 0
|
||||||
|
- _SmoothnessTextureChannel: 0
|
||||||
|
- _SpecularHighlights: 1
|
||||||
|
- _SrcBlend: 1
|
||||||
|
- _Stencil: 0
|
||||||
|
- _StencilComp: 8
|
||||||
|
- _StencilOp: 0
|
||||||
|
- _StencilReadMask: 255
|
||||||
|
- _StencilWriteMask: 255
|
||||||
|
- _UVSec: 0
|
||||||
|
- _UseUIAlphaClip: 0
|
||||||
|
- _ZWrite: 1
|
||||||
|
m_Colors:
|
||||||
|
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
|
||||||
|
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
- _EdgeColor: {r: 1, g: 1, b: 1, a: 0.8352941}
|
||||||
|
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||||
|
- _Flip: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
- _Point1: {r: 0, g: 0, b: 0, a: 0}
|
||||||
|
- _Point2: {r: 0, g: 0, b: 0, a: 0}
|
||||||
|
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_BuildTextureStacks: []
|
||||||
|
--- !u!114 &5744030932169462819
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 11
|
||||||
|
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: 639247ca83abc874e893eb93af2b5e44, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
version: 0
|
||||||
|
--- !u!114 &7813913351238974909
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 11
|
||||||
|
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
version: 5
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a03a3cfcd64713a4f83bd9966e474ac1
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 2100000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 41f84080474f68743b85cc98577121dc
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6deb65a87a47b3645acddff5802d7212
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f835902a541afd34dbd818c1b2fd5686
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
@@ -0,0 +1,109 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7549b1b335c37824d9a2698c91f295b7
|
||||||
|
ModelImporter:
|
||||||
|
serializedVersion: 22200
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
materials:
|
||||||
|
materialImportMode: 2
|
||||||
|
materialName: 0
|
||||||
|
materialSearch: 1
|
||||||
|
materialLocation: 1
|
||||||
|
animations:
|
||||||
|
legacyGenerateAnimations: 4
|
||||||
|
bakeSimulation: 0
|
||||||
|
resampleCurves: 1
|
||||||
|
optimizeGameObjects: 0
|
||||||
|
removeConstantScaleCurves: 0
|
||||||
|
motionNodeName:
|
||||||
|
rigImportErrors:
|
||||||
|
rigImportWarnings:
|
||||||
|
animationImportErrors:
|
||||||
|
animationImportWarnings:
|
||||||
|
animationRetargetingWarnings:
|
||||||
|
animationDoRetargetingWarnings: 0
|
||||||
|
importAnimatedCustomProperties: 0
|
||||||
|
importConstraints: 0
|
||||||
|
animationCompression: 1
|
||||||
|
animationRotationError: 0.5
|
||||||
|
animationPositionError: 0.5
|
||||||
|
animationScaleError: 0.5
|
||||||
|
animationWrapMode: 0
|
||||||
|
extraExposedTransformPaths: []
|
||||||
|
extraUserProperties: []
|
||||||
|
clipAnimations: []
|
||||||
|
isReadable: 0
|
||||||
|
meshes:
|
||||||
|
lODScreenPercentages: []
|
||||||
|
globalScale: 1
|
||||||
|
meshCompression: 0
|
||||||
|
addColliders: 0
|
||||||
|
useSRGBMaterialColor: 1
|
||||||
|
sortHierarchyByName: 1
|
||||||
|
importPhysicalCameras: 1
|
||||||
|
importVisibility: 1
|
||||||
|
importBlendShapes: 1
|
||||||
|
importCameras: 1
|
||||||
|
importLights: 1
|
||||||
|
nodeNameCollisionStrategy: 1
|
||||||
|
fileIdsGeneration: 2
|
||||||
|
swapUVChannels: 0
|
||||||
|
generateSecondaryUV: 0
|
||||||
|
useFileUnits: 1
|
||||||
|
keepQuads: 0
|
||||||
|
weldVertices: 1
|
||||||
|
bakeAxisConversion: 0
|
||||||
|
preserveHierarchy: 0
|
||||||
|
skinWeightsMode: 0
|
||||||
|
maxBonesPerVertex: 4
|
||||||
|
minBoneWeight: 0.001
|
||||||
|
optimizeBones: 1
|
||||||
|
meshOptimizationFlags: -1
|
||||||
|
indexFormat: 0
|
||||||
|
secondaryUVAngleDistortion: 8
|
||||||
|
secondaryUVAreaDistortion: 15.000001
|
||||||
|
secondaryUVHardAngle: 88
|
||||||
|
secondaryUVMarginMethod: 1
|
||||||
|
secondaryUVMinLightmapResolution: 40
|
||||||
|
secondaryUVMinObjectScale: 1
|
||||||
|
secondaryUVPackMargin: 4
|
||||||
|
useFileScale: 1
|
||||||
|
strictVertexDataChecks: 0
|
||||||
|
tangentSpace:
|
||||||
|
normalSmoothAngle: 60
|
||||||
|
normalImportMode: 0
|
||||||
|
tangentImportMode: 3
|
||||||
|
normalCalculationMode: 4
|
||||||
|
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
|
||||||
|
blendShapeNormalImportMode: 1
|
||||||
|
normalSmoothingSource: 0
|
||||||
|
referencedClips: []
|
||||||
|
importAnimation: 1
|
||||||
|
humanDescription:
|
||||||
|
serializedVersion: 3
|
||||||
|
human: []
|
||||||
|
skeleton: []
|
||||||
|
armTwist: 0.5
|
||||||
|
foreArmTwist: 0.5
|
||||||
|
upperLegTwist: 0.5
|
||||||
|
legTwist: 0.5
|
||||||
|
armStretch: 0.05
|
||||||
|
legStretch: 0.05
|
||||||
|
feetSpacing: 0
|
||||||
|
globalScale: 1
|
||||||
|
rootMotionBoneName:
|
||||||
|
hasTranslationDoF: 0
|
||||||
|
hasExtraRoot: 0
|
||||||
|
skeletonHasParents: 1
|
||||||
|
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||||
|
autoGenerateAvatarMappingIfUnspecified: 1
|
||||||
|
animationType: 2
|
||||||
|
humanoidOversampling: 1
|
||||||
|
avatarSetup: 0
|
||||||
|
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
|
||||||
|
importBlendShapeDeformPercent: 1
|
||||||
|
remapMaterialsIfMaterialImportModeIsNone: 0
|
||||||
|
additionalBone: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
@@ -0,0 +1,105 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 92b65be2919a60249b5f519dfd7b1742
|
||||||
|
ModelImporter:
|
||||||
|
serializedVersion: 21202
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
materials:
|
||||||
|
materialImportMode: 2
|
||||||
|
materialName: 0
|
||||||
|
materialSearch: 1
|
||||||
|
materialLocation: 1
|
||||||
|
animations:
|
||||||
|
legacyGenerateAnimations: 4
|
||||||
|
bakeSimulation: 0
|
||||||
|
resampleCurves: 1
|
||||||
|
optimizeGameObjects: 0
|
||||||
|
removeConstantScaleCurves: 1
|
||||||
|
motionNodeName:
|
||||||
|
rigImportErrors:
|
||||||
|
rigImportWarnings:
|
||||||
|
animationImportErrors:
|
||||||
|
animationImportWarnings:
|
||||||
|
animationRetargetingWarnings:
|
||||||
|
animationDoRetargetingWarnings: 0
|
||||||
|
importAnimatedCustomProperties: 0
|
||||||
|
importConstraints: 0
|
||||||
|
animationCompression: 1
|
||||||
|
animationRotationError: 0.5
|
||||||
|
animationPositionError: 0.5
|
||||||
|
animationScaleError: 0.5
|
||||||
|
animationWrapMode: 0
|
||||||
|
extraExposedTransformPaths: []
|
||||||
|
extraUserProperties: []
|
||||||
|
clipAnimations: []
|
||||||
|
isReadable: 0
|
||||||
|
meshes:
|
||||||
|
lODScreenPercentages: []
|
||||||
|
globalScale: 1
|
||||||
|
meshCompression: 0
|
||||||
|
addColliders: 0
|
||||||
|
useSRGBMaterialColor: 1
|
||||||
|
sortHierarchyByName: 1
|
||||||
|
importVisibility: 1
|
||||||
|
importBlendShapes: 1
|
||||||
|
importCameras: 1
|
||||||
|
importLights: 1
|
||||||
|
nodeNameCollisionStrategy: 1
|
||||||
|
fileIdsGeneration: 2
|
||||||
|
swapUVChannels: 0
|
||||||
|
generateSecondaryUV: 0
|
||||||
|
useFileUnits: 1
|
||||||
|
keepQuads: 0
|
||||||
|
weldVertices: 1
|
||||||
|
bakeAxisConversion: 0
|
||||||
|
preserveHierarchy: 0
|
||||||
|
skinWeightsMode: 0
|
||||||
|
maxBonesPerVertex: 4
|
||||||
|
minBoneWeight: 0.001
|
||||||
|
optimizeBones: 1
|
||||||
|
meshOptimizationFlags: -1
|
||||||
|
indexFormat: 0
|
||||||
|
secondaryUVAngleDistortion: 8
|
||||||
|
secondaryUVAreaDistortion: 15.000001
|
||||||
|
secondaryUVHardAngle: 88
|
||||||
|
secondaryUVMarginMethod: 1
|
||||||
|
secondaryUVMinLightmapResolution: 40
|
||||||
|
secondaryUVMinObjectScale: 1
|
||||||
|
secondaryUVPackMargin: 4
|
||||||
|
useFileScale: 1
|
||||||
|
tangentSpace:
|
||||||
|
normalSmoothAngle: 60
|
||||||
|
normalImportMode: 0
|
||||||
|
tangentImportMode: 3
|
||||||
|
normalCalculationMode: 4
|
||||||
|
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
|
||||||
|
blendShapeNormalImportMode: 1
|
||||||
|
normalSmoothingSource: 0
|
||||||
|
referencedClips: []
|
||||||
|
importAnimation: 1
|
||||||
|
humanDescription:
|
||||||
|
serializedVersion: 3
|
||||||
|
human: []
|
||||||
|
skeleton: []
|
||||||
|
armTwist: 0.5
|
||||||
|
foreArmTwist: 0.5
|
||||||
|
upperLegTwist: 0.5
|
||||||
|
legTwist: 0.5
|
||||||
|
armStretch: 0.05
|
||||||
|
legStretch: 0.05
|
||||||
|
feetSpacing: 0
|
||||||
|
globalScale: 1
|
||||||
|
rootMotionBoneName:
|
||||||
|
hasTranslationDoF: 0
|
||||||
|
hasExtraRoot: 0
|
||||||
|
skeletonHasParents: 1
|
||||||
|
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||||
|
autoGenerateAvatarMappingIfUnspecified: 1
|
||||||
|
animationType: 2
|
||||||
|
humanoidOversampling: 1
|
||||||
|
avatarSetup: 0
|
||||||
|
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
|
||||||
|
additionalBone: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8353159549bc0b74dae8320db161b27d
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2c9d6141c22cf274f80f6e2061c6f5c1
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f19c25ad34929594289c10f5aecb5373
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 81125e8b237f1804c97d171c4f4cd789
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2d2e54232b0471c45ba6e8728efd1526
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f1c0cba0cf9b5984c9f36789b8104059
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b21886d1f8d94284aba68dda1fd622b0
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2ffb2362d770a7f49b6ef2ddf8487343
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 506909245b3d1e34a96d14195b91d2b0
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 102 B |
@@ -0,0 +1,138 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e356d2791269a284c998207e350f9a2a
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
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: 0
|
||||||
|
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
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites:
|
||||||
|
- serializedVersion: 2
|
||||||
|
name: EnptyAlphaMask_0
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
width: 9
|
||||||
|
height: 9
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
customData:
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
tessellationDetail: 0
|
||||||
|
bones: []
|
||||||
|
spriteID: d655c15f007b92f499032929d2788d7b
|
||||||
|
internalID: -124046767
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
outline: []
|
||||||
|
customData:
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID: 89b49044c7b1a0f4fb21b99306018017
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
nameFileIdTable:
|
||||||
|
EnptyAlphaMask_0: -124046767
|
||||||
|
mipmapLimitGroupName:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
@@ -0,0 +1,138 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 36f502cef2051f443b68387ceeb9e769
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
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: 0
|
||||||
|
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
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites:
|
||||||
|
- serializedVersion: 2
|
||||||
|
name: NoSingnal_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: 0
|
||||||
|
bones: []
|
||||||
|
spriteID: 7aae4ce55688e0e458e11d4c7defde24
|
||||||
|
internalID: -1545793296
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
outline: []
|
||||||
|
customData:
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID: 7f3bd3aba58f3d74e8dfef2f9d31c328
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
nameFileIdTable:
|
||||||
|
NoSingnal_0: -1545793296
|
||||||
|
mipmapLimitGroupName:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 076e3103fd035bd43979387746250ce2
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 281 B |
@@ -0,0 +1,164 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: fc1902f834b6b864eb4c371fd35233ed
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
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: 0
|
||||||
|
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: Win64
|
||||||
|
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: downArrow_0
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
width: 40
|
||||||
|
height: 40
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0.5, y: 0.5}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
customData:
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
tessellationDetail: 0
|
||||||
|
bones: []
|
||||||
|
spriteID: 3711a4e17f0f7ff40873ff4d1c378afb
|
||||||
|
internalID: -1132144671
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
outline: []
|
||||||
|
customData:
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID: 30e7d78d3672bd44f84d0f5b168e2fb9
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
nameFileIdTable:
|
||||||
|
downArrow_0: -1132144671
|
||||||
|
mipmapLimitGroupName:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 314 B |
@@ -0,0 +1,164 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 73b25019948e069479d7fdf8f3aaf028
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
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: 0
|
||||||
|
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: Win64
|
||||||
|
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: leftArrow_0
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
width: 40
|
||||||
|
height: 40
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0.5, y: 0.5}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
customData:
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
tessellationDetail: 0
|
||||||
|
bones: []
|
||||||
|
spriteID: a93e2a11a014b264ba7c8e2fae7fb225
|
||||||
|
internalID: -723925411
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
outline: []
|
||||||
|
customData:
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID: 6cbffd24228773842af1283531d466e7
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
nameFileIdTable:
|
||||||
|
leftArrow_0: -723925411
|
||||||
|
mipmapLimitGroupName:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 302 B |
@@ -0,0 +1,164 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: fb0070456ab58be4b8be84e324cd0c25
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
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: 0
|
||||||
|
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: Win64
|
||||||
|
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: rightArrow_0
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
width: 40
|
||||||
|
height: 40
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0.5, y: 0.5}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
customData:
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
tessellationDetail: 0
|
||||||
|
bones: []
|
||||||
|
spriteID: d33efeca61b5ffb4a9e2a9bb593e7839
|
||||||
|
internalID: -426332016
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
outline: []
|
||||||
|
customData:
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID: 6952c35590a2f56469b7dfeee5cf10ad
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
nameFileIdTable:
|
||||||
|
rightArrow_0: -426332016
|
||||||
|
mipmapLimitGroupName:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 251 B |
@@ -0,0 +1,164 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 067c123aad41dfa49b3bc2d445af9b71
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
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: 0
|
||||||
|
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: Win64
|
||||||
|
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: upArrow_0
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
width: 40
|
||||||
|
height: 40
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
customData:
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
tessellationDetail: 0
|
||||||
|
bones: []
|
||||||
|
spriteID: a6361f6cfeaa7f04e8025f879ac8f6f8
|
||||||
|
internalID: 1027759058
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
outline: []
|
||||||
|
customData:
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID: 41618ce41ef9ef448b77308f80b17cd3
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
nameFileIdTable:
|
||||||
|
upArrow_0: 1027759058
|
||||||
|
mipmapLimitGroupName:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0e668c33018d64749a3a8e0c66de0083
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
@@ -0,0 +1,33 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c754cc17629bc0f4cac54d1417f746b3
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 0
|
||||||
|
isOverridable: 1
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
- first:
|
||||||
|
Windows Store Apps: WindowsStoreApps
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
@@ -0,0 +1,33 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1b39cc2f24fda4c4c9f3ba622bca6f40
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 0
|
||||||
|
isOverridable: 1
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
- first:
|
||||||
|
Windows Store Apps: WindowsStoreApps
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a3ea1751279b1b4488793680b72f3bbb
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,132 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Serialization;
|
||||||
|
using XericLibrary.Runtime.CustomEditor;
|
||||||
|
using XericLibrary.Runtime.MacroLibrary;
|
||||||
|
using XericLibrary.Runtime.Type;
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
using UnityEditor;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public class ShowMyNameInScene : MonoBehaviour
|
||||||
|
{
|
||||||
|
[Rename("启用")] public bool Enable = false;
|
||||||
|
[Rename("仅选中时显示")] public bool OnlyShowOnSelect = false;
|
||||||
|
[Rename("目标是子项")] public bool ShowAllChindName = true;
|
||||||
|
[Rename("显示名称")] public bool ShowGameObjectName = false;
|
||||||
|
[Rename("显示模型名称")] public bool ShowMeshFilter_MeshName = false;
|
||||||
|
|
||||||
|
public bool RandomEachObjectColor = false;
|
||||||
|
public Color TextColor = Color.white;
|
||||||
|
public RectOffset TextBorder = new RectOffset(0,0,0,0);
|
||||||
|
public RectOffset TextMargin = new RectOffset(0,0,0,0);
|
||||||
|
public RectOffset TextPadding = new RectOffset(0,0,0,0);
|
||||||
|
public RectOffset TextOverflow = new RectOffset(0,0,0,0);
|
||||||
|
public Font font;
|
||||||
|
public int fontSize = 0;
|
||||||
|
public FontStyle fontStyle = FontStyle.Normal;
|
||||||
|
public TextClipping TextClipping = TextClipping.Overflow;
|
||||||
|
public ImagePosition ImagePosition = ImagePosition.ImageLeft;
|
||||||
|
public Vector2 ContentOffset = Vector2.zero;
|
||||||
|
public Vector2 FixedSize = Vector2.zero;
|
||||||
|
public Bool2 Stretch = new Bool2();
|
||||||
|
|
||||||
|
private GUIStyle TextStyle;
|
||||||
|
private StringBuilder _sb = new StringBuilder();
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
private void OnDrawGizmos()
|
||||||
|
{
|
||||||
|
if (!Enable)
|
||||||
|
return;
|
||||||
|
if (OnlyShowOnSelect && !ReferenceEquals(Selection.activeGameObject, this))
|
||||||
|
return;
|
||||||
|
|
||||||
|
TextStyle = new GUIStyle()
|
||||||
|
{
|
||||||
|
normal = new GUIStyleState()
|
||||||
|
{
|
||||||
|
textColor = TextColor,
|
||||||
|
// background =
|
||||||
|
},
|
||||||
|
border = TextBorder,
|
||||||
|
margin = TextMargin,
|
||||||
|
padding = TextPadding,
|
||||||
|
overflow = TextOverflow,
|
||||||
|
font = font,
|
||||||
|
fontSize = fontSize,
|
||||||
|
fontStyle = fontStyle,
|
||||||
|
richText = true,
|
||||||
|
clipping = TextClipping,
|
||||||
|
imagePosition = ImagePosition,
|
||||||
|
contentOffset = ContentOffset,
|
||||||
|
fixedHeight = FixedSize.y,
|
||||||
|
fixedWidth = FixedSize.x,
|
||||||
|
stretchHeight = Stretch.y,
|
||||||
|
stretchWidth = Stretch.x,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (ShowAllChindName)
|
||||||
|
{
|
||||||
|
foreach (var item in transform.GetChildren())
|
||||||
|
{
|
||||||
|
if (!item.gameObject.activeInHierarchy)
|
||||||
|
continue;
|
||||||
|
SwitchFilter(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DrawGameObjectNameInScene(transform, transform.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SwitchFilter(Transform target)
|
||||||
|
{
|
||||||
|
if (_sb == null)
|
||||||
|
_sb = new StringBuilder();
|
||||||
|
_sb.Clear();
|
||||||
|
|
||||||
|
if (RandomEachObjectColor)
|
||||||
|
TextStyle.normal.textColor = MacroColor.RandomHueColor(target.gameObject.GetInstanceID());
|
||||||
|
|
||||||
|
var position = target.position;
|
||||||
|
var mf = target.GetComponent<MeshFilter>();
|
||||||
|
if (mf != null)
|
||||||
|
{
|
||||||
|
var mesh = mf.mesh;
|
||||||
|
if (mesh != null)
|
||||||
|
position += target.rotation * mesh.bounds.center;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ShowGameObjectName)
|
||||||
|
_sb.AppendLine($"Name: {target.name}");
|
||||||
|
|
||||||
|
if (ShowMeshFilter_MeshName)
|
||||||
|
_sb.AppendLine($"Mesh: {GetComponentName<MeshFilter>(target, a => a.mesh?.name ?? "unknown")}");
|
||||||
|
|
||||||
|
DrawNameInScene(position, _sb.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DrawGameObjectNameInScene(Transform obj, string name)
|
||||||
|
{
|
||||||
|
Handles.Label(obj.position, name,TextStyle);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DrawNameInScene(Vector3 position, string name)
|
||||||
|
{
|
||||||
|
Handles.Label(position, name, TextStyle);
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetComponentName<T>(Transform target, Func<T, string> getName)
|
||||||
|
where T : Component
|
||||||
|
{
|
||||||
|
return getName(target.GetComponent<T>());
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3ac6efcf050970b4bb3c5d2f268c692a
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 99b1a17370714a649b8587a72ee325d2
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user