private void Awake() { Instance = this; touchSphere = GameObject.Find("touchSphere");//找到碰撞球 touchSphere.SetActive(false); // offset = 3.1f; }
public override void doSomething() { // player.transform.position; string[] commondArray = command.Split(':'); if (commondArray.Length > 1) { Debug.Log(commondArray[1]); } switch (code) { case 0: //初始化移动位置 switch (commondArray[0]) { case Command.moveLeft: dir -= new Vector3(2, 0, 0); break; case Command.mvoeRight: Debug.Log("123333333333333333"); dir -= new Vector3(-2, 0, 0); break; case Command.moveFront: dir -= new Vector3(0, 0, -2); break; case Command.moveBack: dir -= new Vector3(0, 0, 2); break; case Command.touch: SkillReleaseManager.Instance.touch(player); Debug.Log("执行touch事件!"); break; case Command.fireball: SkillReleaseManager.shootFireball(LocalPlayer.player.gameObject, commondArray[1].Trim()); Debug.Log("执行fireball事件!"); break; default: break; } code++; break; case 1: dir = Vector3.Normalize(dir); player.transform.position += dir * Time.deltaTime * 10; distance = Vector3.Distance(initPosition, player.transform.position); if (distance > 2) { code++; } break; case 2: this.sponsor.strategy = null; break; } // LocalMoveManager.Instance.strategy = null; }