Ejemplo n.º 1
0
        public virtual void OnEnable()
        {
            _window = serializedObject.FindProperty("_window");

            var t = (Trigger)target;

            _inputHandlers             = new ModuleList <ITriggerInputHandler>(t, this, "Input handler");
            _inputHandlers.description = "Add an input handler to trigger this trigger with a key press, button press, etc";
            _inputHandlers.allowMultipleImplementations = false;

            var rangeHandlerTarget = t.transform.FindChild("_RangeHandler");

            if (rangeHandlerTarget == null)
            {
                rangeHandlerTarget = t.transform;
            }

            _rangeHandlers             = new ModuleList <ITriggerRangeHandler>(rangeHandlerTarget, this, "Range handler");
            _rangeHandlers.description = "Add a range handler to override the default range behavior.";
            _rangeHandlers.allowMultipleImplementations = false;
            _rangeHandlers.hideOriginalComponents       = false;
            _rangeHandlers.addModule = AddRangeHandlerModule;

            _outOfRangeColor = new Color(Color.cyan.r, Color.cyan.g, Color.cyan.b, 0.2f);
            _inRangeColor    = new Color(Color.green.r, Color.green.g, Color.green.b, 0.3f);
        }
Ejemplo n.º 2
0
        protected void OnEnable()
        {
            var t = (UIWindow)target;

            _inputHandlers             = new ModuleList <IUIWindowInputHandler>(t, this, "Input handler");
            _inputHandlers.description = "Input handlers can be used to make the window respond to keypresses.";
            _inputHandlers.allowDuplicateImplementations = true;
        }