예제 #1
0
        static bool DrawWallButton(int x, int y, string t, Rect r, LevelProfile lp)
        {
            bool btn = false;

            if (t == "H")
            {
                btn = lp.GetWallH(x, y);
            }
            if (t == "V")
            {
                btn = lp.GetWallV(x, y);
            }

            defaultColor = GUI.color;
            Color color = defaultColor;

            if (btn)
            {
                color *= Color.red;
            }
            GUI.color = color;

            if (t == "V")
            {
                btn = GUI.Button(new Rect(r.xMin + (x + 1) * (cellSize + slotOffect) - 4 - slotOffect / 2,
                                          r.yMin + y * (cellSize + slotOffect) - 10 + 20, 8, 20), "", slotStyle);
            }
            if (t == "H")
            {
                btn = GUI.Button(new Rect(r.xMin + x * (cellSize + slotOffect) - 10 + 20,
                                          r.yMin + (y + 1) * (cellSize + slotOffect) - 4 - slotOffect / 2, 20, 8), "", slotStyle);
            }
            GUI.color = defaultColor;
            return(btn);
        }
예제 #2
0
        public static void DrawWallPreview(Rect r, LevelProfile lp)
        {
            int x;
            int y;

            GUI.enabled = false;
            for (x = 0; x < lp.Width - 1; x++)
            {
                for (y = 0; y < lp.Height; y++)
                {
                    if (lp.GetWallV(x, y) && lp.GetSlot(x, y) && lp.GetSlot(x + 1, y))
                    {
                        DrawWallButton(x, y, "V", r, lp);
                    }
                }
            }
            for (x = 0; x < lp.Width; x++)
            {
                for (y = 0; y < lp.Height - 1; y++)
                {
                    if (lp.GetWallH(x, y) && lp.GetSlot(x, y) && lp.GetSlot(x, y + 1))
                    {
                        DrawWallButton(x, y, "H", r, lp);
                    }
                }
            }
            GUI.enabled = true;
        }
예제 #3
0
        bool DrawSlotButtonTeleport(int x, int y, Rect r, LevelProfile lp)
        {
            if (!lp.GetSlot(x, y))
            {
                return(false);
            }

            defaultColor = GUI.backgroundColor;
            Color color = Color.cyan;

            if (teleportID.x == x && teleportID.y == y)
            {
                color = Color.magenta;
            }
            if (lp.GetTeleport(Mathf.FloorToInt(teleportID.x), Mathf.FloorToInt(teleportID.y)) == 12 * y + x + 1)
            {
                color = Color.yellow;
            }
            string label = "";

            bool btn = false;

            GUI.backgroundColor = color;
            btn = GUI.Button(new Rect(r.xMin + x * (cellSize + slotOffect), r.yMin + y * (cellSize + slotOffect), cellSize, cellSize), label, slotStyle);

            if (lp.GetSlot(x, y) && lp.GetGenerator(x, y))
            {
                GUI.backgroundColor = Color.black;
                GUI.Box(new Rect(r.xMin + x * (cellSize + slotOffect) - 2, r.yMin + y * (cellSize + slotOffect) - 2, 10, 10), "G", iconStyle);
            }
            if (lp.GetSlot(x, y) && lp.GetTeleport(x, y) > 0)
            {
                GUI.backgroundColor = Color.black;
                GUI.Box(new Rect(r.xMin + x * (cellSize + slotOffect) + 10, r.yMin + y * (cellSize + slotOffect) - 2, cellSize - 12, 10), "T:" + lp.GetTeleport(x, y).ToString(), iconStyle);
            }

            if (lp.GetSlot(x, y))
            {
                GUI.backgroundColor = transparentColor;
                GUI.Box(new Rect(r.xMin + x * (cellSize + slotOffect), r.yMin + y * (cellSize + slotOffect) + cellSize - 10, 20, 10), (y * 12 + x + 1).ToString(), slotStyle);
            }

            GUI.backgroundColor = defaultColor;

            return(btn);
        }
예제 #4
0
        public void DrawSlotPreview(Rect r, LevelProfile lp)
        {
            int x;
            int y;

            GUI.enabled = false;
            for (x = 0; x < lp.Width; x++)
            {
                for (y = 0; y < lp.Height; y++)
                {
                    if (lp.GetSlot(x, y))
                    {
                        DrawSlotButton(x, y, r, lp);
                    }
                }
            }
            GUI.enabled = true;
        }
