コード例 #1
0
	// change facing of the character
	public void switchToState(ON_STAIR_STATE state_in) {
		if (onStairState == ON_STAIR_STATE.Not) {
			animator.SetBool("onStair", true);
		}
		else if (state_in == ON_STAIR_STATE.Not) {
			animator.SetBool("onStair", false);
		}
		// UP to down or down to up
		else if (onStairState == ON_STAIR_STATE.Up && state_in == ON_STAIR_STATE.Down) {

			pc.Flip();
		}
		else if (onStairState == ON_STAIR_STATE.Down && state_in == ON_STAIR_STATE.Up) {
			pc.Flip();
		}
		onStairState = state_in;

	}
コード例 #2
0
	void Start () {
		onStairState = ON_STAIR_STATE.Not;
		pc = GetComponent<PlayerController> ();
		animator = GetComponent<Animator> ();
	}