You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.2 KiB
50 lines
1.2 KiB
11 months ago
|
using UnityEngine;
|
||
|
|
||
|
/// <summary>
|
||
|
/// 测量工具
|
||
|
/// </summary>
|
||
|
public class MeasureTools : MonoSingleton<MeasureTools>
|
||
|
{
|
||
|
private Measure lengthTool;
|
||
|
private Measure heightTool;
|
||
|
private Measure areaTool;
|
||
|
|
||
|
public override void Init()
|
||
|
{
|
||
|
lengthTool = new GameObject("LengthTool").AddComponent<Length>();
|
||
|
heightTool = new GameObject("HeightTool").AddComponent<Height>();
|
||
|
areaTool = new GameObject("AreaTool").AddComponent<Area>();
|
||
|
|
||
|
var parent = this.transform;
|
||
|
lengthTool.transform.parent = parent;
|
||
|
heightTool.transform.parent = parent;
|
||
|
areaTool.transform.parent = parent;
|
||
|
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 测量长度
|
||
|
/// </summary>
|
||
|
/// <param name="value"></param>
|
||
|
public void MeasureLength(bool value)
|
||
|
{
|
||
|
lengthTool.OnMeasure(value);
|
||
|
}
|
||
|
/// <summary>
|
||
|
/// 测量高度
|
||
|
/// </summary>
|
||
|
/// <param name="value"></param>
|
||
|
public void MeasureHeight(bool value)
|
||
|
{
|
||
|
heightTool.OnMeasure(value);
|
||
|
}
|
||
|
/// <summary>
|
||
|
/// 测量面积
|
||
|
/// </summary>
|
||
|
/// <param name="value"></param>
|
||
|
public void MeasureArea(bool value)
|
||
|
{
|
||
|
areaTool.OnMeasure(value);
|
||
|
}
|
||
|
}
|