public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            int  angle      = (int)(entity.attributesMap["angle"].ValueInt32);
            int  length     = (int)(entity.attributesMap["length"].ValueVar / 1.4);
            bool fliph      = false;
            bool flipv      = false;
            var  editorAnim = e.LoadAnimation2("ZipLine", d, 0, -1, fliph, flipv, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0)
            {
                var frame  = editorAnim.Frames[e.index];
                var frame2 = editorAnim.Frames[1];


                d.DrawBitmap(frame.Texture,
                             x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0),
                             y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0),
                             frame.Frame.Width, frame.Frame.Height, false, Transparency);
                d.DrawBitmap(frame2.Texture,
                             x + frame2.Frame.CenterX - (fliph ? (frame2.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0),
                             y + frame2.Frame.CenterY + (flipv ? (frame2.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0),
                             frame2.Frame.Width, frame2.Frame.Height, false, Transparency);

                if (length != 0)
                {
                    int[] processPoints = RotatePoints(x + length, y + length, x, y, -angle + 32);
                    d.DrawLine(x, y, processPoints[0], processPoints[1], System.Drawing.Color.FromArgb(255, 49, 48, 115));
                    d.DrawLine(x, y - 1, processPoints[0], processPoints[1] - 1, System.Drawing.Color.FromArgb(255, 99, 97, 165));
                    d.DrawBitmap(frame2.Texture,
                                 processPoints[0] + frame2.Frame.CenterX - (fliph ? (frame2.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0) - 2,
                                 processPoints[1] + frame2.Frame.CenterY + (flipv ? (frame2.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0) - 1,
                                 frame2.Frame.Width, frame2.Frame.Height, false, Transparency);
                }
            }
        }
Beispiel #2
0
 public void DrawPrefab()
 {
     //GUILayout.BeginHorizontal(new GUILayoutOption[0]);
     ////ResWindow.searchString = GUILayout.TextField(ResWindow.searchString, new GUILayoutOption[0]);
     //GUILayout.EndHorizontal();
     for (int i = 0; i < ResWindow.listLength; i++)
     {
         IEnumerable enumerable = ResWindow.dataList[i];
         bool        flag       = ResWindow.expendList[i];
         string      text       = ResWindow.nameList[i];
         if (!string.IsNullOrEmpty(text) && enumerable != null)
         {
             GUIContent guicontent = new GUIContent(text);
             if (GUILayout.Button(guicontent, "BoldLabel", new GUILayoutOption[0]))
             {
                 flag = !flag;
                 ResWindow.expendList[i] = flag;
             }
             if (flag)
             {
                 foreach (object obj in enumerable)
                 {
                     EditorEntity editorEntity = obj as EditorEntity;
                     if (editorEntity && !string.IsNullOrEmpty(editorEntity.name))
                     {
                         guicontent.text = editorEntity.name;
                         //guicontent.image = DungeonStyle.MonsterIcon;
                         GUILayout.Label(guicontent, new GUILayoutOption[]
                         {
                             GUILayout.ExpandWidth(true)
                         });
                         //this.animGOEditor = Editor.CreateEditor(editorEntity.GO);
                         //if (this.animGOEditor != null)
                         //{
                         //    this.animGOEditor.OnPreviewGUI(GUILayoutUtility.GetRect(30f, 240f), EditorStyles.helpBox);
                         //}
                         Event current = Event.current;
                         if (GUILayoutUtility.GetLastRect().Contains(current.mousePosition))
                         {
                             if (current.type == EventType.MouseDrag)
                             {
                                 DragAndDrop.PrepareStartDrag();
                                 DragAndDrop.objectReferences = new UnityEngine.Object[]
                                 {
                                     UnityEngine.Object.Instantiate <EditorEntity>(editorEntity)
                                 };
                                 DragAndDrop.StartDrag("New Entity");
                                 SceneEditorWindow.targetGameObject = null;
                             }
                             if (current.isMouse)
                             {
                                 current.Use();
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Beispiel #3
0
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            int  animID   = (int)entity.attributesMap["type"].ValueVar;
            var  flipFlag = entity.attributesMap["flipFlag"].ValueVar;
            bool fliph    = false;
            bool flipv    = false;

            // Handle springs being flipped in both planes
            // Down
            if ((flipFlag & 0x02) == 0x02)
            {
                flipv = true;
            }
            // Left
            if ((flipFlag & 0x01) == 0x01)
            {
                fliph = true;
            }

            var editorAnim = e.LoadAnimation2("IceSpring", d, animID % 3, -1, fliph, flipv, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0 && animID >= 0)
            {
                var frame = editorAnim.Frames[e.index];

                d.DrawBitmap(frame.Texture,
                             x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0),
                             y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0),
                             frame.Frame.Width, frame.Frame.Height, false, Transparency);
            }
        }
Beispiel #4
0
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            bool fliph       = false;
            bool flipv       = false;
            var  editorAnim  = e.LoadAnimation2("FBZFan", d, 0, 0, fliph, flipv, false);
            var  editorAnim2 = e.LoadAnimation2("FBZFan", d, 1, -1, fliph, flipv, false);
            var  editorAnim3 = e.LoadAnimation2("FBZFan", d, 2, -1, fliph, flipv, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0 && editorAnim2 != null && editorAnim.Frames.Count != 0 && editorAnim3 != null && editorAnim.Frames.Count != 0)
            {
                var frame  = editorAnim.Frames[0];
                var frame2 = editorAnim2.Frames[e.index];
                var frame3 = editorAnim3.Frames[e.index];
                // e.ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration);
                e.ProcessAnimation(frame2.Entry.FrameSpeed, frame2.Entry.Frames.Count, frame2.Frame.Duration);
                e.ProcessAnimation(frame3.Entry.FrameSpeed, frame3.Entry.Frames.Count, frame3.Frame.Duration);

                d.DrawBitmap(frame.Texture,
                             x + frame.Frame.CenterX + (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width * 2) : 0),
                             y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0),
                             frame.Frame.Width, frame.Frame.Height, false, Transparency);
                d.DrawBitmap(frame2.Texture,
                             x + frame2.Frame.CenterX + (fliph ? (frame2.Frame.Width - editorAnim2.Frames[0].Frame.Width * 2) : 0),
                             y + frame2.Frame.CenterY + (flipv ? (frame2.Frame.Height - editorAnim2.Frames[0].Frame.Height) : 0),
                             frame2.Frame.Width, frame2.Frame.Height, false, Transparency);
                d.DrawBitmap(frame3.Texture,
                             x + frame3.Frame.CenterX + (fliph ? (frame3.Frame.Width - editorAnim3.Frames[0].Frame.Width * 2) : 0),
                             y + frame3.Frame.CenterY + (flipv ? (frame3.Frame.Height - editorAnim3.Frames[0].Frame.Height) : 0),
                             frame3.Frame.Width, frame3.Frame.Height, false, Transparency);
            }
        }
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            int  direction = (int)entity.attributesMap["direction"].ValueUInt8;
            bool fliph     = false;
            bool flipv     = false;

            if (direction == 1)
            {
                flipv = true;
            }
            var editorAnim = e.LoadAnimation2("Clucker", d, 0, -1, fliph, flipv, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0)
            {
                var frame  = editorAnim.Frames[0];
                var frame2 = editorAnim.Frames[1];
                var frame3 = editorAnim.Frames[2];


                d.DrawBitmap(frame2.Texture,
                             x + frame2.Frame.CenterX - (fliph ? (frame2.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0),
                             y + frame2.Frame.CenterY + (flipv ? (16) : -16),
                             frame2.Frame.Width, frame2.Frame.Height, false, Transparency);
                d.DrawBitmap(frame3.Texture,
                             x + frame3.Frame.CenterX - (fliph ? (frame3.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0),
                             y + frame3.Frame.CenterY + (flipv ? (-4) : -16),
                             frame3.Frame.Width, frame3.Frame.Height, false, Transparency);
                d.DrawBitmap(frame.Texture,
                             x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0),
                             y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0),
                             frame.Frame.Width, frame.Frame.Height, false, Transparency);
            }
        }
Beispiel #6
0
 public static int GetObjectPriority(EditorEntity e)
 {
     if (e.Object.Name.Name == "UIOptionPanel")
     {
         return(-1);
     }
     else if (e.Object.Name.Name == "UIPicture")
     {
         return(1);
     }
     else if (e.Object.Name.Name == "UIChoice")
     {
         return(1);
     }
     else if (e.Object.Name.Name == "UIButton")
     {
         return(1);
     }
     else if (e.Object.Name.Name == "UIDiorama")
     {
         return(1);
     }
     else if (e.Object.Name.Name == "UIKeyBinder")
     {
         return(1);
     }
     else if (e.Object.Name.Name == "UIButtonLabel")
     {
         return(1);
     }
     else
     {
         return(0);
     }
 }
Beispiel #7
0
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            int  direction = (int)entity.attributesMap["direction"].ValueUInt8;
            bool hasSaw    = entity.attributesMap["hasSaw"].ValueBool;
            bool fliph     = false;
            bool flipv     = false;
            int  animID;

            if (direction == 2)
            {
                if (hasSaw)
                {
                    animID = 4;
                }
                else
                {
                    animID = 3;
                }
            }
            else if (direction == 3)
            {
                fliph = true;
                if (hasSaw)
                {
                    animID = 4;
                }
                else
                {
                    animID = 3;
                }
            }
            else
            {
                if (hasSaw)
                {
                    animID = 1;
                }
                else
                {
                    animID = 0;
                }
            }
            if (direction == 1)
            {
                flipv = true;
            }
            var editorAnim = e.LoadAnimation2("JuggleSaw", d, animID, -1, fliph, flipv, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0 && animID >= 0)
            {
                var frame = editorAnim.Frames[e.index];

                e.ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration);

                d.DrawBitmap(frame.Texture,
                             x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width + (hasSaw ? (38) : 16)) : 0),
                             y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height + (hasSaw ? (37) : 15)) : 0),
                             frame.Frame.Width, frame.Frame.Height, false, Transparency);
            }
        }
