示例#1
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.CompareTag("Item"))
     {
         FileDescription File = other.GetComponent <FileDescription> ();
         popUp.AddDownload(File.title, File.sizeFile);
         Destroy(other.gameObject);
     }
     if (other.gameObject.CompareTag("Virus") && timeCount <= 0)
     {
         int virusType = Random.Range(0, 4);
         if (virusType == 0)
         {
             int max = Random.Range(3, 9);
             for (int i = 0; i < max; i++)
             {
                 popUp.AddAlert("Error", "ふたなり-" + i + ".dll was not found.");
             }
         }
         else if (virusType == 1)
         {
             string errors = "";
             for (int i = 0; i < 4; i++)
             {
                 errors += bigErrors[Random.Range(0, bigErrors.Length)] + System.Environment.NewLine;
             }
             popUp.AddBigError("Fatal Error", "An error occured while executing the application", errors);
         }
         else if (virusType == 2)
         {
             popUp.AddBrowser();
         }
         else
         {
             popUp.AddSys32("Confirm Folder Delete", "Are you sure you want to delete 'C:\\System32\\' and all of its content?");
         }
         timeCount = InvulnerabilityTime;
         Destroy(other.gameObject);
     }
 }