// -------------------- override protected void OnCreatePressed(bool selectAfterwards) { SuperTouchZone newObj = (SuperTouchZone)this.CreateNonDynamicTouchControl(typeof(SuperTouchZone)); newObj.maxFingers = 1; for (int i = 0; i < this.fingerBinding.Length; ++i) { if (this.fingerBinding[i].gestureBinding.enabled) // || this.fingerBinding[i].swipeJoyBinding.enabled) { newObj.maxFingers = i + 1; } this.fingerBinding[i].CopyTo(newObj.multiFingerConfigs[i]); } if (this.createSpriteAnimator) { TouchControlWizardUtils.CreateSuperTouchZoneAnimator(newObj, "-Sprite", this.defaultSprite, 1.0f); } Undo.RegisterCreatedObjectUndo(newObj.gameObject, "Create CF2 SuperTouchZone"); if (selectAfterwards) { Selection.activeObject = newObj; } }
// ------------------ void OnGUI() { if (CF2Input.activeRig == null) { return; } List <TouchControl> cList = CF2Input.activeRig.GetTouchControls(); for (int i = 0; i < cList.Count; ++i) { SuperTouchZone c = cList[i] as SuperTouchZone; if (c != null) { c.DrawMarkerGUI(); } } }