Beispiel #1
0
 private void RegisterMouseInput()
 {
     // Dragging me??
     if (IsSelected && MapEditor.IsDraggingSelectedRoomTiles())
     {
         // Update my RoomData's PosGlobal!!
         Vector2 newPosGlobal = MapEditor.MousePosWorldDraggingGrid(mouseClickOffset);
         MyRoomData.SetPosGlobal(newPosGlobal);
         ApplyPosition();
     }
 }
Beispiel #2
0
        // ----------------------------------------------------------------
        //  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;
        }
Beispiel #3
0
        // ================================================================
        //  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();
        }
Beispiel #4
0
 // ----------------------------------------------------------------
 //  Awake / Destroy
 // ----------------------------------------------------------------
 private void Awake()
 {
     mapEditor = GetComponent <MapEditor>();
     // Add event listeners.
     GameManagers.Instance.EventManager.MapEditorSetCurrWorldEvent += OnSetCurrWorld;
 }