示例#1
0
        void HandleOnGateClosed(BlackHoleGate gate)
        {
            if (!fx.isPlaying)
            {
                return;
            }

            fx.Stop();
        }
示例#2
0
        void HandleOnGateOpen(BlackHoleGate gate)
        {
            if (fx.isPlaying)
            {
                return;
            }

            fx.Play();
        }
示例#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();
        }