コード例 #1
0
ファイル: chrActionEnemySub.cs プロジェクト: wyuurla/006772
	// ================================================================ //

	public override void	start()
	{
		this.is_finished = false;

		// 지금은 도깨비 전용.

		chrBehaviorEnemy_Obake	obake = this.behavior as chrBehaviorEnemy_Obake;

		if(obake != null) {

			this.step.set_next(STEP.WARP_IN);

		} else {

			this.step.set_next(STEP.FINISH);
		}
	}
コード例 #2
0
ファイル: chrActionEnemySub.cs プロジェクト: wyuurla/006772
	public override void	execute()
	{
		BasicAction	basic_action = this.behavior.basic_action;

		chrBehaviorEnemy_Obake	obake = this.behavior as chrBehaviorEnemy_Obake;

		// ---------------------------------------------------------------- //
		// 다음 상태로 이동할지 체크합니다.

		switch(this.step.do_transition()) {

			// 발사.
			case STEP.SHOOT:
			{
				if(this.behavior.is_attack_motion_finished) {

					this.step.set_next_delay(STEP.FINISH, 1.0f);
				}
			}
			break;
		}

		// ---------------------------------------------------------------- //
		// 상태가 바뀌었을 때의 초기화.

		while(this.step.get_next() != STEP.NONE) {

			switch(this.step.do_initialize()) {

				// 발사.
				case STEP.SHOOT:
				{
					basic_action.setMoveMotionSpeed(0.0f);
					basic_action.animator.SetTrigger("Attack");
				}
				break;

				// 끝.
				case STEP.FINISH:
				{
					this.is_finished = true;
				}
				break;
			}
		}

		// ---------------------------------------------------------------- //
		// 각 상태에서의 실행 처리.

		switch(this.step.do_execution(Time.deltaTime)) {

			// 발사.
			case STEP.SHOOT:
			{
				if(this.behavior.is_attack_motion_impact) {

					obake.shootBullet();
				}
			}
			break;
		}

		// ---------------------------------------------------------------- //
	}