private void DoCombatGoal(TANK_GOALS goal) { switch (goal) { case TANK_GOALS.ATTACK_FROM_RANGE: mAttackFromRangeLogic.Run(); break; case TANK_GOALS.CHARGE_PLAYER: mChargeLogic.Run(); break; default: break; } }
public void RunCombatState() { rBody.constraints = RigidbodyConstraints.None; // Sets target to either player or objective. // SetTarget(doObj, obj); mConResults.CheckAndStoreConditions(); // Here we find out what our goal is, to attack from a distance, or to attack with a charge. mCurGoal = FindCombatGoal(); // Here we perform that goal, attacking from a distance or attacking with a charge DoCombatGoal(mCurGoal); // goal is updated with side effects mMoveToGoal.MoveToGoal(); }