public void OnEnable()
 {
     this.Setup();
     InputGroup.Load();
     if (!Proxy.IsPlaying())
     {
         return;
     }
     this.Validate();
     if (this.disabled)
     {
         return;
     }
     InputProfile.Load();
     InputInstance.Load();
     Console.AddKeyword("inputShowProfiles", this.ShowProfiles);
     Console.AddKeyword("inputAssignProfile", this.AssignProfile);
     Console.AddKeyword("inputCreateProfile", this.CreateProfile);
     Console.AddKeyword("inputEditProfile", this.EditProfile);
     Console.AddKeyword("inputRemoveProfile", this.RemoveProfile);
     Events.Register("On Profile Selected", this);
     Events.Register("On Profile Edited", this);
     Events.Add("On Update", this.Update);
     Events.Add("On Fixed Update", this.FixedUpdate);
     Events.Add("On GUI", this.OnGUI);
     this.DetectGamepads();
 }
Exemple #2
0
 public void Start()
 {
     Console.AddKeyword("networkDisconnect", this.Disconnect);
     Console.AddKeyword("networkConnect", this.Join);
     Console.AddKeyword("networkHost", this.Host);
     Console.AddKeyword("networkHostSimulated", this.HostSimulated);
     Console.AddKeyword("networkListen", this.Listen);
     Console.AddKeyword("networkChat", this.Chat);
     Console.AddKeyword("networkShowClients", this.ShowClients);
     Console.AddKeyword("networkShowEvents", this.ShowEvents);
     Console.AddKeyword("networkShowHistory", this.ShowHistory);
     Console.AddShortcut("networkDisconnect", "disconnect", "leave");
     Console.AddShortcut("networkConnect", "connect", "join");
     Console.AddShortcut("networkChat", "chat", "msg", "query");
     Console.AddShortcut("networkHostSimulated", "hostSimulated", "startServerSimulated");
     Console.AddShortcut("networkHost", "host", "startServer");
     Console.AddShortcut("networkListen", "listen");
     Console.AddShortcut("networkShowClients", "showClients", "clients");
     Console.AddShortcut("networkShowEvents", "showEvents", "events");
     Console.AddShortcut("networkShowHistory", "showHistory", "history");
     Console.AddShortcut("networkClientName", "clientName", "name");
     Console.AddCvar("networkServerIP", this, "serverIP", "Server IP");
     Console.AddCvar("networkServerPort", this, "serverPort", "Server Port");
     Console.AddCvar("networkClientName", this, "clientName", "Client Name");
     Networker.AddEvent("SyncData", this.SyncData);
     Networker.AddEvent("SyncClient", this.SyncClient);
     Networker.AddEvent("AddClient", this.AddClient);
     Networker.AddEvent("RemoveClient", this.RemoveClient);
 }
 public void Awake()
 {
     this.Setup();
     Console.AddShortcut("changeResolution", "res", "resolution");
     Console.AddShortcut("closeProgram", "quit");
     Console.AddShortcut("verticalSync", "vsync");
     Console.AddKeyword("hide", this.DisableGameObject, 1);
     Console.AddKeyword("show", this.EnableGameObject, 1);
     Console.AddKeyword("form", this.ToggleGameObject, 1);
     Console.AddKeyword("instance", this.InstanceGameObject, 1);
     Console.AddKeyword("destroy", this.DestroyGameObject, 1);
     Console.AddKeyword("closeProgram", this.CloseProgram);
     //Console.AddCvarMethod("changeResolution",this,"resolution","Change Resolution","",this.ChangeResolution);
     Console.AddCvar("maxfps", typeof(Application), "targetFrameRate", "Maximum FPS");
     Console.AddCvar("verticalSync", typeof(QualitySettings), "vSyncCount", "Vertical Sync");
 }
Exemple #4
0
        public void Start()
        {
            Console.AddCvarMethod("soundVolume", this, "soundVolume", "Sound Volume", this.help[0], this.SetSoundVolume);
            Console.AddCvarMethod("musicVolume", this, "musicVolume", "Music Volume", this.help[1], this.SetMusicVolume);
            Console.AddKeyword("mute", this.ToggleMute);
            foreach (AudioSource sound in FindObjectsOfType(typeof(AudioSource)))
            {
                if (sound.clip == null)
                {
                    continue;
                }
                this.sounds[sound.clip.name] = sound;
            }
            Transform musicGroup = GameObject.Find("Music").transform;

            this.listener = (AudioListener)FindObjectOfType(typeof(AudioListener));
            this.playlist = musicGroup.GetComponentsInChildren <AudioSource>(true);
        }