// ---------------- static public void ShowWizard(TouchControlPanel panel, TouchJoystickCreationWizard.BindingSetup bindingSetup = null, System.Action onCreationCallback = null) { TouchJoystickCreationWizard w = (TouchJoystickCreationWizard)EditorWindow.GetWindow(typeof(TouchJoystickCreationWizard), true, "CF2 Joystick Wizard"); if (w != null) { w.Init(panel, bindingSetup, onCreationCallback); w.ShowPopup(); } }
// ------------------ public void Init(TouchControlPanel panel, TouchJoystickCreationWizard.BindingSetup bindingSetup, System.Action onCreationCallback) { base.Init(panel, onCreationCallback); this.controlName = //(((bindingSetup != null) && !string.IsNullOrEmpty(bindingSetup.joyName)) ? ("Joystick-" + bindingSetup.joyName) : TouchControlWizardUtils.GetUniqueJoystickName(panel.rig); this.defaultControlName = this.controlName; this.dynamicMode = ControlMode.DynamicWithRegion; this.regionRect = RegionRectPreset.LeftHalf; this.hatScale = 0.75f; this.defaultSprite = TouchControlWizardUtils.GetDefaultDpadSprite(); this.hatSprite = TouchControlWizardUtils.GetDefaultAnalogJoyHatSprite(); this.baseSprite = TouchControlWizardUtils.GetDefaultAnalogJoyBaseSprite(); if (bindingSetup != null) { bindingSetup.Apply(this); } }