Beispiel #8
0
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            //int type = (int)entity.attributesMap["type"].ValueUInt8;
            int  direction = (int)entity.attributesMap["direction"].ValueUInt8;
            bool fliph     = false;
            bool flipv     = false;

            if (direction == 1)
            {
                fliph = true;
            }
            var editorAnim  = e.LoadAnimation2("Grabber", d, 0, -1, fliph, flipv, false);
            var editorAnim2 = e.LoadAnimation2("Grabber", d, 1, -1, fliph, flipv, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0 && editorAnim2 != null && editorAnim2.Frames.Count != 0)
            {
                var frame  = editorAnim.Frames[e.index];
                var frame2 = editorAnim2.Frames[e.index];

                e.ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration);
                e.ProcessAnimation(frame2.Entry.FrameSpeed, frame2.Entry.Frames.Count, frame2.Frame.Duration);

                d.DrawBitmap(frame.Texture,
                             x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0),
                             y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0),
                             frame.Frame.Width, frame.Frame.Height, false, Transparency);
                d.DrawBitmap(frame2.Texture,
                             x + frame2.Frame.CenterX - (fliph ? (frame2.Frame.Width - 2) : 0),
                             y + frame2.Frame.CenterY + (flipv ? (frame2.Frame.Height - editorAnim2.Frames[0].Frame.Height) : 0),
                             frame2.Frame.Width, frame2.Frame.Height, false, Transparency);
            }
        }
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            var size  = (int)(entity.attributesMap["size"].ValueVar) - 1;
            var angle = entity.attributesMap["angle"].ValueInt32;

            var editorAnim = e.LoadAnimation2("PlaneSwitch", d, 0, 4, true, false, false);

            const int pivotOffsetX = -8, pivotOffsetY = 0;
            const int drawOffsetX = 0, drawOffsetY = -8;

            if (editorAnim != null && editorAnim.Frames.Count != 0)
            {
                var frame = editorAnim.Frames[e.index];
                e.ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration);
                bool hEven = size % 2 == 0;
                for (int yy = 0; yy <= size; ++yy)
                {
                    int[] drawCoords = RotatePoints(
                        x - frame.Frame.Width / 2,
                        (y + (hEven ? frame.Frame.CenterY : -frame.Frame.Height) + (-size / 2 + yy) * frame.Frame.Height),
                        x + pivotOffsetX, y + pivotOffsetY, angle);

                    d.DrawBitmap(frame.Texture, drawCoords[0] + drawOffsetX, drawCoords[1] + drawOffsetY, frame.Frame.Width, frame.Frame.Height, false, Transparency);
                }
            }
        }
