当前位置: 首页>>代码示例>>C#>>正文


C# EventTriggerType类代码示例

本文整理汇总了C#中EventTriggerType的典型用法代码示例。如果您正苦于以下问题:C# EventTriggerType类的具体用法?C# EventTriggerType怎么用?C# EventTriggerType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EventTriggerType类属于命名空间,在下文中一共展示了EventTriggerType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddEventTrigger

 private void AddEventTrigger(EventTrigger evTrig, UnityAction<BaseEventData> action, EventTriggerType triggerType)
 {
     EventTrigger.TriggerEvent triggerEvent = new EventTrigger.TriggerEvent();
     triggerEvent.AddListener((eventData) => action(eventData));
     EventTrigger.Entry entry = new EventTrigger.Entry() { callback = triggerEvent, eventID = triggerType };
     evTrig.triggers.Add(entry);
 }
开发者ID:James9074,项目名称:Unity-Tooltips,代码行数:7,代码来源:TooltipTrigger.cs

示例2: AddPointerEnterTrigger

 private void AddPointerEnterTrigger(EventTrigger evTrig, EventTriggerType triggerType)
 {
     EventTrigger.TriggerEvent triggerEvent = new EventTrigger.TriggerEvent();
     AddEventTrigger(evTrig, d => OnPointerEnter(d, evTrig.gameObject), EventTriggerType.PointerEnter);
     EventTrigger.Entry entry = new EventTrigger.Entry() { callback = triggerEvent, eventID = triggerType };
     evTrig.triggers.Add(entry);
 }
开发者ID:James9074,项目名称:Unity-Tooltips,代码行数:7,代码来源:TooltipTrigger.cs

示例3: AddListener

 private void AddListener(EventTriggerType type, UnityEngine.Events.UnityAction<BaseEventData> call)
 {
     EventTrigger.Entry entry = new EventTrigger.Entry();
     entry.eventID = type;
     entry.callback.AddListener(call);
     this.trigger.triggers.Add(entry);
 }
开发者ID:no1hitjam,项目名称:carrotstew,代码行数:7,代码来源:UIButtonInput.cs

示例4: AddEventTrgger

    void AddEventTrgger( UnityAction action, EventTriggerType triggerType )
    {
        EventTrigger.TriggerEvent trigger = new EventTrigger.TriggerEvent();
        trigger.AddListener( (eventData) => action());

        EventTrigger.Entry entry = new EventTrigger.Entry() { callback = trigger, eventID = triggerType };
        eventTrigger.triggers.Add(entry);
    }
开发者ID:CaaporaGames,项目名称:multiplayerGameNodeJSSocketIO,代码行数:8,代码来源:CustomButtonEvent.cs

示例5: AddEventTrigger

 private void AddEventTrigger(EventTriggerType type, UnityAction<BaseEventData> action)
 {
     EventTrigger.Entry entry;
     entry = new EventTrigger.Entry();
     entry.eventID = type;
     entry.callback.AddListener(action);
     trigger.triggers.Add(entry);
 }
开发者ID:penspanic,项目名称:Mawang,代码行数:8,代码来源:ButtonEffect.cs

示例6: AddListener

        public static void AddListener(this UIBehaviour uiBehaviour, EventTriggerType eventID, UnityAction<BaseEventData> callback)
        {
            var entry = new EventTrigger.Entry();
            entry.eventID = eventID;
            entry.callback.AddListener(callback);

            var eventTriggers = (uiBehaviour.GetComponent<EventTrigger>() ?? uiBehaviour.gameObject.AddComponent<EventTrigger>()).triggers;
            eventTriggers.Add(entry);
        }
开发者ID:setchi,项目名称:NoteEditor,代码行数:9,代码来源:UIBehaviourExtensions.cs

示例7: AddTriggerEvent

 public static void AddTriggerEvent(GameObject g, EventTriggerType type, UnityAction<BaseEventData> action)
 {
     EventTrigger trigger = g.AddComponent<EventTrigger>();
     trigger.triggers = new List<EventTrigger.Entry>();
     EventTrigger.Entry entry = new EventTrigger.Entry();
     entry.eventID = type;
     entry.callback.AddListener(action);
     trigger.triggers.Add(entry);
 }
开发者ID:Xentrics,项目名称:Praecapatus,代码行数:9,代码来源:Useful.cs

示例8: AddEventTrigger

        // ------------------ Constants and statics
        // ------------------ Events
        // ------------------ Serialized fields and properties
        // ------------------ Non-serialized fields
        // ------------------ Methods
        public static void AddEventTrigger(EventTrigger eventTrigger, UnityAction unityAction, EventTriggerType eventTriggerType)
        {
            EventTrigger.TriggerEvent triggerEvent = new EventTrigger.TriggerEvent();
            triggerEvent.AddListener((eventData) => unityAction()); // ignore event data

            EventTrigger.Entry entry = new EventTrigger.Entry() { callback = triggerEvent, eventID = eventTriggerType };

            eventTrigger.triggers.Add(entry);
        }
