// Use this for initialization
	void Start () {
		console = GameObject.Find ("Console");
		dev = GetComponent<DevOptions> ();
		var repo = ConsoleCommandsRepository.Instance;
		repo.RegisterCommand ("debug", DebugOn);
		repo.RegisterCommand ("exit", Exit);
		repo.RegisterCommand ("fly", Fly);
		repo.RegisterCommand("help", Help);
		repo.RegisterCommand("load", Load);
		repo.RegisterCommand ("noclip", noClip);
	}
Beispiel #2
0
        public void UpdateWebConfig(DevOptions options)
        {
            //var config = webConfig;
            foreach (var item in options)
            {
                switch (item.Area)
                {
                case "AppSettings":
                    try
                    {
                        if (webConfig.AppSettings.Settings.AllKeys.Contains(item.Name))
                        {
                            webConfig.AppSettings.Settings[item.Name].Value = item.Value;
                        }
                        else
                        {
                            webConfig.AppSettings.Settings.Add(item.Name, item.Value);
                        }
                    }
                    catch (Exception ex)
                    {
                        System.Diagnostics.Debug.WriteLine(ex.Message);
                    }
                    break;

                case "compilation":
                    var element = (System.Web.Configuration.SystemWebSectionGroup)webConfig.GetSectionGroup("system.web");    //.ElementInformation("compilation");
                    var comp    = element.Compilation;
                    comp.GetType().GetProperty(item.Name).SetValue(comp, Utils.MyConvert(item.Type, item.Value));
                    break;

                default:
                    break;
                }
            }
            webConfig.Save();
        }
 // Use this for initialization
 void Start()
 {
     console = GameObject.Find ("Console");
     dev = console.GetComponent<DevOptions>();
     resourceData = resourceValues.GetComponent<ResourceData> ();
     troopData = troopNumbers.GetComponent<TroopData> ();
     windowManager = window.GetComponent<WindowManager> ();
     var repo = ConsoleCommandsRepository.Instance;
     repo.RegisterCommand ("changetroops", ChangeTroops);
     repo.RegisterCommand ("closewindow", CloseWindow);
     repo.RegisterCommand ("debug", DebugOn);
     repo.RegisterCommand ("exit", Exit);
     repo.RegisterCommand ("foodrate", FoodRate);
     repo.RegisterCommand("help", Help);
     repo.RegisterCommand("load", Load);
     repo.RegisterCommand ("metalrate", MetalRate);
     repo.RegisterCommand ("openwindow", OpenWindow);
     repo.RegisterCommand ("stonerate", StoneRate);
     repo.RegisterCommand ("woodrate", WoodRate);
 }