Example #1
0
        void OnDestroy()
        {
            TripleGreenShell parent = transform.root.gameObject.GetComponent <TripleGreenShell>();

            if (parent)
            {
                parent.Children.Remove(gameObject.GetComponent <GreenShell>());
            }

            if (CarCollCtl)
            {
                CarCollCtl.EnableCar(true);
            }
            if (itemMgr)
            {
                itemMgr.OnDefaultLaunch -= LaunchForward;
            }
        }
Example #2
0
        void OnTriggerEnter(Collider coll)
        {
            if (coll.gameObject.tag == "EnemyCollider")
            {
                TripleGreenShell parent = transform.root.gameObject.GetComponent <TripleGreenShell>();
                if (parent)
                {
                    parent.Children.Remove(gameObject.GetComponent <GreenShell>());
                }
                CarCollCtl = coll.gameObject.GetComponent <CarCollisionController>();
                CarCollCtl.HitItem();
                ShowParticles();
                Hide("Sphere");
                Destroy(gameObject, duration);
            }

            if (coll.gameObject.tag == "LaunchableItem")
            {
                ShowParticles();
                Destroy(coll.gameObject);
                Destroy(gameObject);
            }
        }