Beispiel #10
0
    public void SwitchItem(Vector2 mousepos, EntityType et, string asset, int boundingy = 0)
    {
        //check selected entity
        Vector2      vpos   = GridPosition(mousepos + new Vector2(0, cellHeight / 2));
        Point        pos    = new Point((int)vpos.X, (int)vpos.Y);
        EditorEntity entity = Get(pos.X, pos.Y) as EditorEntity;

        //replace entity
        if (entity != null)
        {
            Remove(entity.Id, pos.X, pos.Y);
            EditorEntity newentity = new EditorEntity(pos, asset, boundingy, et);
            if (et == EntityType.Enemy)
            {
                //get additional information from the mouse
                EditorMouse mouse = GameWorld.GetObject("mouse") as EditorMouse;
                newentity.EnemyType = mouse.EnemyType;
            }
            else if (et == EntityType.AnimatedItem || et == EntityType.SpriteItem)
            {
                //get additional information from the mouse
                EditorMouse mouse = GameWorld.GetObject("mouse") as EditorMouse;
                newentity.ItemType = mouse.ItemType;
            }
            Add(newentity, pos.X, pos.Y);
            newentity.InitializeTile();
        }
    }
Beispiel #11
0
        public void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            bool fliph      = false;
            bool flipv      = false;
            var  mightyAnim = e.LoadAnimation2("SchrodingersCapsule", d, 3, -1, fliph, flipv, false);
            var  rayAnim    = e.LoadAnimation2("SchrodingersCapsule", d, 4, -1, fliph, flipv, false);

            if (mightyAnim != null && mightyAnim.Frames.Count != 0 && rayAnim != null && rayAnim.Frames.Count != 0)
            {
                var mightyFrame = mightyAnim.Frames[e.index];
                var rayFrame    = rayAnim.Frames[e.index];

                //e.ProcessAnimation(rayFrame.Entry.FrameSpeed, rayFrame.Entry.Frames.Count, rayFrame.Frame.Duration);
                //e.ProcessAnimation(mightyFrame.Entry.FrameSpeed, mightyFrame.Entry.Frames.Count, mightyFrame.Frame.Duration);

                d.DrawBitmap(mightyFrame.Texture,
                             x + mightyFrame.Frame.CenterX - (fliph ? (mightyFrame.Frame.Width - mightyAnim.Frames[0].Frame.Width) : 0) + 15,
                             y + mightyFrame.Frame.CenterY + (flipv ? (mightyFrame.Frame.Height - mightyAnim.Frames[0].Frame.Height) : 0),
                             mightyFrame.Frame.Width, mightyFrame.Frame.Height, false, Transparency);
                d.DrawBitmap(rayFrame.Texture,
                             x + rayFrame.Frame.CenterX - (fliph ? (rayFrame.Frame.Width - rayAnim.Frames[0].Frame.Width) : 0) - 15,
                             y + rayFrame.Frame.CenterY + (flipv ? (rayFrame.Frame.Height - rayAnim.Frames[0].Frame.Height) : 0),
                             rayFrame.Frame.Width, rayFrame.Frame.Height, false, Transparency);
            }
        }
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            bool fliph   = false;
            bool flipv   = false;
            int  type    = (int)entity.attributesMap["type"].ValueVar;
            int  frameID = 0;

            if (type == 2)
            {
                frameID = 3;
            }
            if (type == 1)
            {
                frameID = 1;
            }
            var editorAnim = e.LoadAnimation2("Missile", d, frameID, -1, fliph, flipv, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0)
            {
                var frame = editorAnim.Frames[e.index];
                e.ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration);

                d.DrawBitmap(frame.Texture,
                             x + frame.Frame.CenterX + (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width * 2) : 0),
                             y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0),
                             frame.Frame.Width, frame.Frame.Height, false, Transparency);
            }
        }
