feat(battle-engine): full Unity primitive/runtime surface + game extension copies
Grows Vector2/3, Mathf, Color, Quaternion, GameObject, Transform, Camera, Material, ParticleSystem, Rect, Bounds, Time to the surface the engine references; adds Input/ Random/Resources statics + full KeyCode enum. Copies the verbatim extension files that collapse thousands of CS1061s at once (ContentKeywordExt, JsonData/LitJson extensions, EventExtension.Call, GameObjectExtension(s)). 26.5k -> 15.9k errors; residual now dominated by god-object member surface (GameMgr/UIManager/EffectMgr/Vfx*).
This commit is contained in:
22
SVSim.BattleEngine/Engine/GameObjectExtensions.cs
Normal file
22
SVSim.BattleEngine/Engine/GameObjectExtensions.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
public static class GameObjectExtensions
|
||||
{
|
||||
public static BattleCardBase GetBattleCard(this GameObject go)
|
||||
{
|
||||
if (go == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
BattleCardBase battleCardBase = null;
|
||||
BattleCardBase battleCardBase2 = null;
|
||||
battleCardBase = BattleManagerBase.GetIns().BattlePlayer.AllCards.FirstOrDefault((BattleCardBase s) => s.BattleCardView.GameObject == go);
|
||||
battleCardBase2 = BattleManagerBase.GetIns().BattleEnemy.AllCards.FirstOrDefault((BattleCardBase s) => s.BattleCardView.GameObject == go);
|
||||
if (battleCardBase != null)
|
||||
{
|
||||
return battleCardBase;
|
||||
}
|
||||
return battleCardBase2;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user