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


C# Interaction类代码示例

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


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


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