mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] BattleCore
[+] BattleCore
This commit is contained in:
@@ -2,7 +2,8 @@
|
|||||||
"name": "BattleCore.Runtime",
|
"name": "BattleCore.Runtime",
|
||||||
"rootNamespace": "BattleCore.Runtime",
|
"rootNamespace": "BattleCore.Runtime",
|
||||||
"references": [
|
"references": [
|
||||||
"GUID:aa06d4cc755c979489c256c1bcca1dfb"
|
"GUID:aa06d4cc755c979489c256c1bcca1dfb",
|
||||||
|
"GUID:d8b63aba1907145bea998dd612889d6b"
|
||||||
],
|
],
|
||||||
"includePlatforms": [],
|
"includePlatforms": [],
|
||||||
"excludePlatforms": [],
|
"excludePlatforms": [],
|
||||||
|
3
Assets/GameScripts/HotFix/BattleCore/ECSExtension.meta
Normal file
3
Assets/GameScripts/HotFix/BattleCore/ECSExtension.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 890abd3a957e406ab422fc468ba6c169
|
||||||
|
timeCreated: 1682353243
|
@@ -0,0 +1,6 @@
|
|||||||
|
namespace BattleCore.Runtime
|
||||||
|
{
|
||||||
|
public static class EntityExtension
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b4ef2dfa5ceac99458eb1745131a9c83
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -0,0 +1,27 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using Unity.Mathematics;
|
||||||
|
|
||||||
|
namespace BattleCore.Runtime
|
||||||
|
{
|
||||||
|
public static class MathematicsExt
|
||||||
|
{
|
||||||
|
public static int2 ToInt2(this Vector2Int vec) => new int2(vec.x, vec.y);
|
||||||
|
public static int3 ToInt3(this Vector3Int vec) => new int3(vec.x, vec.y, vec.z);
|
||||||
|
public static float2 ToFloat2(this Vector2 vec) => new float2(vec.x, vec.y);
|
||||||
|
public static float3 ToFloat3(this Vector3 vec) => new float3(vec.x, vec.y, vec.z);
|
||||||
|
|
||||||
|
public static bool IsEquals(this int2 a, int2 b) => math.all(a == b);
|
||||||
|
public static bool IsEquals(this int3 a, int3 b) => math.all(a == b);
|
||||||
|
|
||||||
|
|
||||||
|
public static Vector2Int ToVec2(this int2 vec) => new Vector2Int(vec.x, vec.y);
|
||||||
|
public static Vector3Int ToVec3(this int2 vec) => new Vector3Int(vec.x, vec.y, 0);
|
||||||
|
public static Vector3Int ToVec3(this int3 vec) => new Vector3Int(vec.x, vec.y, vec.z);
|
||||||
|
public static Vector2 ToVec2(this float2 vec) => new Vector2(vec.x, vec.y);
|
||||||
|
public static Vector3 ToVec3(this float3 vec) => new Vector3(vec.x, vec.y, vec.z);
|
||||||
|
public static int ManhattanDist(this int2 vec) => vec.x + vec.y;
|
||||||
|
public static int ManhattanDist(this int3 vec) => vec.x + vec.y + vec.z;
|
||||||
|
public static float ManhattanDist(this float2 vec) => vec.x + vec.y;
|
||||||
|
public static float ManhattanDist(this float3 vec) => vec.x + vec.y + vec.z;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2b0e288b918a41698571ec3d36059851
|
||||||
|
timeCreated: 1682353251
|
Reference in New Issue
Block a user