예제 #5
0
        public LevelProfile GetClone()
        {
            LevelProfile clone = new LevelProfile();

            clone.Level = Level;

            clone.Width     = Width;
            clone.Height    = Height;
            clone.CardCount = CardCount;
//			clone.targetSugarDropsCount = targetSugarDropsCount;
//			clone.countOfEachTargetCount = countOfEachTargetCount;
//			clone.targetColorCount = targetColorCount;

//			clone.firstStarScore = firstStarScore;
//			clone.secondStarScore = secondStarScore;
//			clone.thirdStarScore = thirdStarScore;

//			clone.Target = Target;
//			clone.limitation = limitation;

//			clone.SecDuration = SecDuration;
//			clone.MoveCount = MoveCount;

            clone._slot      = _slot;
            clone._gravity   = _gravity;
            clone._generator = _generator;
            clone._teleport  = _teleport;
//			clone._sugarDrop = _sugarDrop;
            clone._chip        = _chip;
            clone._jelly       = _jelly;
            clone._block       = _block;
            clone._powerup     = _powerup;
            clone._wallV       = _wallV;
            clone._wallH       = _wallH;
            clone.StonePortion = StonePortion;

            return(clone);
        }
예제 #6
0
        bool DrawSlotButton(int x, int y, Rect r, LevelProfile lp)
        {
            defaultColor = GUI.backgroundColor;
            Color  color = Color.white;
            string label = "";
            bool   btn   = false;
            int    block = lp.GetBlock(x, y);
            int    jelly = lp.GetJelly(x, y);
            int    chip  = lp.GetChip(x, y);

            if (!lp.GetSlot(x, y))
            {
                color *= 0;
            }
            else
            {
                if (block == 0)
                {
                    if (chip == 9)
                    {
                        color *= buttonColor;
                        lp.SetPowerup(x, y, 0);
                    }
                    else if (chip > 0)
                    {
                        if (chip > lp.CardCount)
                        {
                            lp.SetChip(x, y, -1);
                        }

                        color *= chipColor[chip - 1];
                    }
                }

                if (block == 5)
                {
                    if (chip > 0)
                    {
                        if (chip > lp.CardCount)
                        {
                            lp.SetChip(x, y, -1);
                        }
                        color *= chipColor[chip - 1];
                    }
                }
                if (block == 0 && chip == -1 && lp.GetPowerup(x, y) == 0)
                {
                    color *= unpressedColor;
                }
                if (block == 0 && lp.GetPowerup(x, y) > 0)
                {
                    label += (label.Length == 0 ? "" : "\n");
                    label += powerupLabelNew[lp.GetPowerup(x, y)];
                }

                if (block > 0 && block <= 3)
                {
                    label += (label.Length == 0 ? "" : "\n") + "B:" + block.ToString();
                }
                if (block == 4)
                {
                    label += (label.Length == 0 ? "" : "\n") + "Weed";
                }
                if (block == 5)
                {
                    label += (label.Length == 0 ? "" : "\n") + "Brch";
                }

                if (block >= 6 && block <= 9)
                {
                    label += (label.Length == 0 ? "" : "\n") + "Boss" + (block - 5).ToString();
                }
//				if (jelly > 0 && lp.Target == E_FieldTarget.Jelly) {
//					label += (label.Length == 0 ? "" : "\n");
//					switch (jelly) {
//						case 1: label += "JS"; break;
//						case 2: label += "JT"; break;
//					}
//				}

                if (block >= 10 && block < 20)
                {
                    label += (label.Length == 0 ? "" : "\n") + "漩涡" + (block - 9).ToString();
                }

                if (block >= 20 && block < 30)
                {
                    label += (label.Length == 0 ? "" : "\n") + "风车";
                }

                if (block >= 30 && block < 40)
                {
                    label += (label.Length == 0 ? "" : "\n") + "发射器" + (block - 29).ToString();
                }
            }

            GUI.backgroundColor = color;
            btn = GUI.Button(new Rect(r.xMin + x * (cellSize + slotOffect), r.yMin + y * (cellSize + slotOffect), cellSize, cellSize), label, slotStyle);

            float cursor = -2;

            if (lp.GetSlot(x, y) && lp.GetGenerator(x, y))
            {
                GUI.backgroundColor = Color.black;
                GUI.Box(new Rect(r.xMin + x * (cellSize + slotOffect) + cursor, r.yMin + y * (cellSize + slotOffect) - 2, 10, 10), "G", iconStyle);
                cursor += 10 + 2;
            }

//			if (lp.target == E_FieldTarget.SugarDrop && lp.GetSlot(x, y) && lp.GetSugarDrop(x, y)) {
//				GUI.backgroundColor = Color.black;
//				GUI.Box(new Rect(r.xMin + x * (cellSize + slotOffect) + cursor, r.yMin + y * (cellSize + slotOffect) - 2, 10, 10), "S", iconStyle);
//				cursor += 10 + 2;
//			}

            if (lp.GetSlot(x, y))
            {
                GUI.backgroundColor = Color.black;
                GUI.Box(new Rect(r.xMin + x * (cellSize + slotOffect) + cursor, r.yMin + y * (cellSize + slotOffect) - 2, 10, 10), gravityLabel[profile.GetGravity(x, y)], iconStyle);
                cursor += 10 + 2;
            }

            if (lp.GetSlot(x, y) && lp.GetTeleport(x, y) > 0)
            {
                GUI.backgroundColor = Color.black;
                GUI.Box(new Rect(r.xMin + x * (cellSize + slotOffect) + cursor, r.yMin + y * (cellSize + slotOffect) - 2, cellSize - 12, 10), "T:" + lp.GetTeleport(x, y).ToString(), iconStyle);
            }

            if (lp.GetSlot(x, y))
            {
                GUI.backgroundColor = transparentColor;
                GUI.Box(new Rect(r.xMin + x * (cellSize + slotOffect), r.yMin + y * (cellSize + slotOffect) + cellSize - 10, 20, 10), (y * 12 + x + 1).ToString(), slotStyle);
            }

            GUI.backgroundColor = defaultColor;
            return(btn);
        }
