什么函数使unity3d里的游戏对象可以受到wasd的控制
2017-07-08
展开全部
1 using UnityEngine;
2 using System.Collections;
3 //在该脚本中进行SendMessage的测试
4 public class TestSendMessage : MonoBehaviour {
5 public GameObject goInvokeObj;
6 // Use this for initialization
7 void Start () {
8 goInvokeObj.SendMessage ("Greet","shengming",SendMessageOptions.RequireReceiver);
9 }
10
11 }
12
13
14 using UnityEngine;
15 using System.Collections;
16
17 public class GreetEnglish : MonoBehaviour {
18
19 public void Greet(string name)
20 {
21 print ("hello" + name);
22 }
23 }
24
25
26 using UnityEngine;
27 using System.Collections;
28
29 public class GreetChinese : MonoBehaviour {
30
31 public void Greet(int name)
32 {
33 print ("你好"+name);
34 }
35 }
2 using System.Collections;
3 //在该脚本中进行SendMessage的测试
4 public class TestSendMessage : MonoBehaviour {
5 public GameObject goInvokeObj;
6 // Use this for initialization
7 void Start () {
8 goInvokeObj.SendMessage ("Greet","shengming",SendMessageOptions.RequireReceiver);
9 }
10
11 }
12
13
14 using UnityEngine;
15 using System.Collections;
16
17 public class GreetEnglish : MonoBehaviour {
18
19 public void Greet(string name)
20 {
21 print ("hello" + name);
22 }
23 }
24
25
26 using UnityEngine;
27 using System.Collections;
28
29 public class GreetChinese : MonoBehaviour {
30
31 public void Greet(int name)
32 {
33 print ("你好"+name);
34 }
35 }
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询