using UnityEngine;
public class NewBehaviourScript : MonoBehaviour {
// Use this for initialization
void Start () {
gameObject.AddComponent<NewBehaviourScript>();//添加组件
Renderer render = gameObject.GetComponent<Renderer>();//查找组件
render.enabled = false;//禁用组件
Destroy(render);//删除组件,欲删除,必现找到,即第二步
}
}