void Start() { GameObject.DontDestroyOnLoad(gameObject); Debug.Log("Register Entity Type Account ..."); GoWorld.RegisterEntity(typeof(Account)); Debug.Log("Register Entity Type Player ..."); GoWorld.RegisterEntity(typeof(Player)); Debug.Log("Register Entity Type Monsters ..."); GoWorld.RegisterEntity(typeof(Monster)); Debug.Log("Connecting Serer ..."); // GoWorldUnity3D.GoWorld.Connect("ec2-13-229-128-242.ap-southeast-1.compute.amazonaws.com", 15011); GoWorldUnity3D.GoWorld.Connect("122.112.252.25", 15001); // 国内服务区 }
public void DisplayAttack(string playerID) { ClientEntity player = GoWorld.GetEntity(playerID); //Debug.LogWarning (this.ToString () + " attack " + playerID + " " + player.ToString()); Vector3 startPos = this.gameObject.transform.position; Vector3 endPos = player.gameObject.transform.position; startPos.y = 0.5f; endPos.y = 0.5f; lineRenderer.SetPosition(0, startPos); lineRenderer.SetPosition(1, endPos); lineRenderer.enabled = true; attackTime = Time.time; }
static void Main(string[] args) { GoWorld.RegisterEntity(typeof(Account)); GoWorld.RegisterEntity(typeof(Player)); GoWorld.RegisterEntity(typeof(Monster)); GoWorld.Connect("127.0.0.1", 14001); Debug(GoWorldUnity3D.GoWorld.GameClient + " created."); while (true) { GoWorldUnity3D.GoWorld.Tick(); Thread.Sleep(100); } }
static void Main(string[] args) { GoWorld.RegisterEntity(new UnityEngine.GameObject("Account", typeof(Account))); GoWorld.RegisterEntity(new UnityEngine.GameObject("Player", typeof(Player))); GoWorld.RegisterEntity(new UnityEngine.GameObject("Monster", typeof(Monster))); GoWorld.Connect("ec2-13-229-128-242.ap-southeast-1.compute.amazonaws.com", 15011); Console.WriteLine(GoWorldUnity3D.GoWorld.GameClient + " created."); while (true) { GoWorldUnity3D.GoWorld.Update(); Thread.Sleep(100); } }