Example #1
0
        private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
        {
            MainValues varPath = new MainValues();          // пути
            //This handler is called only when the common language runtime tries to bind to the assembly and fails.

            //Retrieve the list of referenced assemblies in an array of AssemblyName.
            Assembly myAssembly, objExecutingAssemblies;

            //string strTempAssmbPath = Environment.CurrentDirectory + "\\launcher\\SevenZipSharp.dll";
            string strTempAssmbPath = null;

            objExecutingAssemblies = Assembly.GetExecutingAssembly();
            AssemblyName[] arrReferencedAssmbNames = objExecutingAssemblies.GetReferencedAssemblies();

            //Loop through the array of referenced assembly names.
            foreach (AssemblyName strAssmbName in arrReferencedAssmbNames)
            {
                //Check for the assembly names that have raised the "AssemblyResolve" event.
                if (strAssmbName.FullName.Substring(0, strAssmbName.FullName.IndexOf(",")) == args.Name.Substring(0, args.Name.IndexOf(",")))
                {
                    //Build the path of the assembly from where it has to be loaded.
                    strTempAssmbPath = varPath.Launcherfolder + @"SevenZipSharp.dll";
                    break;
                }
            }
            //Load the assembly from the specified path.
            //MessageBox.Show(strTempAssmbPath);
            myAssembly = Assembly.LoadFrom(strTempAssmbPath);

            //Return the loaded assembly.
            return(myAssembly);
        }
 IEnumerator RunTime()
 {
     month = 0;
     year  = 0;
     while (true)
     {
         if (running)
         {
             for (int i = 0; i < 50 * secondsPerMonth; i++)
             {
                 yield return(new WaitForFixedUpdate());
             }
             month++;
             if (month == 12)
             {
                 month = 0;
                 year += 1;
                 MainValues.Year();
             }
             MainValues.Month();
             TextUpdate();
             EndData.month = months[month];
             EndData.year  = year;
         }
         else
         {
             yield return(new WaitForFixedUpdate());
         }
     }
 }
Example #3
0
        static void Main()
        {
            MainValues varPath = new MainValues();          // пути

            AppDomain.CurrentDomain.AppendPrivatePath(varPath.Launcherfolder + @"SevenZipSharp.dll");
            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); // попытка вшить длл-ку в лаунчер

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Main());
        }
Example #4
0
 // Update is called once per frame
 void FixedUpdate()
 {
     if (MainValues.outside_agitation == 1.0f)
     {
         SceneManager.LoadScene("ForeignFail");
     }
     if (MainValues.GetCitizenPercent() == 0.0f)
     {
         SceneManager.LoadScene("CitizenFail");
     }
     if (MainValues.GetGovernmentPercent() == 0.0f)
     {
         SceneManager.LoadScene("GovFail");
     }
 }
Example #5
0
    void FixedUpdate()
    {
        main_text.text = GlobalText.text;

        money_text.text = "$" + GlobalText.GetNiceMoney(MainValues.money);

        if (!MainValues.onRightSide)
        {
            citizen_text.text  = "Citizens\n";
            citizen_text.text += "Wealth: $" + GlobalText.GetNiceMoney(MainValues.citizen_wealth) + "\n";
            citizen_text.text += "Happiness: " + GlobalText.GetNicePercent(MainValues.GetCitizenPercent()) + "%\n";
            citizen_text.text += "Smarts: " + Mathf.Round(MainValues.citizen_smarts);
        }

        if (MainValues.onRightSide)
        {
            gov_text.text  = "Government\n";
            gov_text.text += "Wealth: $" + GlobalText.GetNiceMoney(MainValues.government_wealth) + "\n";
            gov_text.text += "Happiness: " + GlobalText.GetNicePercent(MainValues.GetGovernmentPercent()) + "%\n";
            gov_text.text += "Foreign Threat: ";
            gov_text.text += GlobalText.GetNicePercent(MainValues.GetOutsideAgitation()) + "%";
        }
    }