Esempio n. 1
0
    public void OnSceneGUI()
    {
        Grid grid = BrushUtility.GetRootGrid(false);

        if (grid != null)
        {
            if (brush.activeObject != null && brush.activeObject.m_Key != null)
            {
                Vector3Int keypos  = grid.WorldToCell(brush.activeObject.m_Key.transform.position);
                Vector3Int doorpos = grid.WorldToCell(brush.activeObject.transform.position);
                Color      color   = brush.activeObject.m_Key.color;
                BrushEditorUtility.DrawLine(grid, keypos, doorpos, new Color(color.r, color.g, color.b, 0.5f));
            }
        }
    }
Esempio n. 2
0
    public void OnSceneGUI()
    {
        Grid grid = BrushUtility.GetRootGrid(false);
        Door door = brush.activeObject;

        if (grid == null || door == null || door.Exit == null)
        {
            return;
        }

        Door    exit         = door.Exit;
        Vector3 exitPosition = grid.WorldToCellCentered(exit.transform.position);
        Vector3 doorPos      = grid.WorldToCellCentered(door.transform.position);
        Color   color        = Color.red;

        BrushEditorUtility.DrawLine(grid, exitPosition, doorPos, new Color(color.r, color.g, color.b, 0.5f));
    }
Esempio n. 3
0
    public void OnSceneGUI()
    {
        Grid grid = BrushUtility.GetRootGrid(false);
        PressurePlateGate gate = brush.activeObject;

        if (grid == null || gate == null || gate.PressurePlate == null)
        {
            return;
        }

        PressurePlate plate            = gate.PressurePlate;
        Vector3       pressurePlatePos = grid.WorldToCellCentered(plate.transform.position);
        Vector3       doorPos          = grid.WorldToCellCentered(gate.transform.position);
        Color         color            = Color.red;

        BrushEditorUtility.DrawLine(grid, pressurePlatePos, doorPos, new Color(color.r, color.g, color.b, 0.5f));
    }
    public void OnSceneGUI()
    {
        Grid grid = BrushUtility.GetRootGrid(false);

        if (grid != null)
        {
            if (brush.activeObject != null)
            {
                Vector3Int worldTurret = grid.WorldToCell(brush.activeObject.transform.position);
                for (int i = 0; i < brush.activeObject.m_Targets.Count; i++)
                {
                    Vector3Int localPos = brush.activeObject.m_Targets[i];
                    Vector3Int worldPos = worldTurret + localPos;
                    int        tick     = brush.activeObject.m_Ticks[i];
                    Handles.Label(grid.CellToWorld(worldPos + Vector3Int.up), " " + tick.ToString());
                    BrushEditorUtility.DrawLine(grid, worldPos, grid.WorldToCell(brush.activeObject.transform.position), new Color(1f, 0f, 1f, 0.6f));
                    BrushEditorUtility.DrawQuad(grid, worldPos, new Color(1f, 0f, 1f, 0.4f));
                }
                BrushEditorUtility.DrawMarquee(grid, worldTurret, new Color(1f, 0f, 1f, 0.6f));
                Vector3 world = grid.CellToWorld(worldTurret);
                Handles.Label(world, " " + brush.activeObject.m_TickDelay.ToString("F"));
            }
        }
    }