更改文件架构

This commit is contained in:
CortexCore
2023-06-07 18:38:07 +08:00
parent 93292b1a59
commit ed84166723
720 changed files with 297 additions and 65 deletions

View File

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

View File

@@ -0,0 +1,3 @@
{
"name": "Editor.BITKit.Provider"
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 959137683f1db044bb5d6eebd7063785
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BITKit
{
public abstract class Multiplex : Provider, IProvider<bool>
{
#if UNITY_EDITOR
[SerializeField] string remarks;
#endif
public bool active;
public bool Get() => active;
public void Set(bool x) => active = x;
}
}

View File

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

View File

@@ -0,0 +1,28 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BITKit
{
public class MultiplexGroup : Provider<int>
{
public int index = 0;
public List<Multiplex> list = new();
void Start()
{
Set(index);
}
public override void Set(int t)
{
index = t;
foreach (var item in list)
{
item.active = false;
}
list[index].active = true;
}
public override int Get()
{
throw new System.NotImplementedException();
}
}
}

View File

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

View File

@@ -0,0 +1,17 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BITKit
{
public class MultiplexInput : Multiplex
{
public Provider output;
public override void Set<T>(T obj)
{
if (active)
{
output.Set<T>(obj);
}
}
}
}

View File

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

View File

@@ -0,0 +1,38 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Cysharp.Threading.Tasks;
namespace BITKit
{
public class MultiplexOutput : Multiplex
{
public List<Provider> providers = new();
public string outputType = typeof(MultiplexOutput).Name;
public override async void Set<T>(T t)
{
if (active)
{
try
{
await UniTask.SwitchToTaskPool();
foreach (var genericProvider in providers)
{
if (genericProvider is IProvider<T> provider)
{
provider.Set(t);
}
else
{
genericProvider.Set(t);
}
}
}
catch (System.Exception e)
{
BIT4Log.LogException(e);
}
outputType = typeof(T).Name;
}
}
}
}

View File

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