- Home /
Game architecture problem
I have a problem with the architecture of my game and I need some tip to implement it.
Basically I have functions like these triggered when an user pushes a button:
public function MoveAndAttack()
{
yield StartCoroutine(Move(position));
CheckThings();
yield StartCoroutine(Attack(player));
}
public function MoveAndHeal()
{
yield StartCoroutine(Move(position));
CheckThings();
yield StartCoroutine(Heal(player));
}
The problem appears inside the Move() function, as it can trigger two kinds of events:
1) One that should pause the execution and launch a new screen. When the user finishes in that screen, the execution should continue where it stopped.
2) Other that should pause the execution and launch a new screen, but when that screen dismiss the execution should not continue with the previous functions (MoveAndAttack or MoveAndHeal).
Also can happen that none of these events trigger, so it should continue normally.
Could anyone help me how I should manage this?
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
problems with coroutines 0 Answers
Using Arrays to Organize Variables 2 Answers
Making a Top 10 score page 2 Answers
C Sharp Messenger Extended Warning 1 Answer