예제 #1
0
 public void Spawn(Strain strain)
 {
     if (spawnCoolDown < 0 && hub.GetBytes() >= (int)strain)
     {
         hub.SpendBytes((int)strain);
         GameObject virus = (GameObject)Instantiate(Resources.Load("Virus" + strain.ToString()));
         virus.transform.position = gameObject.transform.position;
         spawnCoolDown            = spawnRate;
     }
 }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        if (hub != null)
        {
            switch (field)
            {
            case Field.Bytes:
                text.text = FormatSize(hub.GetBytes());
                break;

            case Field.BitRate:
                text.text = FormatRate(hub.GetBitRate());
                break;
            }
        }

        else
        {
            text.text = "0 B";
        }
    }