private void SetGridPos(GridPosR gridPos_World) { GridPosR.ApplyGridPosToLocalTrans(gridPos_World, transform, CityInventory.GridSize); CityInventory.RefreshConflictAndIsolation(); SetVirtualGridPos(gridPos_World); City.RefreshBuildingCoverMaskMatrix(true); City.RefreshBuildingRangeGridView(LevelManager.Instance.CurrentSelectedBuildingKey); }
private void Initialize(MechaComponentInfo mechaComponentInfo, Mecha parentMecha) { SetLayer(LayerManager.Instance.GetLayerByMechaCamp(mechaComponentInfo.MechaInfo.MechaCamp)); mechaComponentInfo.OnRemoveMechaComponentInfoSuc += (mci) => { OnRemoveMechaComponentSuc?.Invoke(this); PoolRecycle(); }; mechaComponentInfo.OnHighLightColorChange += HighLightColorChange; HighLightColorChange(QualityManager.GetQuality(mechaComponentInfo.Quality).Color, mechaComponentInfo.CurrentPowerUpgradeData.HighLightColorIntensity); { mechaComponentInfo.InventoryItem.OnSetGridPosHandler = (gridPos_World) => { GridPosR.ApplyGridPosToLocalTrans(gridPos_World, transform, ConfigManager.GridSize); MechaInfo.MechaEditorInventory.RefreshConflictAndIsolation(); }; mechaComponentInfo.InventoryItem.OnIsolatedHandler = (shown) => { if (shown) { MechaComponentModelRoot.SetBuildingBasicEmissionColor(CommonUtils.HTMLColorToColor("#E42835")); } else { MechaComponentModelRoot.ResetBuildingBasicEmissionColor(); } MechaComponentGridRoot.SetIsolatedIndicatorShown(shown); }; mechaComponentInfo.InventoryItem.OnConflictedHandler = MechaComponentGridRoot.SetGridConflicted; mechaComponentInfo.InventoryItem.OnResetConflictHandler = MechaComponentGridRoot.ResetAllGridConflict; } MechaComponentInfo = mechaComponentInfo; GridPos.ApplyGridPosToLocalTransXZ(MechaComponentInfo.InventoryItem.GridPos_World, transform, ConfigManager.GridSize); Mecha = parentMecha; MechaComponentGridRoot.SetInBattle(true); Initialize_Fighting(); }