Version: 2020.2

描述

无法在 Inspector 中编辑该对象。

using UnityEngine;

public class Example : MonoBehaviour { // Create a plane and dont let it be modificable in the Inspector // nor in the Sceneview.

void Start() { GameObject createdGO = GameObject.CreatePrimitive(PrimitiveType.Plane); createdGO.hideFlags = HideFlags.NotEditable; } }