Beispiel #13
0
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            var  value     = entity.attributesMap["type"];
            int  direction = (int)entity.attributesMap["direction"].ValueUInt8;
            bool fliph     = false;
            bool flipv     = false;

            switch (direction)
            {
            case 0:
                break;

            case 1:
                flipv = true;
                break;

            default:
                break;
            }
            var editorAnimBox    = e.LoadAnimation2("ItemBox", d, 0, 0, fliph, flipv, false);
            var editorAnimEffect = e.LoadAnimation2("ItemBox", d, 2, (int)value.ValueVar, fliph, flipv, false);

            if (editorAnimBox != null && editorAnimEffect != null && editorAnimEffect.Frames.Count != 0)
            {
                var frameBox    = editorAnimBox.Frames[0];
                var frameEffect = editorAnimEffect.Frames[0];
                d.DrawBitmap(frameBox.Texture, x + frameBox.Frame.CenterX, y + frameBox.Frame.CenterY,
                             frameBox.Frame.Width, frameBox.Frame.Height, false, Transparency);
                d.DrawBitmap(frameEffect.Texture, x + frameEffect.Frame.CenterX, y + frameEffect.Frame.CenterY - (flipv ? (-3) : 3),
                             frameEffect.Frame.Width, frameEffect.Frame.Height, false, Transparency);
            }
        }
Beispiel #14
0
    private void LoadEntities(List <string> textlines, int width, Dictionary <char, string> entitytypechar)
    {
        ItemGrid level = new ItemGrid(width, textlines.Count, 0, "itemgrid");

        RootList.Add(level);
        level.CellWidth  = 108;
        level.CellHeight = 54;

        for (int x = 0; x < width; x++)
        {
            for (int y = 0; y < textlines.Count; y++)
            {
                try
                {
                    EditorEntity e = LoadEntity(x, y, entitytypechar[textlines[y][x]]);
                    level.Add(e, x, y);
                }
                catch
                {
                    EditorEntity e = LoadEntity(x, y, "None");
                    level.Add(e, x, y);
                }
            }
        }
    }
Beispiel #15
0
        public override void Draw(Structures.EntityRenderProp properties)
        {
            DevicePanel  d            = properties.Graphics;
            EditorEntity e            = properties.EditorObject;
            int          x            = properties.DrawX;
            int          y            = properties.DrawY;
            int          Transparency = properties.Transparency;
            bool         fliph        = false;
            bool         flipv        = false;
            string       text         = "UI/Text" + Methods.Solution.SolutionState.Main.CurrentManiaUILanguage + ".bin";

            int characterID      = (int)e.attributesMap["characterID"].ValueUInt8;
            int characterID_text = characterID;

            if (characterID >= 3)
            {
                characterID++;
            }

            d.DrawRectangle(x - 48, y - 48, x + 48, y + 48, System.Drawing.Color.FromArgb(128, 255, 255, 255));

            var Animation = LoadAnimation("EditorUIRender", d, 1, 1);

            DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x, y, Transparency, fliph, flipv);

            Animation = LoadAnimation(text, d, 8, characterID_text);
            DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x, y + 32, Transparency, fliph, flipv);

            Animation = LoadAnimation("UI/SaveSelect.bin", d, 1, characterID);
            DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x, y - 8, Transparency, fliph, flipv);
        }
Beispiel #16
0
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            int  type        = (int)entity.attributesMap["type"].ValueVar;
            bool fliph       = false;
            bool flipv       = false;
            var  editorAnim  = e.LoadAnimation2("EggPrison", d, 0, -1, fliph, flipv, false);
            var  editorAnim2 = e.LoadAnimation2("EggPrison", d, 1, -1, fliph, flipv, false);
            var  editorAnim3 = e.LoadAnimation2("EggPrison", d, 2, -1, fliph, flipv, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0 && editorAnim2 != null && editorAnim2.Frames.Count != 0 && editorAnim3 != null && editorAnim3.Frames.Count != 0)
            {
                var frame  = editorAnim.Frames[0];
                var frame2 = editorAnim2.Frames[0];
                var frame3 = editorAnim3.Frames[0];

                d.DrawBitmap(frame.Texture,
                             x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0),
                             y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0),
                             frame.Frame.Width, frame.Frame.Height, false, Transparency);
                d.DrawBitmap(frame2.Texture,
                             x + frame2.Frame.CenterX - (fliph ? (frame2.Frame.Width - editorAnim2.Frames[0].Frame.Width) : 0),
                             y + frame2.Frame.CenterY + (flipv ? (frame2.Frame.Height - editorAnim2.Frames[0].Frame.Height) : 0),
                             frame2.Frame.Width, frame2.Frame.Height, false, Transparency);
                d.DrawBitmap(frame3.Texture,
                             x + frame3.Frame.CenterX - (fliph ? (frame3.Frame.Width - editorAnim3.Frames[0].Frame.Width) : 0),
                             y + frame3.Frame.CenterY + (flipv ? (frame3.Frame.Height - editorAnim3.Frames[0].Frame.Height) : 0),
                             frame3.Frame.Width, frame3.Frame.Height, false, Transparency);
            }
        }
