This commit is contained in:
CortexCore
2024-03-31 23:31:00 +08:00
parent e179d2eb53
commit b7b89ee71a
641 changed files with 31286 additions and 22134 deletions

View File

@@ -2,10 +2,10 @@
"name": "BITKit.Node.Unity",
"rootNamespace": "",
"references": [
"GUID:a209c53514018594f9f482516f2a6781",
"GUID:517785bb4600a5140b47eac5fa49b8fc",
"GUID:14fe60d984bf9f84eac55c6ea033a8f4",
"GUID:9400d40641bab5b4a9702f65bf5c6eb5"
"GUID:d525ad6bd40672747bde77962f1c401e",
"GUID:49b49c76ee64f6b41bf28ef951cb0e50",
"GUID:517785bb4600a5140b47eac5fa49b8fc"
],
"includePlatforms": [],
"excludePlatforms": [],

View File

@@ -0,0 +1,33 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace BITKit
{
public sealed class MonoConditions : MonoBehaviour,ICondition
{
[SerializeReference,SubclassSelector] private ICondition[] conditions;
[SerializeReference,SubclassSelector] private IReference[] customReason;
public bool OnCheck() => conditions.All(OnCheck);
public string Reason
{
get
{
return customReason switch
{
not null when customReason.Length > 0 => string.Join("\n", customReason.Select(x => x.Value)),
_ => string.Join("\n", conditions.Where(OnCheck))
};
}
}
private static bool OnCheck(ICondition condition) => condition.Allow;
[BIT]
private void ManualCheck()
{
Debug.Log(OnCheck() ? "Success" : Reason);
}
}
}

View File

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