Пример #1
0
    void spawnDNR()
    {
        Vector3 spawnLocation = new Vector3(transform.localPosition.x - 15, transform.localPosition.y + 70, transform.localPosition.z + 1);

        readyToShoot = Instantiate(dnr, spawnLocation, Quaternion.identity).GetComponent <DNRSphereScript>();
        readyToShoot.speedMultiplier = 3f;
        readyToShoot.direction       = "";
    }
    void OnTriggerEnter2D(Collider2D col)
    {
        DNRSphereScript     dnrHitter = col.gameObject.GetComponent <DNRSphereScript>();
        RadiationBoltScript bolt      = col.gameObject.GetComponent <RadiationBoltScript>();

        if (dnrHitter != null && dnrHitter.direction == "N")
        {
            globalState.skipDNRSpawn = true;
            globalState.pauseTime    = true;
            dnrHitter.direction      = "E";
            Vector3 spawnLocation = new Vector3(transform.localPosition.x - 61.98f, transform.localPosition.y, transform.localPosition.z - 0.5f);
            dnrHitter.gameObject.transform.SetPositionAndRotation(spawnLocation, Quaternion.identity);
            globalState.addedDNRx     = dnrHitter.gameObject.transform.localPosition.x - 0.005f;
            dnrHitter.speedMultiplier = 1f;
        }
        if (bolt != null)
        {
            onDeath();
            Destroy(bolt.gameObject);
        }
    }