예제 #7
0
        public override void OnInspectorGUI()
        {
            level = (Level)target;

            Undo.RecordObject(level, "Edit Level");
            profile = level.Profile;

            if (profile == null)
            {
                profile = new LevelProfile();
            }

            //nick_yangzj:ToDo
//			if (SessionAssistant.main == null)
//				SessionAssistant.main = GameObject.FindObjectOfType<SessionAssistant>();

            if (profile.LevelInstanceID == 0 || profile.LevelInstanceID != target.GetInstanceID())
            {
                if (profile.LevelInstanceID != target.GetInstanceID())
                {
                    profile = profile.GetClone();
                }
                profile.LevelInstanceID = target.GetInstanceID();
            }

            profile.Level = level.transform.GetSiblingIndex() + 1;

            level.name = "Level:" + profile.Level.ToString();            // + "," + profile.target + "," + profile.limitation;

            parametersFade.target = GUILayout.Toggle(parametersFade.target, "Level Parameters", EditorStyles.foldout);

            if (EditorGUILayout.BeginFadeGroup(parametersFade.faded))
            {
                profile.Width        = Mathf.RoundToInt(EditorGUILayout.Slider("宽度", 1f * profile.Width, 4f, 12f));
                profile.Height       = Mathf.RoundToInt(EditorGUILayout.Slider("高度", 1f * profile.Height, 4f, 12f));
                profile.CardCount    = Mathf.RoundToInt(EditorGUILayout.Slider("带入战斗的卡牌个数(待定)", 1f * profile.CardCount, 3f, 6f));
                profile.StonePortion = Mathf.Round(EditorGUILayout.Slider("格子是障碍的概率", profile.StonePortion, 0f, 0.7f) * 100) / 100;
//				profile.MoveCount = Mathf.Clamp(EditorGUILayout.IntField("初始步数", profile.MoveCount), 5, 100);
//				profile.SecDuration = Mathf.Max(0, EditorGUILayout.IntField("倒计时(s)", profile.SecDuration));
//				EditorGUILayout.BeginHorizontal ();
//				EditorGUILayout.LabelField ("Score Stars", GUILayout.ExpandWidth(true));
//				profile.firstStarScore = Mathf.Max(EditorGUILayout.IntField (profile.firstStarScore, GUILayout.ExpandWidth(true)), 1);
//				profile.secondStarScore = Mathf.Max(EditorGUILayout.IntField (profile.secondStarScore, GUILayout.ExpandWidth(true)), profile.firstStarScore+1);
//				profile.thirdStarScore = Mathf.Max(EditorGUILayout.IntField (profile.thirdStarScore, GUILayout.ExpandWidth(true)), profile.secondStarScore+1);
//				EditorGUILayout.EndHorizontal ();

//				profile.limitation = (Limitation) EditorGUILayout.EnumPopup ("Limitation", profile.limitation);
//				switch (profile.limitation) {
//					case Limitation.Moves:
//						profile.moveCount = Mathf.Clamp(EditorGUILayout.IntField("Move Count", profile.moveCount), 5, 50);
//						break;
//					case Limitation.Time:
//						profile.duration = Mathf.Max(0, EditorGUILayout.IntField("Session duration", profile.duration));
//						break;
//				}

//				profile.target = (E_FieldTarget) EditorGUILayout.EnumPopup ("Target", profile.target);

                //colorModeFade.target = profile.target == E_FieldTarget.Color;

//				if (EditorGUILayout.BeginFadeGroup (colorModeFade.faded)) {
//					defaultColor = GUI.color;
//					profile.targetColorCount = Mathf.RoundToInt(EditorGUILayout.Slider("Targets Count", profile.targetColorCount, 1, profile.chipCount));
//					for (int i = 0; i < 6; i++) {
//						GUI.color = chipColor[i];
//						if (i < profile.targetColorCount)
//							profile.SetTargetCount(i, Mathf.Clamp(EditorGUILayout.IntField("Color " + alphabet[i].ToString(), profile.GetTargetCount(i)), 1, 999));
//						else
//							profile.SetTargetCount(i, 0);
//					}
//					GUI.color = defaultColor;
//				}
//				EditorGUILayout.EndFadeGroup ();
//
//				sugarDropFade.target = profile.target == E_FieldTarget.SugarDrop;
//
//				if (EditorGUILayout.BeginFadeGroup(sugarDropFade.faded)) {
//					profile.targetSugarDropsCount = Mathf.RoundToInt(EditorGUILayout.Slider("Sugar Count", profile.targetSugarDropsCount, 1, 20));
//				}
//				EditorGUILayout.EndFadeGroup();
            }

            EditorGUILayout.EndFadeGroup();


            EditorGUILayout.Space();
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar, GUILayout.ExpandWidth(true));

            defaultColor = GUI.color;
            GUI.color    = currentMode == EditMode.Slot ? unpressedColor : defaultColor;
            if (GUILayout.Button("卡槽", EditorStyles.toolbarButton, GUILayout.Width(40)))
            {
                currentMode = EditMode.Slot;
            }
            GUI.color = currentMode == EditMode.Chip ? unpressedColor : defaultColor;
            if (GUILayout.Button("卡片", EditorStyles.toolbarButton, GUILayout.Width(40)))
            {
                currentMode = EditMode.Chip;
            }
            GUI.color = currentMode == EditMode.PowerUpNew ? unpressedColor : defaultColor;
            if (GUILayout.Button("特殊卡片(新版)", EditorStyles.toolbarButton, GUILayout.Width(70)))
            {
                currentMode = EditMode.PowerUpNew;
            }
