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


C# State.Equals方法代码示例

本文整理汇总了C#中State.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# State.Equals方法的具体用法?C# State.Equals怎么用?C# State.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在State的用法示例。


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

示例1: SetState

    void SetState(State s)
    {
        if (s.Equals (State.Move)) {
            anim.SetBool ("moving", true);
        } else {
            anim.SetBool("moving", false);
        }

        if (s.Equals (State.Climb)) {
            anim.SetBool ("climb", true);
        } else {
            anim.SetBool("climb", false);
        }

        state = s;
    }
开发者ID:djoyahoy,项目名称:uniman2,代码行数:16,代码来源:Player.cs

示例2: setState

    // allows more control over changing state
    void setState(State s)
    {
        if (s.Equals(state))
            return;
        print(state.ToString()+" -> "+s.ToString());

        // previous state
        switch (state) {
        case State.Dead:
            return; // stay dead forever!
        case State.Hiding:
            animator.SetInteger ("ShutEyes", 0);
            break;
        case State.TimeTraveling:
            rb.gravityScale = defaultGravityScale;
            break;
        case State.Standard:
            break;
        }
        // next state
        switch (s) {
        case State.Dead:
            rb.gravityScale = 0;
            rb.velocity = Vector2.zero;
            random = Random.Range(1, 2);
            animator.SetInteger ("Dead", random);
            break;
        case State.Hiding:
            random = Random.Range(1, 5);
            animator.SetInteger ("ShutEyes", random);
            break;
        case State.TimeTraveling:
            rb.gravityScale = 0;
            rb.velocity = Vector2.zero;
            break;
        case State.Standard:
            rb.gravityScale = defaultGravityScale;
            break;
        }

        state = s;
    }
开发者ID:Miriamski,项目名称:Shadow,代码行数:43,代码来源:PlayerController.cs

示例3: setState

 private void setState(State state)
 {
     m_state = state;
     Boolean viewState = m_state.Equals(State.View);
     guiAddBtn.Enabled = viewState;
     guiDeleteBtn.Enabled = viewState;
     guiSaveBtn.Enabled = !viewState;
     guiCancelBtn.Enabled = !viewState;
     guiEditBtn.Enabled = viewState;
     guiSearchBtn.Enabled = viewState;
     guiSearchTxt.Enabled = viewState;
 }
开发者ID:RavenB,项目名称:Earth-and-Beyond-server,代码行数:12,代码来源:FrmMission.cs

示例4: State_Equals_OneCodedOneUncoded_SameName_True

 public void State_Equals_OneCodedOneUncoded_SameName_True()
 {
     var s1 = new State<StubStateModel>("state", 4);
     var s2 = new State<StubStateModel>("state");
     Assert.True(s1.Equals(s2));
 }
开发者ID:mmonteleone,项目名称:nate,代码行数:6,代码来源:StateTests.cs

示例5: State_Equals_OneCodedOneUncoded_DiffName_False

 public void State_Equals_OneCodedOneUncoded_DiffName_False()
 {
     var s1 = new State<StubStateModel>("state", 4);
     var s2 = new State<StubStateModel>("state1");
     Assert.False(s1.Equals(s2));
 }
开发者ID:mmonteleone,项目名称:nate,代码行数:6,代码来源:StateTests.cs

示例6: State_Equals_NeitherCoded_DiffName_False

 public void State_Equals_NeitherCoded_DiffName_False()
 {
     var s1 = new State<StubStateModel>("state");
     var s2 = new State<StubStateModel>("state2");
     Assert.False(s1.Equals(s2));
 }
开发者ID:mmonteleone,项目名称:nate,代码行数:6,代码来源:StateTests.cs

示例7: State_Equals_BothCodedSameCode_SameNames_True

 public void State_Equals_BothCodedSameCode_SameNames_True()
 {
     var s1 = new State<StubStateModel>("state", 4);
     var s2 = new State<StubStateModel>("state", 4);
     Assert.True(s1.Equals(s2));
 }
开发者ID:mmonteleone,项目名称:nate,代码行数:6,代码来源:StateTests.cs

示例8: State_Equals_BothCodedSameCode_DiffNames_False

 public void State_Equals_BothCodedSameCode_DiffNames_False()
 {
     var s1 = new State<StubStateModel>("state", 4);
     var s2 = new State<StubStateModel>("state1", 4);
     Assert.False(s1.Equals(s2));
 }
开发者ID:mmonteleone,项目名称:nate,代码行数:6,代码来源:StateTests.cs


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