예제 #1
0
    void OnCollisionEnter(Collision col)
    {
        if (col.gameObject.name == "Wall")
        {
            Destroy (gameObject);

        }
        else if (col.gameObject.name == "BlueVirus"){
            bVirus = col.gameObject.GetComponent<BlueVirus>();
            bVirus.takeDamage (1,1);
            Destroy (gameObject);
        }
        else if (col.gameObject.name == "RedVirus"){
            Destroy (gameObject);
        }
        else if (col.gameObject.name == "GreenVirus"){
            gVirus = col.gameObject.GetComponent<GreenVirus>();
            gVirus.takeDamage (1,1);
            Destroy (gameObject);
        }else if(col.gameObject.name == "Boss"){
            boss = col.gameObject.GetComponent<BossScript>();
            boss.takeDamage(1, 1);
            Destroy(gameObject);
        }
    }
예제 #2
0
파일: Doctor.cs 프로젝트: TStream/MiniPhD
 void OnCollisionEnter(Collision col)
 {
     if(col.gameObject.name == "BlueVirus")
     {
         bVirus = col.gameObject.GetComponent<BlueVirus>();
         if(bVirus.alive == true)
             stunned = true;
     }else if(col.gameObject.name == "GreenVirus")
     {
         gVirus = col.gameObject.GetComponent<GreenVirus>();
         if(gVirus.alive == true)
             stunned = true;
     }else if(col.gameObject.name == "RedVirus")
     {
         rVirus = col.gameObject.GetComponent<RedVirus>();
         if(rVirus.alive == true)
             stunned = true;
     }else if(col.gameObject.name == "Boss")
     {
         boss = col.gameObject.GetComponent<BossScript>();
         if(boss.alive == true)
             stunned = true;
     }
 }