protected override void OnEnable()
        {
            base.OnEnable();

            instance        = target as TuioInput;
            supportedInputs = serializedObject.FindProperty("supportedInputs");
            tuioPort        = serializedObject.FindProperty("tuioPort");
        }
Example #2
0
 protected override void Start()
 {
     base.Start();
     Input            = this;
     mBaseInputModule = GetComponent <BaseInputModule>();
     mBaseInputModule.inputOverride = this;
     mTuioInput  = GetComponent <TuioInput>();
     mMouseInput = GetComponent <MouseInput>();
     mWMInput    = GetComponent <WM_Input>();
 }
Example #3
0
        protected override void OnEnable()
        {
            base.OnEnable();

            instance           = target as TuioInput;
            supportedInputs    = serializedObject.FindProperty("supportedInputs");
            tuioObjectMappings = serializedObject.FindProperty("tuioObjectMappings");
            cursorTags         = serializedObject.FindProperty("cursorTags");
            blobTags           = serializedObject.FindProperty("blobTags");
            objectTags         = serializedObject.FindProperty("objectTags");
            tuioPort           = serializedObject.FindProperty("tuioPort");

            list = new ReorderableList(serializedObject, tuioObjectMappings, false, true, true, true);
            list.drawHeaderCallback  += rect => GUI.Label(rect, OBJECT_MAPPINGS);
            list.drawElementCallback += (rect, index, active, focused) =>
            {
                EditorGUI.BeginChangeCheck();
                var element = instance.TuioObjectMappings[index];
                rect.height = 16;
                rect.y     += 2;
                var r = rect;
                r.width = 20;
                GUI.Label(r, "id:");
                r.x    += r.width;
                r.width = 50;
                var newId = EditorGUI.IntField(r, element.Id);
                r.x    += r.width;
                r.width = 40;
                GUI.Label(r, "  tag:");
                r.x    += r.width;
                r.width = rect.width - r.x + rect.x;
                var newTag = GUI.TextField(r, element.Tag);

                if (EditorGUI.EndChangeCheck())
                {
                    element.Id  = newId;
                    element.Tag = newTag;
                    EditorUtility.SetDirty(target);
                }
            };
        }