• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Trigger类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: CollisionSettings

    private void CollisionSettings(Trigger triggerObject)
    {
        using (new Vertical("box"))
        {
            GUILayout.Space(3f);
            showCollisionSettings = EditorGUILayout.Foldout(showCollisionSettings, "Collision Settings");

            GUILayout.Space(5f);

            if (showCollisionSettings)
            {
                if ((triggerObject.triggerType & Trigger.TriggerType.Collision) != 0)
                {
                    EditorGUILayout.PropertyField(impactForceThreshold, new GUIContent("Impact Force Threshold", "This is the minimum force required from a collision to trigger any fracture components this object is linked to.  Setting this to 0 would effectively make any collision trigger the fracture."));

                    EditorGUILayout.Separator();

                    EditorGUILayout.PropertyField(onlyTriggerWithTag, new GUIContent("Only Trigger With Tag", "If this checkbox is ticked, this object will only be triggered if the tag of the colliding object is the same as below."));
                    if(onlyTriggerWithTag.boolValue)
                    {
                        triggerTag.stringValue = EditorGUILayout.TagField(new GUIContent("Trigger Tag", "The desired tag to use for masking collisions by tag."), triggerTag.stringValue);
                    }
                }
                else
                {
                    using (new GUIColor(new Color(1.0f, 0.3f, 0.3f)))
                    {
                        GUILayout.Label("To use the collision settings, you must have enabled the collision trigger type.", EditorStyles.miniBoldLabel);
                    }
                }
            }
            GUILayout.Space(3f);
        }
    }
开发者ID:VRWizards,项目名称:VR-Project,代码行数:34,代码来源:TriggerEditor.cs


示例2: ActionIsTriggered

 static bool ActionIsTriggered(Trigger trigger, Settings  settings)
 {
     return 
            ((trigger == Trigger.New && settings.TrackingTriggerOnNew) ||
             ((trigger == Trigger.Update) && settings.TrackingTriggerOnUpdate) ||
             ((trigger == Trigger.Delete) && settings.TrackingTriggerOnDelete));
 }
开发者ID:DNNCommunity,项目名称:DNN.FormAndList,代码行数:7,代码来源:TrackingController.cs


示例3: On

    public override void On(Trigger trigger)
    {
        base.On(trigger);

        World = Root.Instance.SenseManager.GetLayerItem("World");
        Player = Root.Instance.SenseManager.GetLayerItem("Player");

        if (World == null)
        {
            return;
        }

        if (Player != null)
        {
            playerPos = Player.transform.position;

            if (trigger != null && trigger.Item != null)
            {
                playerPos = trigger.Item.transform.position;
            }
        }

        startTime = Time.time;
        startRotation = World.transform.rotation.eulerAngles;
        endRotation = EndRotation;
    }
开发者ID:ipre,项目名称:GGJ2016,代码行数:26,代码来源:GravitySense.cs


示例4: AddTrigger

 public static void AddTrigger(Trigger trigger)
 {
     if (triggers == null) {
         triggers = new List<Trigger>();
     }
     triggers.Add(trigger);
 }
开发者ID:shaunvxc,项目名称:Deviant,代码行数:7,代码来源:TriggerRuntime.cs


示例5: OnTrigger

 protected virtual void OnTrigger(Trigger pTrigger)
 {
     if(m_Trigger != null && (m_Trigger.gameObject == pTrigger.gameObject))
     {
         Trigger();
     }
 }
开发者ID:ysucae,项目名称:Balloune,代码行数:7,代码来源:TriggerableObject.cs


示例6: Load

        public Trigger[] Load(IDbConnection connection)
        {
            var triggers = new List<Trigger>();

            using (var command = connection.CreateCommand())
            {
                command.CommandText = "SELECT T.[object_id], T.[name], M.[definition] FROM sys.triggers T, sys.sql_modules M WHERE T.[object_id] = M.[object_id]";

                using (var reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        int objectId = reader.GetInt32(reader.GetOrdinal("object_id"));
                        string name = reader.GetString(reader.GetOrdinal("name"));
                        int definitionOrdinal = reader.GetOrdinal("definition");
                        string definition = reader.IsDBNull(definitionOrdinal) ? null : reader.GetString(definitionOrdinal);

                        var view = new Trigger(name, definition) {ObjectId = objectId};
                        triggers.Add(view);
                    }
                }
            }

            triggers.Sort((x, y) => string.CompareOrdinal(x.Name, y.Name));
            return triggers.ToArray();
        }
开发者ID:adrianbanks,项目名称:SqlDiff,代码行数:26,代码来源:TriggerLoader.cs


