private void RegisterMouseInput() { // Dragging me?? if (IsSelected && MapEditor.IsDraggingSelectedRoomTiles()) { // Update my RoomData's PosGlobal!! Vector2 newPosGlobal = MapEditor.MousePosWorldDraggingGrid(mouseClickOffset); MyRoomData.SetPosGlobal(newPosGlobal); ApplyPosition(); } }
// ---------------------------------------------------------------- // Awake / Destroy // ---------------------------------------------------------------- private void Awake() { camera = this.GetComponent <Camera>(); editor = FindObjectOfType <MapEditor>(); // Move the camera to where we remember it was last time we was here! LoadPos(); LoadScale(); // Add event listeners. GameManagers.Instance.EventManager.MapEditorSetCurrWorldEvent += OnSetCurrWorld; }
// ================================================================ // Initialize // ================================================================ public void Initialize(MapEditor _mapEditorRef, RoomData _myRoomData, Transform tf_parent) { MapEditor = _mapEditorRef; MyRoomData = _myRoomData; GameUtils.ParentAndReset(this.gameObject, tf_parent); this.gameObject.name = MyRoomData.RoomKey; // SetPosAndSizeValues (); contents.Initialize(this); RefreshAllVisuals(); ApplyPosition(); ApplySize(); OnDeselected(); // Hide by default Hide(); }
// ---------------------------------------------------------------- // Awake / Destroy // ---------------------------------------------------------------- private void Awake() { mapEditor = GetComponent <MapEditor>(); // Add event listeners. GameManagers.Instance.EventManager.MapEditorSetCurrWorldEvent += OnSetCurrWorld; }