Esempio n. 1
0
    void AsteroidHitByBullet(GameObject otherGO)
    {
        Destroy(otherGO);
        Destroy(gameObject);
        PlayerShip.S.bullets += 2;
        AsteraX.score        += 10;

        try
        {
            throw new System.NullReferenceException("Parameter cannot be null");
        }
        catch (System.NullReferenceException nre)
        {
            AsteraX.GetBacktraceClient().Send(nre);
        }
    }
Esempio n. 2
0
    public void OnCollisionEnter(Collision coll)
    {
        if (immune)
        {
            return;
        }

        GameObject otherGO = coll.gameObject;

        if (otherGO.tag == "Bullet")
        {
            AsteroidHitByBullet(otherGO);
        }
        else if (otherGO.tag == "Player")
        {
            Destroy(gameObject);
            PlayerShip.S.health -= 5;

            AsteraX.GetBacktraceClient()["shipHealth"] = "" + PlayerShip.S.health;

            if (PlayerShip.S.health <= 90)
            {
#if (!UNITY_EDITOR)
                CrashOnAndroid();
                // this crashes the entire game
                Utils.ForceCrash(ForcedCrashCategory.AccessViolation);
#endif
            }

            if (PlayerShip.S.health <= 0)
            {
                Destroy(otherGO);

                AsteraX.backtraceClient.Breadcrumbs.Info("Player Died!", new Dictionary <string, string>()
                {
                    { "application.version", AsteraX.backtraceClient["application.version"] },
                });
            }
        }
        else if (otherGO.tag == "Asteroid")
        {
            //Destroy(otherGO);
            //Destroy(gameObject);
        }
    }