NotEditable.cs 433 B

12345678910111213141516171819
  1. using UnityEngine;
  2. using System.Collections;
  3. [ExecuteInEditMode]
  4. public class NotEditable : MonoBehaviour {
  5. void OnEnable()
  6. {
  7. transform.hideFlags = HideFlags.HideInInspector;
  8. hideFlags = HideFlags.HideInInspector;
  9. }
  10. void OnDrawGizmosSelected()
  11. {
  12. transform.position = Vector3.zero;
  13. transform.rotation = Quaternion.identity;
  14. transform.localScale = Vector3.one;
  15. }
  16. }