//			if (profile.target == E_FieldTarget.Jelly) {
//				GUI.color = currentMode == EditMode.Jelly ? unpressedColor : defaultColor;
//				if (GUILayout.Button("冰冻", EditorStyles.toolbarButton, GUILayout.Width(50)))
//					currentMode = EditMode.Jelly;
//			}
            GUI.color = currentMode == EditMode.Block ? unpressedColor : defaultColor;
            if (GUILayout.Button("阻碍", EditorStyles.toolbarButton, GUILayout.Width(50)))
            {
                currentMode = EditMode.Block;
            }
            GUI.color = currentMode == EditMode.Wall ? unpressedColor : defaultColor;
            if (GUILayout.Button("墙", EditorStyles.toolbarButton, GUILayout.Width(40)))
            {
                currentMode = EditMode.Wall;
            }
            GUI.color = currentMode == EditMode.PowerUp ? unpressedColor : defaultColor;
            if (GUILayout.Button("特殊卡片", EditorStyles.toolbarButton, GUILayout.Width(70)))
            {
                currentMode = EditMode.PowerUp;
            }
            GUI.color = defaultColor;

            GUILayout.FlexibleSpace();

            if (GUILayout.Button("重置场景", EditorStyles.toolbarButton, GUILayout.Width(70)))
            {
                profile = new LevelProfile();
            }

            EditorGUILayout.EndVertical();

            // Slot modes
            if (currentMode == EditMode.Slot)
            {
                EditorGUILayout.BeginHorizontal(EditorStyles.toolbar, GUILayout.ExpandWidth(true));

                defaultColor = GUI.color;

                GUI.color = toolID == "Slots" ? unpressedColor : defaultColor;
                if (GUILayout.Button("卡槽", EditorStyles.toolbarButton, GUILayout.Width(40)))
                {
                    toolID = "Slots";
                }

                GUI.color = toolID == "Generators" ? unpressedColor : defaultColor;
                if (GUILayout.Button("出生点", EditorStyles.toolbarButton, GUILayout.Width(70)))
                {
                    toolID = "Generators";
                }

                GUI.color = toolID == "Teleports" ? unpressedColor : defaultColor;
                if (GUILayout.Button("传送", EditorStyles.toolbarButton, GUILayout.Width(70)))
                {
                    toolID = "Teleports";
                }

//				if (profile.target == E_FieldTarget.SugarDrop) {
//					GUI.color = toolID == "Sugar Drop" ? unpressedColor : defaultColor;
//					if (GUILayout.Button("Sugar Drop", EditorStyles.toolbarButton, GUILayout.Width(70)))
//						toolID = "Sugar Drop";
//				}
                GUI.color = toolID == "Gravity" ? unpressedColor : defaultColor;
                if (GUILayout.Button("重力方向", EditorStyles.toolbarButton, GUILayout.Width(70)))
                {
                    toolID = "Gravity";
                }

                GUI.color = defaultColor;
                GUILayout.FlexibleSpace();

                EditorGUILayout.EndHorizontal();
            }

