// Start is called before the first frame update private void Start() { if (!hasAuthority) { Destroy(gameObject.transform.Find("Minimap")); gameObject.tag = "OtherPlayer"; DestroyImmediate(this); return; } for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { WorldGenerator.generator.GenerateChunkAt(x, 0f, z); WorldGenerator.GetChunkAt(x, 0f, z).RenderChunk(true); } } GameObject[] spawnPoints = GameObject.FindGameObjectsWithTag("SpawnPoint"); int chosen = Random.Range(0, spawnPoints.Length); Vector3 spawn = spawnPoints[chosen].transform.position; gameObject.transform.position = spawn; Init(); gameObject.AddComponent <Raycast>(); WoWCamera camera = Camera.main.gameObject.AddComponent <WoWCamera>(); camera.target = transform; SetupChat(); GetComponent <Chat>().chatText.text = string.Empty; GetComponent <Chat>().Send($"<b>{GetComponent<Chat>().username} joined the game!", "#FFFF00"); }
public static void Start(object sender, EventArgs e) { Stopwatch sw = Stopwatch.StartNew(); Direct3D.RegisterCallbacks( ObjectManager = new ObjectManager(), ExecutionQueue = new EndSceneExecute(), Movement = new Movement(), Events = new WoWEvents(), Spellbook = new SpellCollection(), Scripts = new ScriptManager() ); Helper.Initialize(); Helper.FixInvalidPtrCheck(); DBC = new WoWDB(); Quests = new QuestCollection(); Inventory = new WoWInventory(); Camera = new WoWCamera(); Console = new WoWConsole(); ClientServices = new WoWClientServices(); sw.Stop(); Log.WriteLine(LogType.Good, "Initialization took {0} ms", sw.ElapsedMilliseconds); }