private void Update()
        {
            if (!UnityExplorer)
            {
                return;
            }

            if (!_isModEnabled.Value)
            {
                if (Blocked)
                {
                    GUIManager.BlockInput(false);
                    Blocked = false;
                }

                return;
            }

            if (UnityExplorer.activeSelf && !Blocked)
            {
                GUIManager.BlockInput(true);
                Blocked = true;
            }

            if (!UnityExplorer.activeSelf && Blocked)
            {
                GUIManager.BlockInput(false);
                Blocked = false;
            }
        }
Beispiel #2
0
 void Start()
 {
     r = GetComponentInChildren <Renderer>();
     r.sharedMaterial = r.material;
     GUIManager.Instance.CreateColorPicker(
         new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f),
         r.sharedMaterial.color, "Choose your poison", SetColor, ColorChosen, true);
     GUIManager.BlockInput(true);
 }
        void Start()
        {
            r = GetComponentInChildren <Renderer>();
            r.sharedMaterial = r.material;
            g = new Gradient();
            GUIManager.Instance.CreateGradientPicker(new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0, 0),
                                                     new Gradient(), "Gradiwut?", SetGradient, GradientFinished);

            GUIManager.BlockInput(true);
        }
        void Start()
        {
            // Find the first Renderer in the GameObject
            r = GetComponentInChildren <Renderer>();
            r.sharedMaterial = r.material;

            // Display the ColorPicker
            GUIManager.Instance.CreateColorPicker(
                new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f),
                r.sharedMaterial.color, // Initial selected color in the picker
                "Choose your poison",   // Caption of the picker window
                SetColor,               // Callback delegate when the color in the picker changes
                ColorChosen,            // Callback delegate when the the window is closed
                true                    // Whether or not the alpha channel should be editable
                );

            // Block input while showing the ColorPicker
            GUIManager.BlockInput(true);
        }
        void Start()
        {
            // Find the first Renderer in the GameObject
            r = GetComponentInChildren <Renderer>();
            r.sharedMaterial = r.material;

            // Create an empty gradient
            g = new Gradient();

            // Display the ColorPicker
            GUIManager.Instance.CreateGradientPicker(
                new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0, 0),
                new Gradient(),  // Initial gradient being used
                "Gradiwut?",     // Caption of the GradientPicker window
                SetGradient,     // Callback delegate when the gradient changes
                GradientFinished // Callback delegate when thw window is closed
                );

            // Block input while showing the GradientPicker
            GUIManager.BlockInput(true);
        }
 // Delegate method called by the GradientPicker on close
 public void GradientFinished(Gradient finishedGradient)
 {
     GUIManager.BlockInput(false);
 }
 // Delegate method called by the ColorPicker on close
 private void ColorChosen(Color finalColor)
 {
     GUIManager.BlockInput(false);
     Destroy(this);
 }