终于修复了PropertyItem多层预制体的收纳/展开rect错误
This commit is contained in:
@@ -1106,7 +1106,7 @@ MonoBehaviour:
|
|||||||
m_ChildAlignment: 0
|
m_ChildAlignment: 0
|
||||||
m_Spacing: 2
|
m_Spacing: 2
|
||||||
m_ChildForceExpandWidth: 1
|
m_ChildForceExpandWidth: 1
|
||||||
m_ChildForceExpandHeight: 1
|
m_ChildForceExpandHeight: 0
|
||||||
m_ChildControlWidth: 0
|
m_ChildControlWidth: 0
|
||||||
m_ChildControlHeight: 0
|
m_ChildControlHeight: 0
|
||||||
m_ChildScaleWidth: 0
|
m_ChildScaleWidth: 0
|
||||||
|
@@ -58,7 +58,7 @@ MonoBehaviour:
|
|||||||
m_ChildAlignment: 0
|
m_ChildAlignment: 0
|
||||||
m_Spacing: 0
|
m_Spacing: 0
|
||||||
m_ChildForceExpandWidth: 1
|
m_ChildForceExpandWidth: 1
|
||||||
m_ChildForceExpandHeight: 1
|
m_ChildForceExpandHeight: 0
|
||||||
m_ChildControlWidth: 0
|
m_ChildControlWidth: 0
|
||||||
m_ChildControlHeight: 0
|
m_ChildControlHeight: 0
|
||||||
m_ChildScaleWidth: 0
|
m_ChildScaleWidth: 0
|
||||||
|
@@ -14,13 +14,18 @@ namespace Convention
|
|||||||
public abstract void LoadAudioClip(AudioClip clip);
|
public abstract void LoadAudioClip(AudioClip clip);
|
||||||
public abstract AudioClip GetAudioClip();
|
public abstract AudioClip GetAudioClip();
|
||||||
public abstract float GetClockTime();
|
public abstract float GetClockTime();
|
||||||
|
public abstract void SetClockTime(float value);
|
||||||
|
|
||||||
public AudioClip CurrentClip
|
public AudioClip CurrentClip
|
||||||
{
|
{
|
||||||
get => GetAudioClip();
|
get => GetAudioClip();
|
||||||
set => LoadAudioClip(value);
|
set => LoadAudioClip(value);
|
||||||
}
|
}
|
||||||
public float CurrentTime => GetClockTime();
|
public float CurrentTime
|
||||||
|
{
|
||||||
|
get => GetClockTime();
|
||||||
|
set => SetClockTime(value);
|
||||||
|
}
|
||||||
|
|
||||||
public abstract bool IsPlaying();
|
public abstract bool IsPlaying();
|
||||||
|
|
||||||
@@ -207,9 +212,16 @@ namespace Convention
|
|||||||
}
|
}
|
||||||
public override float GetClockTime()
|
public override float GetClockTime()
|
||||||
{
|
{
|
||||||
|
if (Source.clip == null)
|
||||||
|
return 0;
|
||||||
return (float)Source.timeSamples / (float)Source.clip.frequency;
|
return (float)Source.timeSamples / (float)Source.clip.frequency;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void SetClockTime(float value)
|
||||||
|
{
|
||||||
|
Source.time = value;
|
||||||
|
}
|
||||||
|
|
||||||
public override bool IsPlaying()
|
public override bool IsPlaying()
|
||||||
{
|
{
|
||||||
return Source.isPlaying;
|
return Source.isPlaying;
|
||||||
|
@@ -64,7 +64,11 @@ namespace Convention
|
|||||||
}
|
}
|
||||||
if (Keyboard.current[Key.Space].isPressed)
|
if (Keyboard.current[Key.Space].isPressed)
|
||||||
dxyz += Vector3.up;
|
dxyz += Vector3.up;
|
||||||
|
#if !UNITY_EDITOR
|
||||||
if (Keyboard.current[Key.LeftShift].isPressed)
|
if (Keyboard.current[Key.LeftShift].isPressed)
|
||||||
|
#else
|
||||||
|
if (Keyboard.current[Key.Q].isPressed)
|
||||||
|
#endif
|
||||||
dxyz -= Vector3.up;
|
dxyz -= Vector3.up;
|
||||||
|
|
||||||
var drotation = Vector3.zero;
|
var drotation = Vector3.zero;
|
||||||
|
@@ -1267,35 +1267,47 @@ namespace Convention
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<MemberInfo> SeekMemberInfoFromType(
|
||||||
|
[In] Type targetType,
|
||||||
|
[In, Opt] IEnumerable<Type> attrs, [In, Opt] IEnumerable<Type> types,
|
||||||
|
[In, Opt] Type untilBase = null
|
||||||
|
)
|
||||||
|
{
|
||||||
|
List<MemberInfo> result = new();
|
||||||
|
result.AddRange(targetType.GetMembers(BindingFlags.Public | BindingFlags.Instance));
|
||||||
|
while (targetType != null && targetType != typeof(object) && targetType != untilBase)
|
||||||
|
{
|
||||||
|
result.AddRange(
|
||||||
|
from info in targetType.GetMembers(BindingFlags.NonPublic | BindingFlags.Instance)
|
||||||
|
where attrs == null || HasCustomAttribute(info, attrs)
|
||||||
|
where types == null || (GetMemberValueType(info, out var type) && types.Contains(type))
|
||||||
|
select info
|
||||||
|
);
|
||||||
|
targetType = targetType.BaseType;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
public static List<MemberInfo> SeekMemberInfo(
|
public static List<MemberInfo> SeekMemberInfo(
|
||||||
[In] object target,
|
[In] object target,
|
||||||
[In, Opt] IEnumerable<Type> attrs, [In, Opt] IEnumerable<Type> types,
|
[In, Opt] IEnumerable<Type> attrs, [In, Opt] IEnumerable<Type> types,
|
||||||
[In, Opt] Type untilBase = null
|
[In, Opt] Type untilBase = null
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Type _CurType = target.GetType();
|
return SeekMemberInfoFromType(target.GetType(), attrs, types, untilBase);
|
||||||
List<MemberInfo> result = new();
|
|
||||||
result.AddRange(_CurType.GetMembers(BindingFlags.Public | BindingFlags.Instance));
|
|
||||||
while (_CurType != null && _CurType != typeof(object) && _CurType != untilBase)
|
|
||||||
{
|
|
||||||
result.AddRange(
|
|
||||||
from info in _CurType.GetMembers(BindingFlags.NonPublic | BindingFlags.Instance)
|
|
||||||
where attrs == null || HasCustomAttribute(info, attrs)
|
|
||||||
where types == null || (GetMemberValueType(info, out var type) && types.Contains(type))
|
|
||||||
select info
|
|
||||||
);
|
|
||||||
_CurType = _CurType.BaseType;
|
|
||||||
}
|
}
|
||||||
return result;
|
public static List<MemberInfo> SeekMemberInfoFromType([In] Type target, IEnumerable<string> names,
|
||||||
}
|
BindingFlags flags = BindingFlags.Public | BindingFlags.Instance)
|
||||||
public static List<MemberInfo> SeekMemberInfo([In] object target, IEnumerable<string> names, BindingFlags flags = BindingFlags.Public | BindingFlags.Instance)
|
|
||||||
{
|
{
|
||||||
Type _CurType = target.GetType();
|
List<MemberInfo> result = target.GetMembers(flags).ToList();
|
||||||
List<MemberInfo> result = _CurType.GetMembers(flags).ToList();
|
|
||||||
HashSet<string> nameSet = names.ToHashSet();
|
HashSet<string> nameSet = names.ToHashSet();
|
||||||
result.RemoveAll(x => nameSet.Contains(x.Name) == false);
|
result.RemoveAll(x => nameSet.Contains(x.Name) == false);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
public static List<MemberInfo> SeekMemberInfo([In] object target, IEnumerable<string> names,
|
||||||
|
BindingFlags flags = BindingFlags.Public | BindingFlags.Instance)
|
||||||
|
{
|
||||||
|
return SeekMemberInfoFromType(target.GetType(), names, flags);
|
||||||
|
}
|
||||||
public static object InvokeMember([In] MemberInfo member, [In] object target, params object[] parameters)
|
public static object InvokeMember([In] MemberInfo member, [In] object target, params object[] parameters)
|
||||||
{
|
{
|
||||||
if (member is MethodInfo method)
|
if (member is MethodInfo method)
|
||||||
|
@@ -188,7 +188,7 @@ namespace Convention
|
|||||||
if (IsFile() == false)
|
if (IsFile() == false)
|
||||||
throw new InvalidOperationException("Target is not a file");
|
throw new InvalidOperationException("Target is not a file");
|
||||||
string result = "";
|
string result = "";
|
||||||
using (var fs = (this.OriginInfo as FileInfo).OpenText())
|
using (var fs = new StreamReader((this.OriginInfo as FileInfo).OpenRead()))
|
||||||
{
|
{
|
||||||
result = fs.ReadToEnd();
|
result = fs.ReadToEnd();
|
||||||
}
|
}
|
||||||
|
@@ -51,12 +51,9 @@ namespace Convention
|
|||||||
public ToolFile GetConfigFile() => DataDir | ConstConfigFile;
|
public ToolFile GetConfigFile() => DataDir | ConstConfigFile;
|
||||||
public ToolFile ConfigFile => GetConfigFile();
|
public ToolFile ConfigFile => GetConfigFile();
|
||||||
|
|
||||||
public ToolFile GetFile(string path, bool isMustExist = false)
|
public ToolFile GetFile(string path)
|
||||||
{
|
{
|
||||||
var file = DataDir | path;
|
return DataDir | path;
|
||||||
if (isMustExist)
|
|
||||||
file.MustExistsPath();
|
|
||||||
return file;
|
|
||||||
}
|
}
|
||||||
public bool EraseFile(string path)
|
public bool EraseFile(string path)
|
||||||
{
|
{
|
||||||
@@ -154,7 +151,7 @@ namespace Convention
|
|||||||
|
|
||||||
public ToolFile GetLogFile()
|
public ToolFile GetLogFile()
|
||||||
{
|
{
|
||||||
return this.GetFile(ConfigFile.GetName(true) + "_log.txt", true);
|
return this.GetFile(ConfigFile.GetName(true) + "_log.txt").MustExistsPath();
|
||||||
}
|
}
|
||||||
public ToolFile LogFile => GetLogFile();
|
public ToolFile LogFile => GetLogFile();
|
||||||
|
|
||||||
|
@@ -287,6 +287,12 @@ namespace Convention.WindowsUI.Variant
|
|||||||
|
|
||||||
private void ForceRebuildLayoutImmediate()
|
private void ForceRebuildLayoutImmediate()
|
||||||
{
|
{
|
||||||
|
// TODO
|
||||||
|
if(this.parentEntry!=null)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
return;
|
||||||
if (ref_value != null)
|
if (ref_value != null)
|
||||||
{
|
{
|
||||||
ConventionUtility.StartCoroutine(Adjuster(ref_value.transform as RectTransform));
|
ConventionUtility.StartCoroutine(Adjuster(ref_value.transform as RectTransform));
|
||||||
|
Reference in New Issue
Block a user