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

C# Interaction类代码示例

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

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



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

示例1: Start

 void Start()
 {
     player = this.gameObject;
     playerCamera = GameObject.FindGameObjectWithTag(Tags.camera);
     playerRigidbody = GetComponent<Rigidbody>();
     playerInteraction = GetComponent<Interaction>();
 }
开发者ID:lucasrumney94,项目名称:JDPolterGhost,代码行数:7,代码来源:PlayerMovement.cs


示例2: ShouldReturnStrictMockOfCorrectType

        public void ShouldReturnStrictMockOfCorrectType()
        {
            Interaction i = new Interaction();
            object mock = i.CreateStrictMock<StrictMockSpec>();

            Specify.That(mock.GetType().FullName).ShouldEqual("NBehave.Spec.Framework.Specification.Mocks.__Proxy__StrictMockSpec");
        }
开发者ID:AngelPortal,项目名称:NBehave,代码行数:7,代码来源:StrictMockSpec.cs


示例3: HandledInteractionsShouldNotCauseException

        public void HandledInteractionsShouldNotCauseException()
        {
            var interaction = new Interaction<Unit, bool>();
            interaction.RegisterHandler(c => c.SetOutput(true));

            interaction.Handle(Unit.Default).FirstAsync().Wait();
        }
开发者ID:reactiveui,项目名称:ReactiveUI,代码行数:7,代码来源:InteractionsTest.cs


示例4: ShouldCreateStrictInstanceOfInterfaceWithDefaultCtor

        public void ShouldCreateStrictInstanceOfInterfaceWithDefaultCtor()
        {
            Interaction i = new Interaction();
            IMockable fooMock = i.CreateStrictMock<IMockable>();

            Specify.That(fooMock).ShouldNotBeNull();
        }
开发者ID:AngelPortal,项目名称:NBehave,代码行数:7,代码来源:StrictMockSpec.cs


示例5: ChangeState

 public void ChangeState(Interaction.interactionType type, bool b)
 {
     //Debug.Log(tag);
     switch (tag)
     {
         case "Openable":
             StartCoroutine(Open(b));
             break;
         case "Lightable":
             StartCoroutine(Light(b));
             break;
         case "InteractableWater":
             StartCoroutine(Water(b));
             break;
         case "InteractableRock":
             StartCoroutine(Rock(b));
             break;
         case "DeadTree":
             if(type == Interaction.interactionType.LEAVES)
             {
                 StartCoroutine(Leaves(b));
             }
             else
             {
                 StartCoroutine(Flower(b));
             }
             break;
     }
 }
开发者ID:Miformat,项目名称:GlobalGameJam-V2.0,代码行数:29,代码来源:Interactable.cs


示例6: HandlersCanOptNotToHandleTheInteraction

        public void HandlersCanOptNotToHandleTheInteraction()
        {
            var interaction = new Interaction<bool, string>();

            var handler1A = interaction.RegisterHandler(x => x.SetOutput("A"));
            var handler1B = interaction.RegisterHandler(
                x => {
                    // only handle if the input is true
                    if (x.Input) {
                        x.SetOutput("B");
                    }
                });
            var handler1C = interaction.RegisterHandler(x => x.SetOutput("C"));

            using (handler1A) {
                using (handler1B) {
                    using (handler1C) {
                        Assert.Equal("C", interaction.Handle(false).FirstAsync().Wait());
                        Assert.Equal("C", interaction.Handle(true).FirstAsync().Wait());
                    }

                    Assert.Equal("A", interaction.Handle(false).FirstAsync().Wait());
                    Assert.Equal("B", interaction.Handle(true).FirstAsync().Wait());
                }

                Assert.Equal("A", interaction.Handle(false).FirstAsync().Wait());
                Assert.Equal("A", interaction.Handle(true).FirstAsync().Wait());
            }
        }
开发者ID:reactiveui,项目名称:ReactiveUI,代码行数:29,代码来源:InteractionsTest.cs


示例7: ShouldCreateStrictInstanceOfAbstractType

        public void ShouldCreateStrictInstanceOfAbstractType()
        {
            Interaction i = new Interaction();
            MockableBase fooBaseMock = i.CreateStrictMock<MockableBase>();

            Specify.That(fooBaseMock).ShouldNotBeNull();
        }
开发者ID:AngelPortal,项目名称:NBehave,代码行数:7,代码来源:StrictMockSpec.cs