示例7: SetUp

		public override void SetUp()
		{
			base.SetUp();

			mockJobStore = Mocks.CreateMock<IJobStore>();
			mockJobRunner = Mocks.CreateMock<IJobRunner>();
			mockLogger = Mocks.CreateMock<ILogger>();
			mockTrigger = Mocks.PartialMock<Trigger>();
			scheduler = new DefaultScheduler(mockJobStore, mockJobRunner);

			dummyJobData = new JobData();
			dummyJobSpec = new JobSpec("foo", "bar", "key", mockTrigger);
			dummyJobDetails = new JobDetails(dummyJobSpec, DateTime.UtcNow);

			isWoken = false;

			// Ensure the scheduler is initialized.
			mockJobStore.RegisterScheduler(scheduler.Guid, scheduler.Name);
			Mocks.Replay(mockJobStore);
			scheduler.Initialize();
			Mocks.Verify(mockJobStore);
			Mocks.BackToRecord(mockJobStore);

			mockJobStore.UnregisterScheduler(scheduler.Guid);

			// Create a separate uninitialized scheduler for certain tests.
			uninitializedScheduler = new DefaultScheduler(mockJobStore, mockJobRunner);
		}
开发者ID:ralescano,项目名称:castle,代码行数:28,代码来源:DefaultSchedulerTest.cs


示例8: perform

 public override void perform(GameObject instigator, Trigger trig)
 {
     RobotController robot = parent.GetComponent<RobotController>();
     if(robot != null) {
         robot.dispose();
     }
 }
开发者ID:autarch-design-team,项目名称:OpenCircuit,代码行数:7,代码来源:RobotDestructionOperation.cs


示例9: JobScheduled

 public void JobScheduled(Trigger trigger)
 {
     foreach (ISchedulerListener l in listeners)
     {
         l.JobScheduled(trigger);
     }
 }
开发者ID:djvit-iteelabs,项目名称:Infosystem.Scraper,代码行数:7,代码来源:BroadcastSchedulerListener.cs


示例10: Start

    // Use this for initialization
    protected void Start()
    {
        Action[] actions =  gameObject.GetComponents<Action>() as Action[];
        Trigger = gameObject.GetComponent<Trigger>();
        if (Trigger == null)
        {
            Debug.Log("No Trigger found." + gameObject.name + " interaction not initilized!");
            return;
        }

        if (actions == null)
        {
            Debug.Log("No actions found." + gameObject.name + " interaction not initilized!");
            return;
        }
        foreach (Action action in actions)
        {
            if (Interactions == null)
            {
                Interactions = new List<Action>();
            }
            Interactions.Add(action);
            Debug.Log("Adding interaction: " + action.GetType());
            Trigger.OnTriggerActivated += action.OnTriggerActivated;
            Trigger.OnTriggerDeactivated += action.OnTriggerDeactivated;

        }
    }
开发者ID:Aeal,项目名称:ULib,代码行数:29,代码来源:Interaction.cs


示例11: PencilGamingWindows

        public PencilGamingWindows(int width, int height, string title, bool isFullscreen, bool shouldVsync)
        {
            onWindowOpened = new Trigger<PencilGamingWindows>();
            OnWindowOpened = onWindowOpened;

            onWindowClosed = new Trigger<PencilGamingWindows>();
            OnWindowClosed = onWindowClosed;

            onWindowResized = new Trigger<PencilGamingWindows>();
            OnWindowResized = onWindowResized;

            onKeyboard = new Trigger<PencilKeyInfo>();
            OnKeyboard = onKeyboard;

            onExit = new Trigger<PencilGamingWindows>();
            OnExit = onExit;

            window = GlfwWindowPtr.Null;
            this.width = width;
            this.height = height;
            this.title = title;
            this.isFullscreen = isFullscreen;
            this.shouldVsync = shouldVsync;
            this.firstTime = true;
            if (!Glfw.Init())
            {
                Console.Error.WriteLine("ERROR: Could not initialize GLFW, shutting down.");
                Environment.Exit(1);
            }
        }
开发者ID:prepare,项目名称:three.net,代码行数:30,代码来源:PencilGamingWindows.cs


