Exemplo n.º 1
0
        void DrawSlot()
        {
            for (int x = 0; x < profile.Width; x++)
            {
                for (int y = 0; y < profile.Height; y++)
                {
                    if (teleportID != -Vector2.right)
                    {
                        if (DrawSlotButtonTeleport(x, y, rect, profile))
                        {
                            if (x == teleportID.x && y == teleportID.y)
                            {
                                profile.SetTeleport(Mathf.CeilToInt(teleportID.x), Mathf.CeilToInt(teleportID.y), 0);
                            }
                            else
                            {
                                profile.SetTeleport(Mathf.CeilToInt(teleportID.x), Mathf.CeilToInt(teleportID.y), y * 12 + x + 1);
                            }
                            teleportID = -Vector2.right;
                        }
                        continue;
                    }


                    if (DrawSlotButton(x, y, rect, profile))
                    {
                        switch (toolID)
                        {
                        case "Slots":
                            profile.SetSlot(x, y, !profile.GetSlot(x, y));
                            break;

                        case "Generators":
                            profile.SetGenerator(x, y, !profile.GetGenerator(x, y));
                            break;

                        case "Teleports":
                            teleportID = new Vector2(x, y);
                            break;

                        case "Sugar Drop":
                            //profile.SetSugarDrop(x, y, !profile.GetSugarDrop(x, y));
                            break;

                        case "Gravity":
                            profile.SetGravity(x, y, Mathf.CeilToInt(Mathf.Repeat(profile.GetGravity(x, y) + 1, 4)));
                            break;
                        }
                    }
                }
            }
            DrawWallPreview(rect, profile);
        }