134 lines
2.9 KiB
C#
134 lines
2.9 KiB
C#
using System;
|
|
using UnityEngine;
|
|
|
|
[Serializable]
|
|
public class area_class
|
|
{
|
|
public bool active;
|
|
|
|
public bool foldout;
|
|
|
|
public Rect area;
|
|
|
|
public Rect area_old;
|
|
|
|
public Rect area_max;
|
|
|
|
public Vector2 center;
|
|
|
|
public Vector2 image_offset;
|
|
|
|
public Vector3 rotation;
|
|
|
|
public bool rotation_active;
|
|
|
|
public bool link_start;
|
|
|
|
public bool link_end;
|
|
|
|
public float resolution;
|
|
|
|
public float custom_resolution;
|
|
|
|
public Vector2 step;
|
|
|
|
public Vector2 step_old;
|
|
|
|
public Vector2 conversion_step;
|
|
|
|
public resolution_mode_enum resolution_mode;
|
|
|
|
public string resolution_mode_text;
|
|
|
|
public string resolution_tooltip_text;
|
|
|
|
public int tree_resolution;
|
|
|
|
public int object_resolution;
|
|
|
|
public int colormap_resolution;
|
|
|
|
public bool tree_resolution_active;
|
|
|
|
public bool object_resolution_active;
|
|
|
|
public area_class()
|
|
{
|
|
active = true;
|
|
link_start = true;
|
|
link_end = true;
|
|
resolution_mode = resolution_mode_enum.Automatic;
|
|
tree_resolution = 128;
|
|
object_resolution = 32;
|
|
colormap_resolution = 2048;
|
|
}
|
|
|
|
public virtual void max()
|
|
{
|
|
area = area_max;
|
|
}
|
|
|
|
public virtual Rect round_area_to_step(Rect area1)
|
|
{
|
|
area1.xMin = Mathf.Round(area1.xMin / step.x) * step.x;
|
|
area1.xMax = Mathf.Round(area1.xMax / step.x) * step.x;
|
|
area1.yMin = Mathf.Round(area1.yMin / step.y) * step.y;
|
|
area1.yMax = Mathf.Round(area1.yMax / step.y) * step.y;
|
|
return area1;
|
|
}
|
|
|
|
public virtual void set_resolution_mode_text()
|
|
{
|
|
if (area == area_max)
|
|
{
|
|
resolution_mode_text = "M";
|
|
resolution_tooltip_text = "Maximum Area Selected";
|
|
}
|
|
else
|
|
{
|
|
resolution_mode_text = "C";
|
|
resolution_tooltip_text = "Custum Area Selected";
|
|
}
|
|
if (resolution_mode == resolution_mode_enum.Automatic)
|
|
{
|
|
resolution_mode_text += "-> A";
|
|
resolution_tooltip_text += "\n\nStep Mode is on Automatic";
|
|
}
|
|
else if (resolution_mode == resolution_mode_enum.Heightmap)
|
|
{
|
|
resolution_mode_text += "-> H";
|
|
resolution_tooltip_text += "\n\nStep Mode is on Heightmap";
|
|
}
|
|
else if (resolution_mode == resolution_mode_enum.Splatmap)
|
|
{
|
|
resolution_mode_text += "-> S";
|
|
resolution_tooltip_text += "\n\nStep Mode is on Splatmap";
|
|
}
|
|
else if (resolution_mode == resolution_mode_enum.Detailmap)
|
|
{
|
|
resolution_mode_text += "-> D";
|
|
resolution_tooltip_text += "\n\nStep Mode is on Detailmap";
|
|
}
|
|
else if (resolution_mode == resolution_mode_enum.Tree)
|
|
{
|
|
resolution_mode_text += "-> T";
|
|
resolution_tooltip_text += "\n\nStep Mode is on Tree";
|
|
}
|
|
else if (resolution_mode == resolution_mode_enum.Object)
|
|
{
|
|
resolution_mode_text += "-> O";
|
|
resolution_tooltip_text += "\n\nStep Mode is on Object";
|
|
}
|
|
else if (resolution_mode == resolution_mode_enum.Units)
|
|
{
|
|
resolution_mode_text += "-> U";
|
|
resolution_tooltip_text += "\n\nStep Mode is on Units";
|
|
}
|
|
else if (resolution_mode == resolution_mode_enum.Custom)
|
|
{
|
|
resolution_mode_text += "-> C";
|
|
resolution_tooltip_text += "\n\nStep Mode is on Custom";
|
|
}
|
|
}
|
|
}
|