第一种,被调用脚本函数为static类型,调用时直接用  脚本名.函数名()

第二种,GameObject.Find("脚本所在的物体的名字").SendMessage("函数名"); //能调用public和private类型函数

第三种,GameObject.Find("脚本所在的物体的名字").GetComponent<脚本名>().函数名(); //只能调用public类型函数

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-22
  • 2022-12-23
  • 2021-05-28
  • 2021-12-28
猜你喜欢
  • 2021-06-16
  • 2022-03-02
  • 2022-12-23
  • 2022-12-23
  • 2021-06-05
  • 2021-12-01
  • 2022-12-23
相关资源
相似解决方案