示例8: Initialize

        private void Initialize(Interaction interaction)
        {
            try
            {
                // Create new session vm
                var sessionvm = new RecursiveLabsSessionViewModel(interaction);

                // Add urls to VM
                foreach (var url in RecursiveLabsButton.Urls)
                {
                    // Make sure it doesn't think it's selected
                    url.IsSelected = false;

                    // Add to list
                    sessionvm.Urls.Add(url);
                }

                // Set to data context
                DataContext = sessionvm;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                RecursiveLabsAddin.AddinTracer.Exception(ex);
            }
        }
开发者ID:InteractiveIntelligence,项目名称:RecursiveLabsIntegration,代码行数:26,代码来源:RecursiveLabsDialog.xaml.cs


示例9: TennisActor

 public TennisActor(string code, string prefab, Vector3 position, bool hidden, Interaction interaction)
     : base(position, hidden)
 {
     this.prefab = prefab;
     this.code = code;
     this.interaction = interaction;
 }
开发者ID:scify,项目名称:LeapGame-tennis,代码行数:7,代码来源:TennisActor.cs


示例10: InteractionRay

 private void InteractionRay()
 {
     RaycastHit ray;
     if (Physics.Raycast(cameraT.position, cameraT.forward, out ray, interactMaxDist, (int)Mathf.Pow(2, 8)))
     {
         Debug.DrawLine(cameraT.position, ray.point, Color.yellow, 0f, true);
         interaction = FindInteraction(ray);
         if (Input.GetButtonUp("Use"))
         {
             switch (interaction)
             {
                 case Interaction.Terminal:
                     Terminal terminal = ray.collider.GetComponent<Terminal>();
                     terminal.Use();
                     break;
                 case Interaction.Number:
                     GameFragment fragment = ray.collider.GetComponent<GameFragment>();
                     _Game.CollectNumber(fragment.Use());
                     break;
                 case Interaction.Collectable:
                     //break;
                 default:
                     break;
             }
         }
     }
     else
     {
         interaction = Interaction.None;
     }
 }
开发者ID:Tezza48,项目名称:DigitalScripting_Seeds,代码行数:31,代码来源:PlayerController.cs


示例11: Start

	// Use this for initialization
	void Start ()
    {

        playerInteraction = GameObject.FindGameObjectWithTag("Player").GetComponent<Interaction>();
        myText = this.GetComponent<Text>();

    }
开发者ID:lucasrumney94,项目名称:JDPolterGhost,代码行数:8,代码来源:getPlayerInfluence.cs


示例12: Update

    void Update()
    {
        if (interaction==null)
        {
            interaction = GameObject.Find("Player").transform.FindChild("Main Camera").GetComponent<Core>().interaction;
            if (interaction != null)
            {
                interaction.addInteractionObject(this.gameObject, delegate()
                {
                    OnMouseDown();
                }, delegate()
                {
                    gameObject.renderer.material = iluminated;
                }, delegate()
                {
                    gameObject.renderer.material = normal;
                });
            }
        }

        play = Mathf.PingPong(Time.time, 3);
        if (play > 2.9)
        {
            particle.emit = true	;
        }
        else
        {
            particle.emit = false;
        }
    }
开发者ID:henkjanBonke,项目名称:Project-3D-client,代码行数:30,代码来源:ClickableObjectScript.cs


示例13: Start

    //    GameObject interactionObject;
    //    private Component interaction;
    // Use this for initialization
    void Start()
    {
        interaction = GameObject.Find ("Root").GetComponent <Interaction> ();

        // Call script to apply settings that depend on platform (eg touch vs mouse)
        if (!applyPlatformSettings ())
            interaction.debugMessage ("Platform settings failed", 3.0f);
    }
开发者ID:jaspermittelmeijer,项目名称:vr,代码行数:11,代码来源:Settings.cs


示例14: UnhandledInteractionsShouldCauseException

        public void UnhandledInteractionsShouldCauseException()
        {
            var interaction = new Interaction<string, Unit>();
            Assert.Throws<UnhandledInteractionException<string, Unit>>(() => interaction.Handle("foo").FirstAsync().Wait());

            interaction.RegisterHandler(_ => { });
            interaction.RegisterHandler(_ => { });
            Assert.Throws<UnhandledInteractionException<string, Unit>>(() => interaction.Handle("foo").FirstAsync().Wait());
        }
开发者ID:reactiveui,项目名称:ReactiveUI,代码行数:9,代码来源:InteractionsTest.cs


