public override void NotifyGoal(GoalPosition position) { int dir = 1; if (position == GoalPosition.North) { playerScore++; Manager.UI.SouthScore.SetScore(playerScore); dir = 1; } else if (position == GoalPosition.South) { computerScore++; Manager.UI.NorthScore.SetScore(computerScore); dir = -1; } if (playerScore >= 5) { EndGame("You win!"); } else if (computerScore >= 5) { EndGame("You lose!"); } else { StartCoroutine(LaunchBall(dir)); } }
private void setDistancesFromGoal() { for (int i = 0; i < Height; i++) { for (int j = 0; j < Width; j++) { this.BlockData[i, j].DistanceFromGoal = GoalPosition.distanceFromCoord(i, j); } } }
// Start is called before the first frame update void Start() { stayPos = null; sej = GameObject.FindGameObjectWithTag("Goal").GetComponent <StageEndJudge>(); GameObject goal = GameObject.Find("Goal"); if (goal == null) { goal = GameObject.Find("FlowGoal"); } gp = goal.GetComponent <GoalPosition>(); }
public override void NotifyGoal(GoalPosition position) { if (authoritative) { if (position == GoalPosition.North) { HandleGoal(Player.Server); } else if (position == GoalPosition.South) { HandleGoal(Player.Client); } } else { ball.Freeze(); ballGO.SetActive(false); } }
public abstract void NotifyGoal(GoalPosition position);