示例12: InputComponent

        public InputComponent(Game game)
            : base(game)
        {
            InteractTrigger = new Trigger<bool>();
            ApplyTrigger = new Trigger<bool>();
            InventoryTrigger = new Trigger<bool>();
            JumpTrigger = new Trigger<bool>();
            SlotLeftTrigger = new Trigger<bool>();
            SlotRightTrigger = new Trigger<bool>();
            SlotTrigger = new Trigger<bool>[SlotTriggerLength];
            for (int i = 0; i < SlotTrigger.Length; i++)
                SlotTrigger[i] = new Trigger<bool>();

            gamepad = new GamePadInput();
            keyboard = new KeyboardInput();
            mouse = new MouseInput(game);
            screenMouse = new MouseScreenInput();
            screenKeyboard = new KeyboardScreenInput();

            screenKeyboard.OnKeyDown += (key) => { if (OnKeyDown != null) OnKeyDown(key); };
            screenKeyboard.OnKeyUp += (key) => { if (OnKeyUp != null) OnKeyUp(key); };
            screenMouse.OnLeftMouseUp += (position) => { if (OnLeftMouseUp != null) OnLeftMouseUp(position); };

            inputDevices = new List<IInputSet>{
                gamepad,
                keyboard,
                mouse
            };

            screenInputDevices = new List<IScreenInputSet>{
                screenMouse
            };
        }
开发者ID:larsduewel,项目名称:octoawesome,代码行数:33,代码来源:InputComponent.cs


示例13: On

    public override void On(Trigger trigger)
    {
        enable("hear");

        base.On(trigger);
        Debug.Log("HearSense");
    }
开发者ID:ipre,项目名称:GGJ2016,代码行数:7,代码来源:HearSense.cs


示例14: OnTrigger

 private void OnTrigger(Trigger pTrigger)
 {
     if(m_Trigger != null && (m_Trigger.gameObject == pTrigger.gameObject))
     {
         StartEmission ();
     }
 }
开发者ID:ysucae,项目名称:Balloune,代码行数:7,代码来源:TriggerableGasSource.cs


示例15: Start

    void Start()
    {
        soundStopped = true;
        trigger = GetComponent<Trigger>();

        particles = GetComponent<ParticleSystem>();
    }
开发者ID:Jalict,项目名称:MED5-PGP-P1,代码行数:7,代码来源:ChargeableButtonScript.cs


示例16: SetDefaultTriggers

 override protected void SetDefaultTriggers()
 {
     SupportedTriggers = new Trigger[3]{
         AddHiddenComponent<EventTrigger>(),
         AddHiddenComponent<TrackTrigger>(),
         AddHiddenComponent<EventTrigger>()};
 }
开发者ID:mnefzger,项目名称:Open-Games-Workshop,代码行数:7,代码来源:CameraRotation_Realsense.cs


示例17: perform

 public override void perform(GameObject instigator, Trigger trig)
 {
     Player player = parent.GetComponent<Player>();
     if(player != null && !player.frozen) {
         player.die();
     }
 }
开发者ID:autarch-design-team,项目名称:OpenCircuit,代码行数:7,代码来源:PlayerDeathOperation.cs


示例18: Off

    public override void Off(Trigger trigger)
    {
        enable("blind");
        disable("look");

        base.Off(trigger);
    }
开发者ID:SnipeOrigin,项目名称:Senseless,代码行数:7,代码来源:LookSense.cs


示例19: button2_Click

        private void button2_Click(object sender, RoutedEventArgs e)
        {
            Trigger t = new Trigger();
            t.Name = FileNameTextBox.Text;
            t.ID = IDTextBox.Text;
            t.Hash = BinaryEditor.HexStringToBytes(HashTextBox.Text);

            if (SizeLimitTextBox.Text.Trim() == "" || !Regex.IsMatch(SizeLimitTextBox.Text, "^[0-9]*$")) t.LimitSize = 0;
            else t.LimitSize = long.Parse(SizeLimitTextBox.Text);

            if (SizeLowerTextBox.Text.Trim() == "" || !Regex.IsMatch(SizeLowerTextBox.Text, "^[0-9]*$")) t.LowerSize = 0;
            else t.LowerSize = long.Parse(SizeLowerTextBox.Text);

            t.Category = new string[3] { "", "", "" };

            int i = 0;
            foreach (Match m in Regex.Matches(QueryTextBox.Text, "\"(.*?)\""))
            {
                if (i >= 3) break;
                t.Category[i] = m.Value.Trim('\"');
                i++;
            }

            t.Effect = EffectCheckBox.IsChecked == true ? true : false;
            t.Remove = TriggerDeleteCheckBox.IsChecked == true ? true : false;

            Settings.Default._triggerList.Add(t);

            this.DialogResult = true;
            this.Close();
        }
开发者ID:asapo,项目名称:Profes,代码行数:31,代码来源:TriggerSettingWindow.xaml.cs


示例20: perform

 public override void perform(GameObject instigator, Trigger trig)
 {
     LandMine mine = parent.GetComponent<LandMine>();
     if (mine != null) {
         mine.detonate();
     }
 }
开发者ID:autarch-design-team,项目名称:OpenCircuit,代码行数:7,代码来源:MineDestruction.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TriggerKey类代码示例发布时间:2022-05-24
下一篇:
C# Trie类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap