Cloth.enabled 启用?


var enabled : bool

Description描述

Is this cloth enabled?

是否启用这个布料?

This is the same as the checkbox next to the   component label in the inspector. A disabled cloth component will not update   it's physics simulation, so you can use this to suspend the simulation of cloth   objects when they are not needed, as cloth simulation is a very CPU-intensive   task.

这如同Component旁的复选框一样。一个使布料组件不更新的属性,所以你可以在不需要的时候用这个终止;布料模拟是一个非常耗资源的任务。

  • C#

  • JavaScript

using UnityEngine;using System.Collections;public class example : MonoBehaviour {public void Awake() {GetComponent<InteractiveCloth>().enabled = false;}}
GetComponent(InteractiveCloth).enabled = false; 


,