private void CreateMinimap(BaseGraphView view) { _miniMapView = CreateGraphView(() => new MiniMapView(view), _miniMapView); _miniMapView.SetPosition(new Rect(_minimapPosition, _miniMapView.GetPosition().size)); view.Add(_miniMapView); }
public void DrawMinimap(SpriteBatch spriteBatch, int x, int y) { if (Icons.Contains(MiniMapView)) { MiniMapView.DrawMap(spriteBatch, x, y); } }
public void OnCreate() { view = MiniMapView.Instance; elementDataDict = new Dictionary <int, MiniMapElementIconType>(); MiniMapMessageDispatcher.AddElementObserver(MiniMapElementStateType.Update, MoveElementGameObjectListener); MiniMapMessageDispatcher.AddElementObserver(MiniMapElementStateType.Create, AddElementDataListener); MiniMapMessageDispatcher.AddElementObserver(MiniMapElementStateType.Update, UpdateElementDataListener); MiniMapMessageDispatcher.AddElementObserver(MiniMapElementStateType.Destroy, RemoveElementDataListener); }
void Awake() { instance = this; controller = new MiniMapController(); poolManager = GetComponent <MiniMapPoolManager>(); miniMapSize = transform.GetComponent <RectTransform>().sizeDelta; elementIconDict = new Dictionary <int, Transform>(); elementIconParent = transform.FindChild("Mask/ElementParent").transform; controller.OnCreate(); }