Exemple #1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        GameObject collidedObject = other.gameObject;

        if (collidedObject.CompareTag("cas1cas2"))
        {
            script = other.gameObject.GetComponentInParent <Cas1Cas2>();
            if (!(script.IsGrabbing()))
            {
                if (!script.HasTransported(type))
                {
                    script.AddTypeTransported(type);
                    script.GrabOn();
                    script.SetDNA(type);
                    StartCoroutine(ParticleEffects());
                }
            }
        }
        else if (collidedObject.CompareTag("cas9"))
        {
            if (isTutorial)
            {
                FindObjectOfType <GameController>().InitiateNextStep();
            }
            bool killMyself = collidedObject.GetComponent <Cas9>().StartDeath(type);
            if (killMyself)
            {
                Die();
            }
        }
    }
Exemple #2
0
 public void AddVirusType(int newVirus)
 {
     virusTypes[newVirus] = newVirus;
     script.AddTypeTransported(newVirus);
 }