edge浏览器不支持此插件对象不支持signverify属性或方法?


JavaScript => AddComponent(className: string): Component;C# => Component AddComponent(string className);
Description 描述
Adds a component class named /className/ to the game object.
添加一个名称为className的组件到游戏对象。
Use this function to change behaviour of objects on the fly. You can also add script to game objects by passing in the name of the script class.
用这个函数改变运行中的物体的行为。你可以用传递脚本名称的方法,把程序脚本加载给游戏内物体。
Some components require other components to exist in the same game object as well. This function automatically adds any required components as well eg. if you add a HingeJoint this will
automatically add a Rigidbody as well.
有些组件也需要同一个游戏物体有其他组件。当然这个函数会自动添加那些需要的组件,比如你添加一个HingeJoint组件,这个函数会自动添加一个Rigidbody组件。
JavaScript:
// Adds the sphere collider to the game object
var sc : SphereCollider;
sc = gameObject.AddComponent ("SphereCollider");
C#:
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
public SphereCollider sc;
void Example() {
sc = gameObject.AddComponent("SphereCollider") as SphereCollider;
}
}
JavaScript => AddComponent(componentType: Type): Component;C# => Component AddComponent(Type componentType);
Description 描述
Adds a component class of type /componentType/ to the game object. C# Users can use a generic version.
给游戏物体添加一个名称为componentType的组件类。C#用户可以使用泛型版本。
JavaScript:
// Adds the sphere collider to the game object
var sc : SphereCollider;
sc = gameObject.AddComponent (SphereCollider);
C#:
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
public SphereCollider sc;
void Example() {
sc = gameObject.AddComponent<SphereCollider>();
}
}
JavaScript => AddComponent(): T;C# => T AddComponent();
Description 描述
Generic version. See the Generic Functions page for more details.
泛型版本。参见泛型函数页面了解更多信息。
GameObject

我要回帖

更多关于 edge浏览器不支持此插件 的文章

 

随机推荐