Beispiel #17
0
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            int  letterID    = (int)entity.attributesMap["letterID"].ValueUInt8;
            bool controller  = entity.attributesMap["controller"].ValueBool;
            bool fliph       = false;
            bool flipv       = false;
            var  editorAnim  = e.LoadAnimation2("Letterboard", d, 0, -1, fliph, flipv, false);
            var  editorAnim2 = e.LoadAnimation2("Letterboard", d, 1, letterID - 1, fliph, flipv, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0 && editorAnim2 != null && editorAnim2.Frames.Count != 0)
            {
                var frame  = editorAnim.Frames[0];
                var frame2 = editorAnim2.Frames[e.index];

                //ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration);

                if (letterID == 0 || controller == true)
                {
                    d.DrawBitmap(frame.Texture,
                                 x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0),
                                 y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0),
                                 frame.Frame.Width, frame.Frame.Height, false, Transparency);
                }
                else
                {
                    d.DrawBitmap(frame2.Texture,
                                 x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[letterID].Frame.Width) : 0),
                                 y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[letterID].Frame.Height) : 0),
                                 frame.Frame.Width, frame.Frame.Height, false, Transparency);
                }
            }
        }
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            var  width      = (int)(entity.attributesMap["width"].ValueUInt8);
            var  height     = (int)(entity.attributesMap["height"].ValueUInt8);
            bool breakClimb = entity.attributesMap["breakClimb"].ValueBool;
            int  type;

            if (breakClimb)
            {
                type = 9;
            }
            else
            {
                type = 6;
            }
            var editorAnim = e.LoadAnimation2("ItemBox", d, 2, type, false, false, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0)
            {
                var frame = editorAnim.Frames[e.index];
                e.ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration);
                bool wEven = width % 2 == 0;
                bool hEven = height % 2 == 0;
                for (int xx = 0; xx <= width; ++xx)
                {
                    for (int yy = 0; yy <= height; ++yy)
                    {
                        d.DrawBitmap(frame.Texture,
                                     x + (wEven ? frame.Frame.CenterX : -frame.Frame.Width) + (-width / 2 + xx) * frame.Frame.Width,
                                     y + (hEven ? frame.Frame.CenterY : -frame.Frame.Height) + (-height / 2 + yy) * frame.Frame.Height,
                                     frame.Frame.Width, frame.Frame.Height, false, Transparency);
                    }
                }
            }
        }
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            var length = (short)(entity.attributesMap["length"].ValueUInt16);
            var orientation = entity.attributesMap["orientation"].ValueUInt8;
            if (orientation > 1)
            {
                orientation = 0;
            }
            var editorAnim = e.LoadAnimation2("BreakBar", d, orientation, -1, false, false, false);
            if (editorAnim != null && editorAnim.Frames.Count != 0)
            {
                var frameTop = editorAnim.Frames[0];
                var frameBase = editorAnim.Frames[1];
                var frameBottom = editorAnim.Frames[2];
                for (int i = -length / 2; i <= length / 2; ++i)
                {
                    d.DrawBitmap(frameBase.Texture, x + frameBase.Frame.CenterX,
                        y + frameBase.Frame.CenterY + i * frameBase.Frame.Height,
                        frameBase.Frame.Width, frameBase.Frame.Height, false, Transparency);
                }
                d.DrawBitmap(frameTop.Texture, x + frameTop.Frame.CenterX,
                    y + frameTop.Frame.CenterY - (length / 2 + 1) * frameBase.Frame.Height,
                    frameTop.Frame.Width, frameTop.Frame.Height, false, Transparency);
                d.DrawBitmap(frameBottom.Texture, x + frameBottom.Frame.CenterX,
                    y + frameBottom.Frame.CenterY + (length / 2 + 1) * frameBottom.Frame.Height,
                    frameBottom.Frame.Width, frameBottom.Frame.Height, false, Transparency);

            }
        }
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            int  type  = (int)entity.attributesMap["type"].ValueUInt8;
            bool fliph = false;
            bool flipv = false;
            int  animID;

            if (type == 1)
            {
                animID = 1;
            }
            else
            {
                animID = 0;
            }
            var editorAnim = e.LoadAnimation2("Turntable", d, animID, -1, fliph, flipv, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0 && animID >= 0)
            {
                var frame = editorAnim.Frames[e.index];

                e.ProcessAnimation(1, 14, 2);

                d.DrawBitmap(frame.Texture,
                             x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0),
                             y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0),
                             frame.Frame.Width, frame.Frame.Height, false, Transparency);
            }
        }
Beispiel #21
0
        public bool SetFilter(EditorEntity entity)
        {
            bool filteredOut = false;

            if (HasFilter(entity))
            {
                int filter = entity.GetAttribute("filter").ValueUInt8;

                /**
                 * 1 or 5 = Both
                 * 2 = Mania
                 * 4 = Encore
                 * 255 = Pinball
                 *
                 */
                filteredOut =
                    ((filter == 1 || filter == 5) && !Properties.Settings.MyDefaults.ShowBothEntities) ||
                    (filter == 2 && !Properties.Settings.MyDefaults.ShowManiaEntities) ||
                    (filter == 4 && !Properties.Settings.MyDefaults.ShowEncoreEntities) ||
                    (filter == 255 && !Properties.Settings.MyDefaults.ShowPinballEntities) ||
                    ((filter < 1 || filter == 3 || filter > 5 && filter != 255) && !Properties.Settings.MyDefaults.ShowOtherEntities);
            }
            else
            {
                filteredOut = !Properties.Settings.MyDefaults.ShowFilterlessEntities;
            }

            if (Methods.Solution.SolutionState.Main.ObjectFilter != "" && !entity.Object.Name.Name.Contains(Methods.Solution.SolutionState.Main.ObjectFilter))
            {
                filteredOut = true;
            }
            return(filteredOut);
        }
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            int letter = (int)entity.attributesMap["letter"].ValueUInt8;
            int duration = (int)entity.attributesMap["duration"].ValueUInt16;
            bool fliph = false;
            bool flipv = false;
            int frameID = 0;
            if (letter >= 11)
            {
                entity.attributesMap["letter"].ValueUInt8 = 11;
            }
            if (duration != 0)
            {
                frameID = 4;
            }

           var editorAnim = e.LoadAnimation2("PrintBlock", d, letter, frameID, fliph, flipv, false);
            if (editorAnim != null && editorAnim.Frames.Count != 0)
            {
                var frame = editorAnim.Frames[e.index];

                d.DrawBitmap(frame.Texture,
                    x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0),
                    y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0),
                    frame.Frame.Width, frame.Frame.Height, false, Transparency);
            }
        }
