Beispiel #1
0
        protected override void Start()
        {
            base.Start();
            transform.position = new Vector3(0, 0, 0);
            InternalObjectUtils.CheckObjects();

            LogUtils.Log("Initializing World...");
            gameObject.AddComponent <PlayerModelControllerNetwork>();
            gameObject.AddComponent <InteractManager>();
            gameObject.AddComponent <SpawnManager>();
            gameObject.AddComponent <VehicleManager>();
            var mgr = gameObject.AddComponent <NetvarManager>();

            mgr.RegisterNetvar(new GravityNetvar());
            mgr.RegisterNetvar(new GameSpeedNetvar());
            if (IsServer())
            {
                gameObject.AddComponent <CommandManager>();
            }
            gameObject.AddComponent <Scheduler>();

            PluginManager.Init(IOUtil.GetPluginsDir());
            UMAModelController.Init();

            Connection conn = FindObjectOfType <Connection>();
            var        chat = gameObject.AddComponent <Chat>();

            Chat.SetInstance(chat);
            conn.SendMessage("OnChatInit", chat);

            if (Connection.IsClient() && !Connection.IsSinglePlayer)
            {
                _commandsObj = new ClientConsoleCommands();
            }
            else if (Connection.IsServer())
            {
                _commandsObj = new ServerConsoleCommands();
            }

            if (_commandsObj != null)
            {
                Console.Instance.RegisterCommands(_commandsObj);
            }
            Loaded = true;
            conn.SendMessage("OnWorldInit", this, SendMessageOptions.DontRequireReceiver);

            LoadPlugins();

            if (IsDedicatedServer())
            {
                LoadWeather();
            }
        }
Beispiel #2
0
        public void UMATest(Player p)
        {
            UMAModelController cont = (UMAModelController)PlayerModelController.GetPlayerModelController("UMA");

            cont.Apply(p);
        }