chenyangsocool

利用范型,动态操作组件(添加或删除)

e.AddComponent<CubeTranslate> ();//动态添加组件
Destroy (e.GetComponent<CubeTranslate> ());//动态删除组件

其中e为动态生成的对象:

public  GameObject e;

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-05-20
  • 2022-02-10
  • 2021-11-04
  • 2021-09-15
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-03-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
相关资源
相似解决方案