Ejemplo n.º 1
0
 new protected void Start()
 {
     this.initialInvic = true;
     base.Start();
     this.animator.SetInteger("Invincibility", 1);
     Prov_Agent();
     this.spawnManager = GameObject.Find("SpawnManager").GetComponent <Managers_Spawn>();
     this.scoreManager = GameObject.Find("ScoreManager").GetComponent <ScoreManager>();
     if (GameObject.FindGameObjectWithTag("Player") != null)
     {
         this.player = GameObject.FindGameObjectWithTag("Player").GetComponent <Characters_Player>();
     }
 }
Ejemplo n.º 2
0
    private IEnumerator MakeChanges(string args, int finalCount)
    {
        file        = PlayerPrefs.GetString(AcessPython.KEYFILEXML);
        run         = true;
        instruction = ("Start MakeChanges: " + file);
        string pyInstruction = "";

        do
        {
            if (!File.Exists(file))
            {
                instruction = (Application.dataPath + " xml dont exists: " + file);
            }
            else
            {
#if UNITY_EDITOR
                var watch = System.Diagnostics.Stopwatch.StartNew();
                // the code that you want to measure comes here
#endif
                pyInstruction = GetInstruction(Directory.GetCurrentDirectory() + filePy, "do " + file + " " + args, PlayerPrefs.GetString(AcessPython.KEYPATHPYTHON));
#if UNITY_EDITOR
                watch.Stop();
                var elapsedMs = watch.ElapsedMilliseconds;
                //print("Time to get Instruction: " + (elapsedMs));

                string nameFile  = "LogTime.txt";
                bool   firstTime = false;
                if (!File.Exists(nameFile))
                {
                    firstTime = true;
                }
                TextWriter tw = new StreamWriter(Directory.GetCurrentDirectory() + @"\" + nameFile, true);
                if (firstTime)
                {
                    tw.WriteLine("Date; Elapsed Milliseconds; Final Count;");
                }
                tw.WriteLine(Characters_Player.GetDate() + ";" + elapsedMs + ";" + finalCount);

                tw.Close();
#endif
                instruction = ("Result: " + pyInstruction);
                if (file == PlayerPrefs.GetString(AcessPython.KEYFILEXML))
                {
                    run = false;
                }
                else
                {
                    file = PlayerPrefs.GetString(AcessPython.KEYFILEXML);
                }
            }
            yield return(new WaitForFixedUpdate());
        } while (run);
        instruction += ("Over MakeChanges");

        FindChanges(pyInstruction);

        //print("File = " + file);
        //print("PlayerPrefs = " + PlayerPrefs.GetString(AcessPython.KEYFILEXML));
        //print("________");
        run = false;
    }