update
This commit is contained in:
@@ -57,6 +57,8 @@ namespace BITKit.IO
|
||||
}
|
||||
|
||||
zipFile.Dispose();
|
||||
|
||||
BIT4Log.Log<BITAssets>($"已创建Assets:\n{path}");
|
||||
}
|
||||
|
||||
public static T ReadAs<T>(string path)
|
||||
|
8
Packages/Runtime~/Core/DesignPatterns.meta
Normal file
8
Packages/Runtime~/Core/DesignPatterns.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5ae1e7f59a6a2c64db48d78763a6dfa3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
38
Packages/Runtime~/Core/DesignPatterns/DoubleBuffer.cs
Normal file
38
Packages/Runtime~/Core/DesignPatterns/DoubleBuffer.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BITKit
|
||||
{
|
||||
|
||||
public interface IDoubleBuffer<T>
|
||||
{
|
||||
T Current { get; }
|
||||
void Release(T newValue);
|
||||
event Action<T> OnRelease;
|
||||
bool TryGetRelease(out T result);
|
||||
}
|
||||
|
||||
public class DoubleBuffer<T> : IDoubleBuffer<T>
|
||||
{
|
||||
public T Current
|
||||
{
|
||||
get;
|
||||
// ReSharper disable once MemberCanBePrivate.Global
|
||||
protected set;
|
||||
}
|
||||
|
||||
public void Release(T newValue)
|
||||
{
|
||||
Current = newValue;
|
||||
OnRelease?.Invoke(newValue);
|
||||
}
|
||||
|
||||
public event Action<T> OnRelease;
|
||||
private readonly Queue<T> _releases = new();
|
||||
|
||||
public bool TryGetRelease(out T result)
|
||||
{
|
||||
return _releases.TryDequeue(out result);
|
||||
}
|
||||
}
|
||||
}
|
11
Packages/Runtime~/Core/DesignPatterns/DoubleBuffer.cs.meta
Normal file
11
Packages/Runtime~/Core/DesignPatterns/DoubleBuffer.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aa92f9c5ddad64741a2a86086b4fc977
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Packages/Runtime~/Core/Text.meta
Normal file
8
Packages/Runtime~/Core/Text.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 088acda9508faea49be2d9f04eb1308e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Packages/Runtime~/Core/Text/TextValidation.cs
Normal file
8
Packages/Runtime~/Core/Text/TextValidation.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace BITKit
|
||||
{
|
||||
|
||||
public interface ITextValidation
|
||||
{
|
||||
bool IsTextValid(string text, out string errorReason);
|
||||
}
|
||||
}
|
11
Packages/Runtime~/Core/Text/TextValidation.cs.meta
Normal file
11
Packages/Runtime~/Core/Text/TextValidation.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7b3c05c0c7e840340a827ea12e285666
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -56,6 +56,7 @@ namespace BITKit
|
||||
public const string Internal = "Internal";
|
||||
}
|
||||
public const string Value = "Value";
|
||||
public const string EmetyString = "";
|
||||
public static Func<bool> True => () => true;
|
||||
public static Func<bool> False => () => false;
|
||||
public class EmetyClass { }
|
||||
|
Reference in New Issue
Block a user