mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 10:46:17 +00:00
提交
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using JNGame.Util.Types;
|
||||
|
||||
namespace JNGame.Runtime.Entitas
|
||||
{
|
||||
public abstract class JNLookup
|
||||
{
|
||||
|
||||
private int _index = 0;
|
||||
|
||||
public int Count => _index;
|
||||
|
||||
public int Next()
|
||||
{
|
||||
return _index++;
|
||||
}
|
||||
|
||||
|
||||
private readonly KeyValue<int, Type> _types = new();
|
||||
|
||||
public JNLookup()
|
||||
{
|
||||
BindIndex();
|
||||
BindType(_types);
|
||||
}
|
||||
|
||||
protected abstract void BindIndex();
|
||||
protected abstract void BindType(KeyValue<int, Type> types);
|
||||
|
||||
//查询下标
|
||||
public int GetIndex(Type type)
|
||||
{
|
||||
return _types.Value2Key(type);
|
||||
}
|
||||
//查询下标
|
||||
public int GetIndex<T>()
|
||||
{
|
||||
return _types.Value2Key(typeof(T));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2bc1af669bc0434ba4c21616d82b4c40
|
||||
timeCreated: 1720750362
|
@@ -0,0 +1,10 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Entitas;
|
||||
|
||||
namespace JNGame.Runtime.Entitas
|
||||
{
|
||||
public class JNSystemLoad : ISystem
|
||||
{
|
||||
public virtual async UniTask Init(){}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: df35cc9e536a41b6901e0184f24421a4
|
||||
timeCreated: 1715159481
|
Reference in New Issue
Block a user