浏览代码

Record changes in objects moved by ClickToPlaceHelper (#306)

/devlogs-3-input
GitHub 4 年前
当前提交
7b5746da
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 8
      UOP1_Project/Assets/Scripts/EditorTools/ClickToPlaceHelper.cs

8
UOP1_Project/Assets/Scripts/EditorTools/ClickToPlaceHelper.cs


using UnityEngine;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
[ExecuteInEditMode]
[AddComponentMenu("UOP1/Tools/Click to Place")]

public void EndTargeting()
{
IsTargeting = false;
#if UNITY_EDITOR
Undo.RecordObject(transform, $"{gameObject.name} moved by ClickToPlaceHelper");
#endif
transform.position = _targetPosition;
}
}
正在加载...
取消
保存