Beispiel #23
0
 public virtual void Add(T item)
 {
     if (item is EditorEntity)
     {
         EditorEntity entity = item as EditorEntity;
         if (ApplicationContext != null && ApplicationContext.CurrentUser != null)
         {
             if (string.IsNullOrEmpty(entity.CreateBy))
             {
                 entity.CreateBy = ApplicationContext.CurrentUser.UserID;
             }
             if (string.IsNullOrEmpty(entity.CreatebyName))
             {
                 entity.CreatebyName = ApplicationContext.CurrentUser.UserName;
             }
             if (string.IsNullOrEmpty(entity.LastUpdateBy))
             {
                 entity.LastUpdateBy = ApplicationContext.CurrentUser.UserID;
             }
             if (string.IsNullOrEmpty(entity.LastUpdateByName))
             {
                 entity.LastUpdateByName = ApplicationContext.CurrentUser.UserName;
             }
         }
         entity.CreateDate     = DateTime.Now;
         entity.LastUpdateDate = DateTime.Now;
     }
     Repository.Add(item);
 }
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            bool fliph       = false;
            bool flipv       = false;
            int  height      = (int)entity.attributesMap["height"].ValueUInt8;
            var  editorAnim  = e.LoadAnimation2("TwistedTubes", d, 0, 1, fliph, flipv, false);
            var  editorAnim2 = e.LoadAnimation2("TwistedTubes", d, 0, 0, fliph, flipv, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0 && editorAnim2 != null && editorAnim2.Frames.Count != 0)
            {
                var frame  = editorAnim.Frames[e.index];
                var frame2 = editorAnim2.Frames[e.index];


                //ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration);

                d.DrawBitmap(frame2.Texture,
                             x + frame2.Frame.CenterX - (fliph ? (frame2.Frame.Width - editorAnim2.Frames[0].Frame.Width) : 0),
                             y + frame2.Frame.CenterY + (flipv ? (frame2.Frame.Height - editorAnim2.Frames[0].Frame.Height) : 0),
                             frame2.Frame.Width, frame.Frame.Height, false, Transparency);
                for (int i = 0; i < height * 2; i++)
                {
                    d.DrawBitmap(frame.Texture,
                                 x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[1].Frame.Width) : 0),
                                 y + (i * 32) + frame.Frame.CenterY + 64 + (flipv ? (frame.Frame.Height - editorAnim.Frames[1].Frame.Height) : 0),
                                 frame.Frame.Width, frame.Frame.Height, false, Transparency);
                }
            }
        }
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            bool fliph      = false;
            bool flipv      = false;
            var  editorAnim = e.LoadAnimation2("WoodChipper", d, 0, -1, fliph, flipv, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0)
            {
                var frame  = editorAnim.Frames[0];
                var frame2 = editorAnim.Frames[1];
                var frame3 = editorAnim.Frames[2];
                var frame4 = editorAnim.Frames[6];

                //e.ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration);

                d.DrawBitmap(frame.Texture,
                             x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0),
                             y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0),
                             frame.Frame.Width, frame.Frame.Height, false, Transparency);
                d.DrawBitmap(frame2.Texture,
                             x + frame2.Frame.CenterX - (fliph ? (frame2.Frame.Width - editorAnim.Frames[1].Frame.Width) : 0),
                             y + frame2.Frame.CenterY + (flipv ? (frame2.Frame.Height - editorAnim.Frames[1].Frame.Height) : 0),
                             frame2.Frame.Width, frame2.Frame.Height, false, Transparency);
                d.DrawBitmap(frame3.Texture,
                             x + frame3.Frame.CenterX - (fliph ? (frame3.Frame.Width - editorAnim.Frames[2].Frame.Width) : 0),
                             y + frame3.Frame.CenterY + (flipv ? (frame3.Frame.Height - editorAnim.Frames[2].Frame.Height) : 0),
                             frame3.Frame.Width, frame3.Frame.Height, false, Transparency);
                d.DrawBitmap(frame4.Texture,
                             x + frame4.Frame.CenterX - (fliph ? (frame4.Frame.Width - editorAnim.Frames[6].Frame.Width) : 0),
                             y + frame4.Frame.CenterY + (flipv ? (frame4.Frame.Height - editorAnim.Frames[6].Frame.Height) : 0),
                             frame4.Frame.Width, frame4.Frame.Height, false, Transparency);
            }
        }
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            bool fliph       = false;
            bool flipv       = false;
            var  editorAnim  = e.LoadAnimation2("FilmProjector", d, 0, 0, fliph, flipv, false);
            var  editorAnim2 = e.LoadAnimation2("FilmProjector", d, 0, 1, fliph, flipv, false);
            var  editorAnim4 = e.LoadAnimation2("FilmProjector", d, 1, 0, fliph, flipv, false);
            var  editorAnim5 = e.LoadAnimation2("FilmProjector", d, 2, 0, fliph, flipv, false);
            var  editorAnim6 = e.LoadAnimation2("FilmProjector", d, 1, 0, fliph, flipv, false);
            var  editorAnim7 = e.LoadAnimation2("FilmProjector", d, 2, 0, fliph, flipv, false);
            var  editorAnim3 = e.LoadAnimation2("FilmProjector", d, 3, -1, fliph, flipv, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0 && editorAnim2 != null && editorAnim2.Frames.Count != 0 && editorAnim3 != null && editorAnim3.Frames.Count != 0 && editorAnim4 != null && editorAnim4.Frames.Count != 0 && editorAnim5 != null && editorAnim5.Frames.Count != 0 && editorAnim6 != null && editorAnim6.Frames.Count != 0 && editorAnim7 != null && editorAnim7.Frames.Count != 0)
            {
                var frame  = editorAnim.Frames[0];
                var frame2 = editorAnim2.Frames[0];
                var frame4 = editorAnim4.Frames[0];
                var frame5 = editorAnim5.Frames[0];
                var frame6 = editorAnim4.Frames[0];
                var frame7 = editorAnim5.Frames[0];
                var frame3 = editorAnim3.Frames[e.index];

                d.DrawBitmap(frame5.Texture,
                             x + 42 + frame5.Frame.CenterX - (fliph ? (frame5.Frame.Width - editorAnim5.Frames[0].Frame.Width) : 0),
                             y - 68 + frame5.Frame.CenterY + (flipv ? (frame5.Frame.Height - editorAnim5.Frames[0].Frame.Height) : 0),
                             frame5.Frame.Width, frame5.Frame.Height, false, Transparency);
                d.DrawBitmap(frame4.Texture,
                             x + 42 + frame4.Frame.CenterX - (fliph ? (frame4.Frame.Width - editorAnim4.Frames[0].Frame.Width) : 0),
                             y - 68 + frame4.Frame.CenterY + (flipv ? (frame4.Frame.Height - editorAnim4.Frames[0].Frame.Height) : 0),
                             frame4.Frame.Width, frame4.Frame.Height, false, Transparency);


                d.DrawBitmap(frame7.Texture,
                             x - 60 + frame7.Frame.CenterX - (fliph ? (frame7.Frame.Width - editorAnim7.Frames[0].Frame.Width) : 0),
                             y - 68 + frame7.Frame.CenterY + (flipv ? (frame7.Frame.Height - editorAnim7.Frames[0].Frame.Height) : 0),
                             frame7.Frame.Width, frame7.Frame.Height, false, Transparency);
                d.DrawBitmap(frame6.Texture,
                             x - 60 + frame6.Frame.CenterX - (fliph ? (frame6.Frame.Width - editorAnim6.Frames[0].Frame.Width) : 0),
                             y - 68 + frame6.Frame.CenterY + (flipv ? (frame6.Frame.Height - editorAnim6.Frames[0].Frame.Height) : 0),
                             frame6.Frame.Width, frame6.Frame.Height, false, Transparency);


                d.DrawBitmap(frame.Texture,
                             x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0),
                             y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0),
                             frame.Frame.Width, frame.Frame.Height, false, Transparency);
                d.DrawBitmap(frame2.Texture,
                             x + 185 + frame2.Frame.CenterX - (fliph ? (frame2.Frame.Width - editorAnim2.Frames[0].Frame.Width) : 0),
                             y + frame2.Frame.CenterY + (flipv ? (frame2.Frame.Height - editorAnim2.Frames[0].Frame.Height) : 0),
                             frame2.Frame.Width, frame2.Frame.Height, false, Transparency);

                //e.ProcessAnimation(frame3.Entry.FrameSpeed, frame3.Entry.Frames.Count, frame3.Frame.Duration);

                d.DrawBitmap(frame3.Texture,
                             x + 185 + frame3.Frame.CenterX - (fliph ? (frame3.Frame.Width - editorAnim3.Frames[0].Frame.Width) : 0),
                             y + frame3.Frame.CenterY + (flipv ? (frame3.Frame.Height - editorAnim3.Frames[0].Frame.Height) : 0),
                             frame3.Frame.Width, frame3.Frame.Height, false, Transparency);
            }
        }
 public ActionEntityPropertyChange(EditorEntity entity, string tag, object oldValue, object newValue, Action <EditorEntity, string, object, object, bool, bool> setValue)
 {
     this.entity   = entity;
     this.tag      = tag;
     this.oldValue = oldValue;
     this.newValue = newValue;
     this.setValue = setValue;
 }