//			Debug.LogError(profile.GetSlot(0,0));

            // Slot modes
            if (currentMode == EditMode.PowerUp)
            {
                EditorGUILayout.BeginHorizontal(EditorStyles.toolbar, GUILayout.ExpandWidth(true));

                defaultColor = GUI.color;

                //特殊效果卡牌放置
//				DebugUtil.Info("powerup count:" + SessionControl.powerups.Count);

                foreach (SessionControl.PowerUps powerup in SessionControl.powerupsNew)
                {
                    if (powerup.levelEditorID > 0)
                    {
                        GUI.color = toolID == powerup.levelEditorName ? unpressedColor : defaultColor;
                        if (GUILayout.Button(powerup.levelEditorName, EditorStyles.toolbarButton, GUILayout.Width(30)))
                        {
                            toolID = powerup.levelEditorName;
                        }
                    }
                }

                GUI.color = defaultColor;
                GUILayout.FlexibleSpace();

                EditorGUILayout.EndHorizontal();
            }

            if (currentMode == EditMode.PowerUpNew)
            {
                EditorGUILayout.BeginHorizontal(EditorStyles.toolbar, GUILayout.ExpandWidth(true));

                defaultColor = GUI.color;

                //特殊效果卡牌放置
                //				DebugUtil.Info("powerup count:" + SessionControl.powerups.Count);

                foreach (FightNew.PowerUps powerup in FightNew.PowerUps.powerupsNew)
                {
                    if (powerup.levelEditorID > 0)
                    {
                        GUI.color = toolID == powerup.levelEditorName ? unpressedColor : defaultColor;
                        if (GUILayout.Button(powerup.levelEditorName, EditorStyles.toolbarButton, GUILayout.Width(50)))
                        {
                            toolID = powerup.levelEditorName;
                        }
                    }
                }

                GUI.color = defaultColor;
                GUILayout.FlexibleSpace();

                EditorGUILayout.EndHorizontal();
            }

            // Chip modes
            if (currentMode == EditMode.Chip)
            {
                EditorGUILayout.BeginHorizontal(EditorStyles.toolbar, GUILayout.ExpandWidth(true));

                string key;
                defaultColor = GUI.color;

                GUI.color = toolID == "Random" ? unpressedColor : defaultColor;
                if (GUILayout.Button("随机", EditorStyles.toolbarButton, GUILayout.Width(50)))
                {
                    toolID = "Random";
                }

                for (int i = 0; i < profile.CardCount; i++)
                {
                    key       = "卡牌 " + alphabet[i];
                    GUI.color = toolID == key ? unpressedColor * chipColor[i] : defaultColor * chipColor[i];
                    if (GUILayout.Button(key, EditorStyles.toolbarButton, GUILayout.Width(50)))
                    {
                        toolID = key;
                    }
                }

                GUI.color = toolID == "Stone" ? unpressedColor : defaultColor;
                if (GUILayout.Button("石头", EditorStyles.toolbarButton, GUILayout.Width(50)))
                {
                    toolID = "Stone";
                }

                GUI.color = defaultColor;
                GUILayout.FlexibleSpace();

                EditorGUILayout.EndHorizontal();
            }

            // Block modes
            if (currentMode == EditMode.Block)
            {
                EditorGUILayout.BeginHorizontal(EditorStyles.toolbar, GUILayout.ExpandWidth(true));

                defaultColor = GUI.color;
                GUI.color    = toolID == "Simple Block" ? unpressedColor : defaultColor;
                if (GUILayout.Button("简单块", EditorStyles.toolbarButton, GUILayout.Width(80)))
                {
                    toolID = "Simple Block";
                }
                GUI.color = toolID == "Weed" ? unpressedColor : defaultColor;
                if (GUILayout.Button("杂草", EditorStyles.toolbarButton, GUILayout.Width(40)))
                {
                    toolID = "Weed";
                }
                GUI.color = toolID == "Branch" ? unpressedColor : defaultColor;
                if (GUILayout.Button("套壳", EditorStyles.toolbarButton, GUILayout.Width(50)))
                {
                    toolID = "Branch";
                }
                GUI.color = toolID == "Boss" ? unpressedColor : defaultColor;
                if (GUILayout.Button("Boss", EditorStyles.toolbarButton, GUILayout.Width(50)))
                {
                    toolID = "Boss";
                }

                GUI.color = toolID == "XuanWo" ? unpressedColor : defaultColor;
                if (GUILayout.Button("漩涡", EditorStyles.toolbarButton, GUILayout.Width(50)))
                {
                    toolID = "XuanWo";
                }
                GUI.color = toolID == "FengChe" ? unpressedColor : defaultColor;
                if (GUILayout.Button("风车", EditorStyles.toolbarButton, GUILayout.Width(50)))
                {
                    toolID = "FengChe";
                }
                GUI.color = toolID == "ZhangAiFaSheQi" ? unpressedColor : defaultColor;
                if (GUILayout.Button("障碍发射器", EditorStyles.toolbarButton, GUILayout.Width(80)))
                {
                    toolID = "ZhangAiFaSheQi";
                }
                GUI.color = defaultColor;
                GUILayout.FlexibleSpace();

                EditorGUILayout.EndHorizontal();
            }



            EditorGUILayout.BeginVertical(EditorStyles.inspectorDefaultMargins);

            rect    = GUILayoutUtility.GetRect(profile.Width * (cellSize + slotOffect), profile.Height * (cellSize + slotOffect));
            rect.x += slotOffect;
            rect.y += slotOffect;

            EditorGUILayout.BeginHorizontal();
            DrawModeTools();
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.EndVertical();

            //特殊道具
            powerupLabel.Clear();
            foreach (SessionControl.PowerUps powerup in SessionControl.powerupsNew)
            {
                if (powerup.levelEditorID > 0 &&
                    !powerupLabel.ContainsKey(powerup.levelEditorID))
                {
                    powerupLabel.Add(powerup.levelEditorID, powerup.levelEditorName);
                }
            }

            powerupLabelNew.Clear();
            foreach (FightNew.PowerUps powerup in FightNew.PowerUps.powerupsNew)
            {
                if (powerup.levelEditorID > 0 &&
                    !powerupLabelNew.ContainsKey(powerup.levelEditorID))
                {
                    powerupLabelNew.Add(powerup.levelEditorID, powerup.levelEditorName);
                }
            }

            switch (currentMode)
            {
            case EditMode.Slot: DrawSlot(); break;

            case EditMode.Chip: DrawChip(); break;

            case EditMode.PowerUp: DrawPowerUp(); break;

            case EditMode.PowerUpNew: DrawPowerUpNew(); break;

//				case EditMode.Jelly: DrawJelly(); break;
            case EditMode.Block: DrawBlock(); break;

            case EditMode.Wall: DrawWall(); break;
            }

            if (level != (Level)target)
            {
                Debug.LogError("not eaual");
            }

            level.Profile = profile;
        }