Files
Crash-Course/crashcourse/api/Game.GameManager.html

754 lines
26 KiB
HTML
Raw Permalink Normal View History

2025-04-16 19:57:54 -04:00
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Class GameManager
| Example Unity documentation </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Class GameManager
| Example Unity documentation ">
<meta name="generator" content="docfx ">
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" href="../styles/docfx.vendor.css">
<link rel="stylesheet" href="../styles/docfx.css">
<link rel="stylesheet" href="../styles/main.css">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<meta property="docfx:navrel" content="../toc.html">
<meta property="docfx:tocrel" content="toc.html">
<meta property="docfx:rel" content="../">
</head> <body data-spy="scroll" data-target="#affix" data-offset="120">
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../logo.svg" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
</header>
<div class="container body-content">
<div id="search-results">
<div class="search-list">Search Results for <span></span></div>
<div class="sr-items">
<p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
</div>
<ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
</div>
</div>
<div role="main" class="container body-content hide-when-search">
<div class="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="Game.GameManager">
<h1 id="Game_GameManager" data-uid="Game.GameManager" class="text-break">Class GameManager
</h1>
2025-04-18 20:11:19 -04:00
<div class="markdown level0 summary"><p>This class controls the main game logic, like starting the game, keeping track of players,
handling game modes, and deciding when the game ends.</p>
2025-04-16 19:57:54 -04:00
</div>
<div class="markdown level0 conceptual"></div>
<div class="inheritance">
<h5>Inheritance</h5>
<div class="level0"><span class="xref">object</span></div>
<div class="level1"><span class="xref">GameManager</span></div>
</div>
<h6><strong>Namespace</strong>: <a class="xref" href="Game.html">Game</a></h6>
<h6><strong>Assembly</strong>: cs.temp.dll.dll</h6>
<h5 id="Game_GameManager_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public class GameManager : MonoBehaviour</code></pre>
</div>
<h3 id="fields">Fields
</h3>
<h4 id="Game_GameManager_gameMode" data-uid="Game.GameManager.gameMode">gameMode</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>The current game mode (e.g., free-for-all, keep-away, or obstacle course).</p>
</div>
2025-04-16 19:57:54 -04:00
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static GameManager.GameMode gameMode</code></pre>
</div>
<h5 class="fieldValue">Field Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Game.GameManager.html">GameManager</a>.<a class="xref" href="Game.GameManager.GameMode.html">GameMode</a></td>
<td></td>
</tr>
</tbody>
</table>
<h4 id="Game_GameManager_gameOver" data-uid="Game.GameManager.gameOver">gameOver</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>Whether the game is currently over.</p>
</div>
2025-04-16 19:57:54 -04:00
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public bool gameOver</code></pre>
</div>
<h5 class="fieldValue">Field Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">bool</span></td>
<td></td>
</tr>
</tbody>
</table>
<h4 id="Game_GameManager_gameTimer" data-uid="Game.GameManager.gameTimer">gameTimer</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>A timer that counts down during the game.</p>
</div>
2025-04-16 19:57:54 -04:00
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public GameTimer gameTimer</code></pre>
</div>
<h5 class="fieldValue">Field Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Game.GameTimer.html">GameTimer</a></td>
<td></td>
</tr>
</tbody>
</table>
<h4 id="Game_GameManager_hatObject" data-uid="Game.GameManager.hatObject">hatObject</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>The hat object used in &quot;keep-away&quot; mode.</p>
</div>
2025-04-16 19:57:54 -04:00
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public GameObject hatObject</code></pre>
</div>
<h5 class="fieldValue">Field Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">GameObject</span></td>
<td></td>
</tr>
</tbody>
</table>
<h4 id="Game_GameManager_hatSpawnPositions" data-uid="Game.GameManager.hatSpawnPositions">hatSpawnPositions</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>Positions where the hat can spawn in &quot;keep-away&quot; mode.</p>
</div>
2025-04-16 19:57:54 -04:00
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public List&lt;Vector2&gt; hatSpawnPositions</code></pre>
</div>
<h5 class="fieldValue">Field Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">List&lt;&gt;</span>&lt;<span class="xref">Vector2</span>&gt;</td>
<td></td>
</tr>
</tbody>
</table>
<h4 id="Game_GameManager_LeaderboardCanvas" data-uid="Game.GameManager.LeaderboardCanvas">LeaderboardCanvas</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>The canvas that shows the leaderboard during the game.</p>
</div>
2025-04-16 19:57:54 -04:00
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public Canvas LeaderboardCanvas</code></pre>
</div>
<h5 class="fieldValue">Field Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">Canvas</span></td>
<td></td>
</tr>
</tbody>
</table>
<h4 id="Game_GameManager_map" data-uid="Game.GameManager.map">map</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>The name of the map being played.</p>
</div>
2025-04-16 19:57:54 -04:00
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static string map</code></pre>
</div>
<h5 class="fieldValue">Field Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">string</span></td>
<td></td>
</tr>
</tbody>
</table>
<h4 id="Game_GameManager_music" data-uid="Game.GameManager.music">music</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>Whether the background music is turned on.</p>
</div>
2025-04-16 19:57:54 -04:00
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool music</code></pre>
</div>
<h5 class="fieldValue">Field Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">bool</span></td>
<td></td>
</tr>
</tbody>
</table>
<h4 id="Game_GameManager_obstacleCourseSpawnPosition" data-uid="Game.GameManager.obstacleCourseSpawnPosition">obstacleCourseSpawnPosition</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>The position where players spawn in obstacle course mode.</p>
</div>
2025-04-16 19:57:54 -04:00
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public Vector2 obstacleCourseSpawnPosition</code></pre>
</div>
<h5 class="fieldValue">Field Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">Vector2</span></td>
<td></td>
</tr>
</tbody>
</table>
<h4 id="Game_GameManager_offset" data-uid="Game.GameManager.offset">offset</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>The distance between players when they spawn.</p>
</div>
2025-04-16 19:57:54 -04:00
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public float offset</code></pre>
</div>
<h5 class="fieldValue">Field Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">float</span></td>
<td></td>
</tr>
</tbody>
</table>
<h4 id="Game_GameManager_playerColors" data-uid="Game.GameManager.playerColors">playerColors</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>A list of colors assigned to each player.</p>
</div>
2025-04-16 19:57:54 -04:00
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static List&lt;Color&gt; playerColors</code></pre>
</div>
<h5 class="fieldValue">Field Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">List&lt;&gt;</span>&lt;<span class="xref">Color</span>&gt;</td>
<td></td>
</tr>
</tbody>
</table>
<h4 id="Game_GameManager_playerHoldTimes" data-uid="Game.GameManager.playerHoldTimes">playerHoldTimes</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>Tracks how long each player has held an item in &quot;keep-away&quot; mode.</p>
</div>
2025-04-16 19:57:54 -04:00
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Dictionary&lt;GameObject, float&gt; playerHoldTimes</code></pre>
</div>
<h5 class="fieldValue">Field Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">Dictionary&lt;, &gt;</span>&lt;<span class="xref">GameObject</span>, <span class="xref">float</span>&gt;</td>
<td></td>
</tr>
</tbody>
</table>
<h4 id="Game_GameManager_players" data-uid="Game.GameManager.players">players</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>A list of all the players in the game.</p>
</div>
2025-04-16 19:57:54 -04:00
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static List&lt;GameObject&gt; players</code></pre>
</div>
<h5 class="fieldValue">Field Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">List&lt;&gt;</span>&lt;<span class="xref">GameObject</span>&gt;</td>
<td></td>
</tr>
</tbody>
</table>
<h4 id="Game_GameManager_spawnPosition" data-uid="Game.GameManager.spawnPosition">spawnPosition</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>The position where players spawn at the start of the game.</p>
</div>
2025-04-16 19:57:54 -04:00
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public Vector2 spawnPosition</code></pre>
</div>
<h5 class="fieldValue">Field Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">Vector2</span></td>
<td></td>
</tr>
</tbody>
</table>
<h4 id="Game_GameManager_time" data-uid="Game.GameManager.time">time</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>The total time (in seconds) for the game to run.</p>
</div>
2025-04-16 19:57:54 -04:00
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public float time</code></pre>
</div>
<h5 class="fieldValue">Field Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">float</span></td>
<td></td>
</tr>
</tbody>
</table>
<h4 id="Game_GameManager_TimerCanvas" data-uid="Game.GameManager.TimerCanvas">TimerCanvas</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>The canvas that shows the timer during the game.</p>
</div>
2025-04-16 19:57:54 -04:00
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public Canvas TimerCanvas</code></pre>
</div>
<h5 class="fieldValue">Field Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">Canvas</span></td>
<td></td>
</tr>
</tbody>
</table>
<h3 id="properties">Properties
</h3>
<a id="Game_GameManager_Instance_" data-uid="Game.GameManager.Instance*"></a>
<h4 id="Game_GameManager_Instance" data-uid="Game.GameManager.Instance">Instance</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>The single instance of this class that can be accessed from anywhere in the game.</p>
</div>
2025-04-16 19:57:54 -04:00
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static GameManager Instance { get; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Game.GameManager.html">GameManager</a></td>
<td></td>
</tr>
</tbody>
</table>
<h3 id="methods">Methods
</h3>
<a id="Game_GameManager_AlivePlayers_" data-uid="Game.GameManager.AlivePlayers*"></a>
<h4 id="Game_GameManager_AlivePlayers" data-uid="Game.GameManager.AlivePlayers">AlivePlayers()</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>Gets a list of all players who are still alive in the game.</p>
2025-04-16 19:57:54 -04:00
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public List&lt;GameObject&gt; AlivePlayers()</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">List&lt;&gt;</span>&lt;<span class="xref">GameObject</span>&gt;</td>
2025-04-18 20:11:19 -04:00
<td><p>A list of players who are still active in the game.</p>
2025-04-16 19:57:54 -04:00
</td>
</tr>
</tbody>
</table>
2025-04-18 20:11:19 -04:00
<h5 id="Game_GameManager_AlivePlayers_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method checks all players in the game and returns only those who are still active.
A player is considered &quot;alive&quot; if their GameObject is active in the scene.</p>
</div>
2025-04-16 19:57:54 -04:00
<a id="Game_GameManager_GameOver_" data-uid="Game.GameManager.GameOver*"></a>
<h4 id="Game_GameManager_GameOver" data-uid="Game.GameManager.GameOver">GameOver()</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>Ends the game and determines the winner based on the current game mode.</p>
2025-04-16 19:57:54 -04:00
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void GameOver()</code></pre>
</div>
2025-04-18 20:11:19 -04:00
<h5 id="Game_GameManager_GameOver_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method handles the end-of-game logic, such as stopping the timer, hiding UI elements,
and determining the winner based on the <a class="xref" href="Game.GameManager.GameMode.html">GameManager.GameMode</a>. It also triggers the
<a class="xref" href="Game.GameManager.html#Game_GameManager_EndGameEvent">EndGameEvent</a> for any subscribed listeners.</p>
<p>In &quot;free-for-all&quot; mode, the last alive player is declared the winner. In &quot;keep-away&quot; mode,
the player with the longest hold time wins. In &quot;obstacle course&quot; mode, the winner is determined
by the <a class="xref" href="Game.ObstacleCourse.html">ObstacleCourse</a> logic.</p>
</div>
<h5 id="Game_GameManager_GameOver_examples">Examples</h5>
<pre><code>GameManager.Instance.GameOver();</code></pre>
2025-04-16 19:57:54 -04:00
<a id="Game_GameManager_PlayerDied_" data-uid="Game.GameManager.PlayerDied*"></a>
<h4 id="Game_GameManager_PlayerDied_Player_Damageable_" data-uid="Game.GameManager.PlayerDied(Player.Damageable)">PlayerDied(Damageable)</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>Handles what happens when a player dies, like respawning them or ending the game.</p>
2025-04-16 19:57:54 -04:00
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void PlayerDied(Damageable player)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Player.Damageable.html">Damageable</a></td>
<td><span class="parametername">player</span></td>
2025-04-18 20:11:19 -04:00
<td><p>The player who died.</p>
2025-04-16 19:57:54 -04:00
</td>
</tr>
</tbody>
</table>
<a id="Game_GameManager_StartGame_" data-uid="Game.GameManager.StartGame*"></a>
<h4 id="Game_GameManager_StartGame" data-uid="Game.GameManager.StartGame">StartGame()</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>Sets up the game based on the selected game mode. This includes spawning players and setting their lives.</p>
2025-04-16 19:57:54 -04:00
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void StartGame()</code></pre>
</div>
<a id="Game_GameManager_UpdatePlayerHoldTime_" data-uid="Game.GameManager.UpdatePlayerHoldTime*"></a>
<h4 id="Game_GameManager_UpdatePlayerHoldTime_GameObject_System_Single_" data-uid="Game.GameManager.UpdatePlayerHoldTime(GameObject,System.Single)">UpdatePlayerHoldTime(GameObject, float)</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>Updates the hold time for a player and refreshes the leaderboard.</p>
2025-04-16 19:57:54 -04:00
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void UpdatePlayerHoldTime(GameObject player, float holdTime)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">GameObject</span></td>
<td><span class="parametername">player</span></td>
2025-04-18 20:11:19 -04:00
<td><p>The player whose hold time is being updated.</p>
2025-04-16 19:57:54 -04:00
</td>
</tr>
<tr>
<td><span class="xref">float</span></td>
<td><span class="parametername">holdTime</span></td>
2025-04-18 20:11:19 -04:00
<td><p>The new hold time for the player.</p>
2025-04-16 19:57:54 -04:00
</td>
</tr>
</tbody>
</table>
2025-04-18 20:11:19 -04:00
<h5 id="Game_GameManager_UpdatePlayerHoldTime_GameObject_System_Single__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method updates the player's hold time in the dictionary and refreshes the leaderboard UI.
If the player's hold time is higher than before, the leaderboard is re-sorted.</p>
</div>
2025-04-16 19:57:54 -04:00
<h3 id="events">Events
</h3>
<h4 id="Game_GameManager_EndGameEvent" data-uid="Game.GameManager.EndGameEvent">EndGameEvent</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>Event triggered when the game ends.</p>
</div>
2025-04-16 19:57:54 -04:00
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public event GameManager.GameEvent EndGameEvent</code></pre>
</div>
<h5 class="eventType">Event Type</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Game.GameManager.html">GameManager</a>.<a class="xref" href="Game.GameManager.GameEvent.html">GameEvent</a></td>
<td></td>
</tr>
</tbody>
</table>
<h4 id="Game_GameManager_StartGameEvent" data-uid="Game.GameManager.StartGameEvent">StartGameEvent</h4>
2025-04-18 20:11:19 -04:00
<div class="markdown level1 summary"><p>Event triggered when the game starts.</p>
</div>
2025-04-16 19:57:54 -04:00
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public event GameManager.GameEvent StartGameEvent</code></pre>
</div>
<h5 class="eventType">Event Type</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Game.GameManager.html">GameManager</a>.<a class="xref" href="Game.GameManager.GameEvent.html">GameEvent</a></td>
<td></td>
</tr>
</tbody>
</table>
</article>
</div>
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<div class="contribution">
<ul class="nav">
</ul>
</div>
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<h5>In This Article</h5>
<div></div>
</nav>
</div>
</div>
</div>
</div>
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
Example Unity documentation footer
</div>
</div>
</footer>
</div>
<script type="text/javascript" src="../styles/docfx.vendor.js"></script>
<script type="text/javascript" src="../styles/docfx.js"></script>
<script type="text/javascript" src="../styles/main.js"></script>
</body>
</html>