using FL.Battle.Components; using FL.Map.TestMainMap; using UnityEngine; using XGame.Framework.Components; using XGame.Framework.Map; using XGame.Framework.ObjectCollection; using XGame.Framework.Time; namespace FL.Map { public static partial class MapKeys { private static MapKey _TestMainMap; public static MapKey TestMainMap => _TestMainMap ?? (_TestMainMap = new MapKey("TestMainMap", typeof(TestMainMapView))); } public class TestMainMapView : MapView, IEntitiesContext, IMapUIContext, IVfxContext { public IMapAssetModule Asset => Context.Asset; public ITimeModule Time => Context.Time; public VfxComponent Vfx => GetComponent(); public MapUIComponent MapUI => GetComponent(); #region Transform IVfxContext.WorldTr => VM.VfxRoot; Transform IVfxContext.CenterTr => VM.VfxRoot; Transform IVfxContext.CastTr => VM.VfxRoot; #endregion protected override void AddComponent(IComponentGroup group) { group.Add(new EntitiesComponent()); group.Add(new MapUIComponent()); group.Add(new VfxComponent()); } protected override TestMainMapVM CtreatViewModel(IObjectCollector collector) { return new TestMainMapVM(collector); } protected override void OnDispose() { } } }