Beispiel #28
0
    public void SpawnEditorEntity(EditorEntity entity)
    {
        var spawnedEntity = Instantiate(entity, tablesHolder.ActiveTable.transform);

        //spawnedEntity.gameObject.SetActive(true);

        spawnedEntity.transform.position = new Vector3(0, 0, 0f);
    }
        public override void Draw(Structures.EntityRenderProp properties)
        {
            DevicePanel  d            = properties.Graphics;
            EditorEntity entity       = properties.EditorObject;
            int          x            = properties.DrawX;
            int          y            = properties.DrawY;
            int          Transparency = properties.Transparency;
            bool         fliph        = false;
            bool         flipv        = false;
            string       text         = "UI/Text" + Methods.Solution.SolutionState.Main.CurrentManiaUILanguage + ".bin";

            int arrowWidth = (int)entity.attributesMap["arrowWidth"].ValueEnum;

            if (arrowWidth != 0)
            {
                arrowWidth /= 2;
            }
            int    frameID      = (int)entity.attributesMap["frameID"].ValueEnum;
            int    listID       = (int)entity.attributesMap["listID"].ValueEnum;
            bool   auxIcon      = entity.attributesMap["auxIcon"].ValueBool;
            bool   noText       = entity.attributesMap["noText"].ValueBool;
            int    auxframeID   = (int)entity.attributesMap["auxFrameID"].ValueEnum;
            int    auxlistID    = (int)entity.attributesMap["auxListID"].ValueEnum;
            int    width        = (int)entity.attributesMap["size"].ValueVector2.X.High;
            int    height       = (int)entity.attributesMap["size"].ValueVector2.Y.High;
            double alignmentVal = 0;
            int    align        = (int)entity.attributesMap["align"].ValueEnum;

            switch (align)
            {
            case 0:
                alignmentVal = -(width / 2) + 16;
                break;

            case 1:
                alignmentVal = (22 / 2);
                break;
            }

            d.DrawQuad(x - (width / 2) - height, y - (height / 2), x + (width / 2) + height, y + (height / 2), System.Drawing.Color.FromArgb(Transparency, System.Drawing.Color.Black), System.Drawing.Color.FromArgb(Transparency, System.Drawing.Color.Black), 0);

            if (noText == false)
            {
                var editorAnim = LoadAnimation(text, d, listID, frameID);
                DrawTexturePivotNormal(d, editorAnim, editorAnim.RequestedAnimID, editorAnim.RequestedFrameID, x + (int)alignmentVal, y, Transparency, fliph, flipv);
            }
            var leftArrow = LoadAnimation("UI/UIElements.bin", d, 2, 0);

            DrawTexturePivotNormal(d, leftArrow, leftArrow.RequestedAnimID, leftArrow.RequestedFrameID, x - arrowWidth + (int)alignmentVal, y, Transparency, fliph, flipv);
            var rightArrow = LoadAnimation("UI/UIElements.bin", d, 2, 1);

            DrawTexturePivotNormal(d, rightArrow, rightArrow.RequestedAnimID, rightArrow.RequestedFrameID, x + arrowWidth + (int)alignmentVal, y, Transparency, fliph, flipv);
            if (auxIcon)
            {
                var editorAnimIcon = LoadAnimation("UI/SaveSelect.bin", d, auxlistID, auxframeID);
                DrawTexturePivotNormal(d, editorAnimIcon, editorAnimIcon.RequestedAnimID, editorAnimIcon.RequestedFrameID, x + (int)alignmentVal, y, Transparency, fliph, flipv);
            }
        }
