예제 #1
0
        public override void CopyNode(Node original)
        {
            base.CopyNode(original);
            var node = (WaitNode)original;

            GetSceneBy            = node.GetSceneBy;
            WaitFor               = node.WaitFor;
            AnyValue              = node.AnyValue;
            IgnoreUnityTimescale  = node.IgnoreUnityTimescale;
            RandomDuration        = node.RandomDuration;
            Duration              = node.Duration;
            DurationMax           = node.DurationMax;
            DurationMin           = node.DurationMin;
            SceneBuildIndex       = node.SceneBuildIndex;
            GameEvent             = node.GameEvent;
            SceneName             = node.SceneName;
            UIViewTriggerAction   = node.UIViewTriggerAction;
            ViewCategory          = node.ViewCategory;
            ViewName              = node.ViewName;
            UIButtonTriggerAction = node.UIButtonTriggerAction;
            ButtonCategory        = node.ButtonCategory;
            ButtonName            = node.ButtonName;
            UIDrawerTriggerAction = node.UIDrawerTriggerAction;
            DrawerName            = node.DrawerName;
            CustomDrawerName      = node.CustomDrawerName;
        }
예제 #2
0
        // ReSharper disable once UnusedMember.Local
        private bool BehaviorEnabled(UIButtonBehaviorType behaviorType)
        {
            switch (behaviorType)
            {
            case UIButtonBehaviorType.OnClick:        return(OnClick.Enabled);

            case UIButtonBehaviorType.OnDoubleClick:  return(OnDoubleClick.Enabled);

            case UIButtonBehaviorType.OnLongClick:    return(OnLongClick.Enabled);

            case UIButtonBehaviorType.OnPointerEnter: return(OnPointerEnter.Enabled);

            case UIButtonBehaviorType.OnPointerExit:  return(OnPointerExit.Enabled);

            case UIButtonBehaviorType.OnPointerDown:  return(OnPointerDown.Enabled);

            case UIButtonBehaviorType.OnPointerUp:    return(OnPointerUp.Enabled);

            case UIButtonBehaviorType.OnSelected:     return(OnSelected.Enabled);

            case UIButtonBehaviorType.OnDeselected:   return(OnDeselected.Enabled);

            default:                                  throw new ArgumentOutOfRangeException("behaviorType", behaviorType, null);
            }
        }
예제 #3
0
        /// <summary> Returns the default disable interval for the given UIButtonBehaviorType </summary>
        /// <param name="type"> Target UIButtonBehaviorType </param>
        public static float GetDefaultDisableInterval(UIButtonBehaviorType type)
        {
            switch (type)
            {
            case UIButtonBehaviorType.OnClick:        return(ON_CLICK_DISABLE_INTERVAL);

            case UIButtonBehaviorType.OnDoubleClick:  return(ON_DOUBLE_CLICK_DISABLE_INTERVAL);

            case UIButtonBehaviorType.OnLongClick:    return(ON_LONG_CLICK_DISABLE_INTERVAL);

            case UIButtonBehaviorType.OnPointerEnter: return(ON_POINTER_ENTER_DISABLE_INTERVAL);

            case UIButtonBehaviorType.OnPointerExit:  return(ON_POINTER_EXIT_DISABLE_INTERVAL);

            case UIButtonBehaviorType.OnPointerDown:  return(ON_POINTER_DOWN_DISABLE_INTERVAL);

            case UIButtonBehaviorType.OnPointerUp:    return(ON_POINTER_UP_DISABLE_INTERVAL);

            case UIButtonBehaviorType.OnSelected:     return(ON_BUTTON_SELECTED_DISABLE_INTERVAL);

            case UIButtonBehaviorType.OnDeselected:   return(ON_BUTTON_DESELECTED_DISABLE_INTERVAL);

            default:                                  return(0f);
            }
        }
예제 #4
0
 private void Reset()
 {
     ButtonCategory        = UIButton.DefaultButtonCategory;
     ButtonName            = UIButton.DefaultButtonName;
     ListenForAllUIButtons = false;
     TriggerAction         = UIButtonBehaviorType.OnClick;
     Event = new UIButtonEvent();
 }
예제 #5
0
 /// <summary> Sends an UIButtonMessage notifying the system that an UIButtonBehavior has been triggered </summary>
 /// <param name="behaviorType"> The UIButtonBehaviorType of the UIButtonBehavior that has been triggered </param>
 public void NotifySystemOfTriggeredBehavior(UIButtonBehaviorType behaviorType)
 {
     if (OnUIButtonAction != null)
     {
         OnUIButtonAction.Invoke(this, behaviorType);
     }
     Message.Send(new UIButtonMessage(this, behaviorType));
 }
