本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}