Beispiel #30
0
    private void SetCommonActions(EditorEntity instance)
    {
        instance.entityPlacement.SetConstraints(tilemapEditor.lowerLeft, tilemapEditor.upperRight);
        instance.entityPlacement.OnStartedBeingHeld +=
            () => editModeControl.SwitchToAction(CommonEditMode.EditingActions.Entity_Placement);

        instance.entityPlacement.OnStartedBeingHeld +=
            () => CustomButton.DeselectCurrent();
    }
Beispiel #31
0
    void OnEnable()
    {
        // 读取数据
        string leftSVPosText = EditorPrefs.GetString(KEY_VEC_SV_POS, "0,0");
        string[] array = leftSVPosText.Split(',');
        mLeftSVPos.x = float.Parse(array[0]);
        mLeftSVPos.y = float.Parse(array[1]);

        // 通过反射查找该dll下所有的BaseEditorWindow
        listEditor = new List<EditorEntity>(20);
        Type[] allTypes = Assembly.GetExecutingAssembly().GetTypes();
        foreach (Type t in allTypes)
        {
            if (t.IsSubclassOf(typeof(BaseEditorWindow)))
            {
                EditorEntity entity = new EditorEntity();
                entity.editor = (BaseEditorWindow)Activator.CreateInstance(t, true);
                entity.editor.aaaaa = this;
                entity.isOpenOnce = false;
                entity.isActive = false;
                listEditor.Add(entity);
            }
        }
        listEditor.TrimExcess();

        // 还原上次选择的窗口
        if (listEditor.Count > 0)
        {
            string editorName = EditorPrefs.GetString(KEY_STR_CU_EDT);
            if (!string.IsNullOrEmpty(editorName))
            {
                foreach (EditorEntity entity in listEditor)
                {
                    if (string.Equals(editorName, entity.editor.Name))
                    {
                        SwitchEditor(entity);
                        break;
                    }
                }
            }
        }
    }
Beispiel #32
0
 private void SwitchEditor(EditorEntity newEntity)
 {
     EditorEntity oldEntity = FindOldActiveEntity();
     if (oldEntity != null)
     {
         //隐藏
         oldEntity.isActive = false;
         oldEntity.editor.OnHide();
         // 自动销毁
         if (oldEntity.editor.AutoDestroy && !oldEntity.isDestroyed)
         {
             oldEntity.editor.OnDestroy();
             oldEntity.isDestroyed = true;
             oldEntity.isOpenOnce = false;
         }
     }
     // 打开新的Editor
     if (!newEntity.isOpenOnce)
     {
         newEntity.isDestroyed = false;
         newEntity.editor.OnCreate();
     }
     newEntity.editor.OnOpen();
     newEntity.isOpenOnce = true;
     newEntity.isActive = true;
 }
Beispiel #33
0
 public AddEntity(ControllerEditor controller, EditorEntity editorEntity)
     : base(controller, editorEntity)
 {
 }