예제 #6
0
        public override void CopyNode(Node original)
        {
            base.CopyNode(original);
            var node = (PortalNode)original;

            m_gameEvent           = node.m_gameEvent;
            ListenFor             = node.ListenFor;
            AnyValue              = node.AnyValue;
            UIViewTriggerAction   = node.UIViewTriggerAction;
            ViewCategory          = node.ViewCategory;
            ViewName              = node.ViewName;
            UIButtonTriggerAction = node.UIButtonTriggerAction;
            ButtonCategory        = node.ButtonCategory;
            ButtonName            = node.ButtonName;
            UIDrawerTriggerAction = node.UIDrawerTriggerAction;
            DrawerName            = node.DrawerName;
            CustomDrawerName      = node.CustomDrawerName;
        }
예제 #7
0
        /// <summary> Resets this instance to the default values </summary>
        /// <param name="behaviorType"> Behavior type </param>
        public void Reset(UIButtonBehaviorType behaviorType)
        {
            m_behaviorType  = behaviorType;
            Enabled         = DEFAULT_ENABLED;
            Ready           = DEFAULT_READY;
            DisableInterval = GetDefaultDisableInterval(behaviorType);
            SelectButton    = DEFAULT_SELECT_BUTTON;
            DeselectButton  = DEFAULT_DESELECT_BUTTON;

            ButtonAnimationType         = DEFAULT_BUTTON_ANIMATION_TYPE;
            LoadSelectedPresetAtRuntime = DEFAULT_LOAD_SELECTED_PRESET_AT_RUNTIME;

            PresetCategory = DefaultPresetCategory;
            PresetName     = DefaultPresetName;

            PunchAnimation = new UIAnimation(AnimationType.Punch);
            StateAnimation = new UIAnimation(AnimationType.State);
            Animators      = new List <AnimatorEvent>();

            TriggerEventsAfterAnimation = DEFAULT_TRIGGER_EVENTS_AFTER_ANIMATION;
            OnTrigger = new UIAction();
        }
예제 #8
0
        private void UIButtonEvents(UIButton button, UIButtonBehaviorType behaviourType)
        {
            switch (behaviourType)
            {
            case UIButtonBehaviorType.OnClick:
                TriggerButtonEvent(button.ButtonName);
                break;

            case UIButtonBehaviorType.OnDoubleClick:
                break;

            case UIButtonBehaviorType.OnLongClick:
                break;

            case UIButtonBehaviorType.OnPointerEnter:
                break;

            case UIButtonBehaviorType.OnPointerExit:
                break;

            case UIButtonBehaviorType.OnPointerDown:
                break;

            case UIButtonBehaviorType.OnPointerUp:
                break;

            case UIButtonBehaviorType.OnSelected:
                break;

            case UIButtonBehaviorType.OnDeselected:
                break;

            case UIButtonBehaviorType.OnRightClick:
                break;
            }
        }
예제 #9
0
 /// <summary> Initializes a new instance of the class </summary>
 /// <param name="behaviorType"> Behavior type </param>
 /// <param name="enabled"> Is the behavior enabled? </param>
 public UIButtonBehavior(UIButtonBehaviorType behaviorType, bool enabled = false)
 {
     Reset(behaviorType);
     Enabled = enabled;
 }
예제 #10
0
 /// <summary> Initializes a new instance of the class with the button name and the UIButtonBehaviorType, of the UIButtonBehavior, that triggered that sent this message </summary>
 /// <param name="buttonName"> Button name of the UIButton that sent this message </param>
 /// <param name="type"> UIButtonBehaviorType of the UIButtonBehavior that triggered the UIButton to send this message </param>
 public UIButtonMessage(string buttonName, UIButtonBehaviorType type)
 {
     ButtonName = buttonName;
     Button     = null;
     Type       = type;
 }
예제 #11
0
 /// <summary> Initializes a new instance of the class with reference to the UIButton and the UIButtonBehaviorType, of the UIButtonBehavior, that triggered this message </summary>
 /// <param name="button"> Reference to the UIButton that sent this message </param>
 /// <param name="type"> UIButtonBehaviorType of the UIButtonBehavior that triggered the UIButton to send this message </param>
 public UIButtonMessage(UIButton button, UIButtonBehaviorType type)
 {
     ButtonName = button.ButtonName;
     Button     = button;
     Type       = type;
 }