Ejemplo n.º 1
0
        void HandleOnGateClosed(BlackHoleGate gate)
        {
            if (!fx.isPlaying)
            {
                return;
            }

            fx.Stop();
        }
Ejemplo n.º 2
0
        void HandleOnGateOpen(BlackHoleGate gate)
        {
            if (fx.isPlaying)
            {
                return;
            }

            fx.Play();
        }
Ejemplo n.º 3
0
        private void Awake()
        {
            // Set gate handles
            BlackHoleGate bhg = gateController.GetComponent <BlackHoleGate>();

            bhg.OnGateClosed += HandleOnGateClosed;
            bhg.OnGateOpen   += HandleOnGateOpen;

            // Create new material
            //mat = new Material(renderersToColorize[0].material);
            mat = new Material(material);
            // Set the new material to each renderer
            foreach (Renderer rend in renderersToColorize)
            {
                rend.sharedMaterial = mat;
            }

            Colorize();
            fx.Play();
            //CheckGate();
        }