开发者ID:RivelloMultimediaConsulting,项目名称:EntitasCoverShooter,代码行数:14,代码来源:EventSystemUtility.cs

示例9: AddEventTrigger

    // Use listener that uses additional argument
    private void AddEventTrigger(UnityAction<Toggle> action, EventTriggerType triggerType, Toggle toggle)
    {
        // Create a nee TriggerEvent and add a listener
        EventTrigger.TriggerEvent trigger = new EventTrigger.TriggerEvent();
        trigger.AddListener((eventData) => action(toggle)); // pass additonal argument to the listener

        // Create and initialise EventTrigger.Entry using the created TriggerEvent
        EventTrigger.Entry entry = new EventTrigger.Entry() { callback = trigger, eventID = triggerType };

        // Add the EventTrigger.Entry to delegates list on the EventTrigger
        eventTrigger.delegates.Add(entry);
    }
开发者ID:Tsetso,项目名称:UnityGUIExamples,代码行数:13,代码来源:TriggerSetup.cs

示例10: AddEventTrigger

	// Use listener that uses the BaseEventData passed to the Trigger
	private void AddEventTrigger(UnityAction<BaseEventData> action, EventTriggerType triggerType)
	{
		// Create a nee TriggerEvent and add a listener
		EventTrigger.TriggerEvent trigger = new EventTrigger.TriggerEvent();
		trigger.AddListener((eventData) => action(eventData)); // capture and pass the event data to the listener
		
		// Create and initialise EventTrigger.Entry using the created TriggerEvent
		EventTrigger.Entry entry = new EventTrigger.Entry() { callback = trigger, eventID = triggerType };
		
		// Add the EventTrigger.Entry to delegates list on the EventTrigger
		eventTrigger.triggers.Add(entry);
	}
开发者ID:Rhiojin,项目名称:TheMinoMaze,代码行数:13,代码来源:moveBox.cs

示例11: AddClickToGameObject

        public static void AddClickToGameObject(GameObject gameObject, UnityAction action, EventTriggerType triggerType)
        {

            var eventTrigger = gameObject.AddComponent<EventTrigger>();
            eventTrigger.triggers = new List<EventTrigger.Entry>();
            AddEventTrigger(eventTrigger, action, triggerType);
        }
开发者ID:mengtest,项目名称:UnityRPG,代码行数:7,代码来源:UIHelper.cs

示例12: RemoveAllListeners

        public static void RemoveAllListeners(this UIBehaviour uiBehaviour, EventTriggerType eventID)
        {
            var eventTrigger = uiBehaviour.GetComponent<EventTrigger>();

            if (eventTrigger == null)
                return;

            eventTrigger.triggers.RemoveAll(listener => listener.eventID == eventID);
        }
开发者ID:setchi,项目名称:NoteEditor,代码行数:9,代码来源:UIBehaviourExtensions.cs

示例13: Trigger

			internal override void Trigger(int Direction, EventTriggerType TriggerType, TrainManager.Train Train, int CarIndex) {
				if (TriggerType == EventTriggerType.Camera) {
					if (Direction < 0) {
						BackgroundManager.TargetBackground = this.PreviousBackground;
					} else if (Direction > 0) {
						BackgroundManager.TargetBackground = this.NextBackground;
					}
				}
			}
开发者ID:leezer3,项目名称:OpenBVE,代码行数:9,代码来源:TrackManager.cs

示例14: Trigger

 override internal void Trigger(int Direction, EventTriggerType TriggerType, TrainManager.Train Train, int CarIndex) {
     if (TriggerType == EventTriggerType.Camera) {
         if (Direction < 0) {
             World.TargetBackground = this.PreviousBackground;
             World.TargetBackgroundCountdown = World.TargetBackgroundDefaultCountdown;
         } else if (Direction > 0) {
             World.TargetBackground = this.NextBackground;
             World.TargetBackgroundCountdown = World.TargetBackgroundDefaultCountdown;
         }
     }
 }
开发者ID:noidelsucre,项目名称:OpenBVE,代码行数:11,代码来源:TrackManagerR.cs

示例15: Execute

 private void Execute(EventTriggerType id, BaseEventData eventData)
 {
     if (_triggers == null)
         return;
     int index = 0;
     for (int count = _triggers.Count; index < count; ++index)
     {
         t_OnEventTrigger.Entry entry = _triggers[index];
         if (entry.EventID == id)
             entry.ActivateTrigger(eventData);
     }
 }
开发者ID:Gege00,项目名称:spacepuppy-unity-framework,代码行数:12,代码来源:t_OnEventTrigger.cs


注:本文中的EventTriggerType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。