not sure its better or not
This commit is contained in:
1 parent
775e8b66ec
commit
38428cf470
10 files changed
+10
-9
No files matched your search
+4
-3
@@ -20,16 +20,17 @@ export const entityAnimateMap = new Map<string, Animate<Indirect>>();
|
||||
export const entityProcessMap = new Map<string, Process<Indirect>>();
|
||||
|
||||
export function useEntity<T extends object>(
|
||||
name: string,
|
||||
data: T,
|
||||
meta: { url: string },
|
||||
state: T,
|
||||
): {
|
||||
animate: (fn: Animate<T>) => void;
|
||||
process: (fn: Process<T>) => void;
|
||||
} {
|
||||
const name = meta.url.match(/entities\/(.+)\/entity\.ts$/)![1];
|
||||
entityMap.set(name, {
|
||||
name,
|
||||
position: createVector(),
|
||||
...data,
|
||||
...state,
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user