Пример #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();
            }
        }
    }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        script = myCas.GetComponent <Cas1Cas2>();
        int numTrans = 0;

        foreach (Transform child in transform)
        {
            spacers[numTrans] = child;
            numTrans         += 1;
        }
    }
Пример #3
0
 void OnTriggerEnter2D(Collider2D col)
 {
     if (col.gameObject.CompareTag("cas1cas2"))
     {
         Debug.Log("cas12 in killzone");
         myCas12 = col.gameObject.GetComponentInParent <Cas1Cas2>();
         myCas12.MarkForDeath();
         myCas12.callSpecialDie();
     }
     else if (col.gameObject.CompareTag("cas9"))
     {
         myCas9 = col.gameObject.GetComponent <Cas9>();
         myCas9.Death();
     }
 }
Пример #4
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        GameObject other = collision.gameObject;

        if (other.CompareTag("cas1cas2"))
        {
            script = other.gameObject.GetComponentInParent <Cas1Cas2>();
            Debug.Log(script.ReturnDNA());
            if (script.IsMarked())
            {
                return;
            }
            else if (script.IsGrabbing())
            {
                if (holder.InVirusTypes(script.ReturnDNA()))
                {
                    return;
                }
                else
                {
                    GameObject.Find("SFXController").GetComponent <AudioButtonController>().Play("HighClick");
                    if (script.isItTutorial())
                    {
                        FindObjectOfType <GameController>().InitiateNextStep();
                    }
                    Types.DNA casType = Types.GetDNA(script.ReturnDNA());
                    heldDNA = script.ReturnDNA();
                    Debug.Log(casType);
                    slot.DNAType(casType);
                    if (dnaType != 0)
                    {
                        holder.RemoveVirusType(dnaType);
                    }
                    holder.AddVirusType(script.ReturnDNA());
                    dnaType = script.ReturnDNA();
                    Debug.Log(Types.GetColor(script.ReturnDNA()));
                    sr.color = Types.GetColor(script.ReturnDNA());
                    script.MarkForDeath();
                    script.Death();
                }
            }
        }
    }
Пример #5
0
 // Use this for initialization
 void Start()
 {
     script = myCas.GetComponent <Cas1Cas2>();
     int numTrans = 0;
 }