示例15: ShouldReturnStrictMockWhenSupplyingCtorArgs

        public void ShouldReturnStrictMockWhenSupplyingCtorArgs()
        {
            Interaction i = new Interaction();
            StrictMockSpec mock = i.CreateStrictMock<StrictMockSpec>(5, "Test");

            Specify.That(mock.i).ShouldEqual(5);
            Specify.That(mock.s).ShouldEqual("Test");
            Specify.That(mock.GetType().FullName).ShouldEqual("NBehave.Spec.Framework.Specification.Mocks.__Proxy__StrictMockSpec");
        }
开发者ID:AngelPortal,项目名称:NBehave,代码行数:9,代码来源:StrictMockSpec.cs


示例16: Start

 void Start()
 {
     Cursor.lockState = CursorLockMode.Locked;
     Cursor.visible = false;
     player = GameObject.FindGameObjectWithTag(Tags.player);
     playerCamera = GameObject.FindGameObjectWithTag(Tags.camera).GetComponent<PlayerCamera>();
     playerMovement = player.GetComponent<PlayerMovement>();
     playerInteraction = player.GetComponent<Interaction>();
 }
开发者ID:lucasrumney94,项目名称:JDPolterGhost,代码行数:9,代码来源:InputManager.cs


示例17: LoopDel

        public new void LoopDel(StateMachineClient smc, Interaction<Sim, Computer>.LoopData loopData)
        {
            Journalism job = OmniCareer.Career<Journalism>(Actor.Occupation);

            Definition def = InteractionDefinition as Definition;
            if (job.UpdateReview(def.Review))
            {
                Actor.AddExitReason(ExitReason.Finished);
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:10,代码来源:WriteRabbitHoleReviewEx.cs


示例18: Start

	//Unity Callbacks
	void Start()
	{
		AddObserver(GameManager.Instance);
		m_Statistics = new ActorStatistics(gameObject.GetComponent<Actor>());
		if (m_HUD != null)
		{
			m_HUD.InitializeBars();
		}
		m_Interaction = GetComponentInChildren<Interaction>();
	}
开发者ID:WEASEL4994,项目名称:GameJam2016,代码行数:11,代码来源:Actor.cs


示例19: AddInteraction

    public void AddInteraction(Interaction interaction)
    {
        if (interactions == null)
            interactions = new List<Interaction>();

        if (interactions.Find(i => i == interaction) == null)
            interactions.Add(interaction);
        else
            Debug.LogWarning("Trying to add an interaction "+interaction+" that is already added");
    }
开发者ID:hassank,项目名称:WendyWebVR,代码行数:10,代码来源:InteractiveThing.cs


示例20: FileListViewModel

        public FileListViewModel(IScreen host)
        {
            HostScreen = host;

            Files = new ReactiveList<string>(new []
            {
                "c:/temp/foo.txt",
                "c:/temp/bar.txt",
                "c:/temp/baseball.dat",
                "c:/temp/basketball.dat",
                "c:/temp/handegg.dat"
            });

            var confirmDelete = new Interaction<Unit, string>();

            DeleteFile = ReactiveCommand.CreateFromTask(
                async () =>
                {
                    var fileToDelete = SelectedFile;
                    var baseMessage = $"Do you really want to delete {fileToDelete}?";
                    var help = "\nConfirm by entering the full file name below.";
                    var message = baseMessage + help;
                    var abort = this
                        .WhenAnyValue(x => x.SelectedFile)
                        .Skip(1)
                        .Select(_ => Unit.Default);

                    ConfirmDeleteViewModel = new ConfirmEventViewModel(abort, confirmDelete)
                    {
                        Message = message
                    };

                    while (true)
                    {
                        var confirmation = await confirmDelete.Handle(Unit.Default);

                        if (confirmation == fileToDelete)
                        {
                            SelectedFile = null;
                            Files.Remove(fileToDelete);
                            ConfirmDeleteViewModel = null;
                            break;
                        }

                        if (confirmation == null)
                        {
                            ConfirmDeleteViewModel = null;
                            break;
                        }

                        ConfirmDeleteViewModel.Message = baseMessage + "\nYou didn't type the right thing." + help;
                    }
                },
                this.WhenAnyValue(vm => vm.SelectedFile).Select(s => s != null));
        }
开发者ID:moswald,项目名称:RxUI-ConfirmationExample,代码行数:55,代码来源:FileListViewModel.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# InteractionDefinition类代码示例发布时间:2022-05-24
下一篇:
C# IntelligentCreatureType类代码示例发布时间: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