Add win condition and related assets
Introduced new animations, prefabs, scripts, and textures to implement a win condition in the game. Updated InventoryScript to trigger the win state when the required coin count is reached. Added supporting assets such as win animations, GUI elements, and sound effects.
This commit is contained in:
1 parent
d8731c1c23
commit
e22c5cbada
68 files changed
+246
-8
No files matched your search
@@ -10,6 +10,8 @@ public class InventoryScript : MonoBehaviour {
|
||||
public GUITexture coinPic;
|
||||
public GUIText coinGUIText;
|
||||
|
||||
public int winCoinCount = 20;
|
||||
public GameObject winObj;
|
||||
void Start () {
|
||||
|
||||
}
|
||||
@@ -28,6 +30,13 @@ public class InventoryScript : MonoBehaviour {
|
||||
coinGUIText.SendMessage("showTextHint", coinCount.ToString());
|
||||
// 显示左下角图片和数量
|
||||
showCoinCount();
|
||||
|
||||
if (coinCount == winCoinCount)
|
||||
{
|
||||
this.gameObject.GetComponent<CharacterController>().enabled = false;
|
||||
this.gameObject.GetComponentInChildren<ShotScript>().enabled = false;
|
||||
winObj.SendMessage("gameOver");
|
||||
}
|
||||
}
|
||||
|
||||
void showCoinCount()
|
||||
|
||||
Reference in new issue
Block a user