This commit is contained in:
CortexCore
2023-07-17 10:23:47 +08:00
parent 3a61f6677b
commit 936a94c84b
17 changed files with 161 additions and 47 deletions

View File

@@ -57,6 +57,8 @@ namespace BITKit.IO
}
zipFile.Dispose();
BIT4Log.Log<BITAssets>($"已创建Assets:\n{path}");
}
public static T ReadAs<T>(string path)

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5ae1e7f59a6a2c64db48d78763a6dfa3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View 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);
}
}
}

View File

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

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 088acda9508faea49be2d9f04eb1308e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
namespace BITKit
{
public interface ITextValidation
{
bool IsTextValid(string text, out string errorReason);
}
}

View File

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

View File

@@ -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 { }