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
@@ -0,0 +1,5 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d9577f9de68235b4f8ea5af15cebeaa2
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
Binary file not shown.
@@ -0,0 +1,4 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9eaba44542953f1499744cb0e57c8d4d
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
Binary file not shown.
@@ -0,0 +1,4 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7aa07637fee495546a283d1bdfd172f0
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
Binary file not shown.
@@ -0,0 +1,4 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 675acc26a75bbdd4c91d016b3891b60b
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
Binary file not shown.
@@ -5,8 +5,8 @@ TextureImporter:
|
|||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
mipmaps:
|
mipmaps:
|
||||||
mipMapMode: 0
|
mipMapMode: 0
|
||||||
enableMipMap: 1
|
enableMipMap: 0
|
||||||
linearTexture: 0
|
linearTexture: 1
|
||||||
correctGamma: 0
|
correctGamma: 0
|
||||||
fadeOut: 0
|
fadeOut: 0
|
||||||
borderMipMap: 0
|
borderMipMap: 0
|
||||||
@@ -25,10 +25,10 @@ TextureImporter:
|
|||||||
maxTextureSize: 1024
|
maxTextureSize: 1024
|
||||||
textureSettings:
|
textureSettings:
|
||||||
filterMode: -1
|
filterMode: -1
|
||||||
aniso: -1
|
aniso: 1
|
||||||
mipBias: -1
|
mipBias: -1
|
||||||
wrapMode: 1
|
wrapMode: 1
|
||||||
nPOTScale: 1
|
nPOTScale: 0
|
||||||
lightmap: 0
|
lightmap: 0
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
spriteMode: 0
|
spriteMode: 0
|
||||||
@@ -38,8 +38,8 @@ TextureImporter:
|
|||||||
spritePivot: {x: .5, y: .5}
|
spritePivot: {x: .5, y: .5}
|
||||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
spritePixelsToUnits: 100
|
spritePixelsToUnits: 100
|
||||||
alphaIsTransparency: 0
|
alphaIsTransparency: 1
|
||||||
textureType: 0
|
textureType: 2
|
||||||
buildTargetSettings: []
|
buildTargetSettings: []
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
sprites: []
|
sprites: []
|
||||||
|
|||||||
Binary file not shown.
@@ -0,0 +1,4 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b01322d912e17d44c814d88ef127e376
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
Binary file not shown.
@@ -0,0 +1,4 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1965ff6c0d80af944bc901679f9dac14
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
Binary file not shown.
@@ -0,0 +1,4 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2ea5d18383bfbfd4188c3150f2fb812c
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
Binary file not shown.
@@ -0,0 +1,22 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
public class FaderScript : MonoBehaviour {
|
||||||
|
|
||||||
|
public GUITexture loadingGUI;
|
||||||
|
|
||||||
|
void Start () {
|
||||||
|
Rect rect = new Rect (-Screen.width * 0.5f, -Screen.height * 0.5f, Screen.width, Screen.height);
|
||||||
|
guiTexture.pixelInset = rect;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update () {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void showLoading()
|
||||||
|
{
|
||||||
|
Instantiate(loadingGUI);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 841fd8951c5763843aa606c0c59d2858
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
@@ -10,6 +10,8 @@ public class InventoryScript : MonoBehaviour {
|
|||||||
public GUITexture coinPic;
|
public GUITexture coinPic;
|
||||||
public GUIText coinGUIText;
|
public GUIText coinGUIText;
|
||||||
|
|
||||||
|
public int winCoinCount = 20;
|
||||||
|
public GameObject winObj;
|
||||||
void Start () {
|
void Start () {
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -28,6 +30,13 @@ public class InventoryScript : MonoBehaviour {
|
|||||||
coinGUIText.SendMessage("showTextHint", coinCount.ToString());
|
coinGUIText.SendMessage("showTextHint", coinCount.ToString());
|
||||||
// 显示左下角图片和数量
|
// 显示左下角图片和数量
|
||||||
showCoinCount();
|
showCoinCount();
|
||||||
|
|
||||||
|
if (coinCount == winCoinCount)
|
||||||
|
{
|
||||||
|
this.gameObject.GetComponent<CharacterController>().enabled = false;
|
||||||
|
this.gameObject.GetComponentInChildren<ShotScript>().enabled = false;
|
||||||
|
winObj.SendMessage("gameOver");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void showCoinCount()
|
void showCoinCount()
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
public class ReloadScript : MonoBehaviour {
|
||||||
|
|
||||||
|
// Use this for initialization
|
||||||
|
void Start () {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update () {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void loadMenu()
|
||||||
|
{
|
||||||
|
Application.LoadLevel("menu");
|
||||||
|
InventoryScript.coinCount = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f3f77b8ab57b664448223c1889af8c8d
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
public class WinScript : MonoBehaviour {
|
||||||
|
|
||||||
|
public GUITexture winGUI;
|
||||||
|
public AudioClip winSound;
|
||||||
|
public GUITexture fader;
|
||||||
|
void Start () {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update () {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerator gameOver()
|
||||||
|
{
|
||||||
|
AudioSource.PlayClipAtPoint(winSound, transform.position, 0.1f);
|
||||||
|
Instantiate(winGUI);
|
||||||
|
|
||||||
|
yield return new WaitForSeconds(5.0f);
|
||||||
|
|
||||||
|
Instantiate(fader);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0f163043d74be374e9a297bb4917dcad
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
Binary file not shown.
@@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 94e16e98b788ab34b8371da2a69be99e
|
||||||
|
AudioImporter:
|
||||||
|
serializedVersion: 4
|
||||||
|
format: 0
|
||||||
|
quality: .5
|
||||||
|
stream: 1
|
||||||
|
3D: 0
|
||||||
|
forceToMono: 0
|
||||||
|
useHardware: 0
|
||||||
|
loopable: 0
|
||||||
|
userData:
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: d6838a96f476abb48aa63cc7be70b903
|
guid: 94fc94e879746f74f877ffe50238143d
|
||||||
TextureImporter:
|
TextureImporter:
|
||||||
fileIDToRecycleName: {}
|
fileIDToRecycleName: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 4ea3711fbc2e59540b9481579820840e
|
guid: 51efa68ff99c8a347916dffe669b8b2b
|
||||||
TextureImporter:
|
TextureImporter:
|
||||||
fileIDToRecycleName: {}
|
fileIDToRecycleName: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
@@ -0,0 +1,47 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7e25d8953d21ce04db981174e27f068e
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
linearTexture: 1
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: .25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 1024
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: 1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: .5, y: .5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
textureType: 2
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
@@ -0,0 +1,47 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c406b1c2906dabe4e90f977bd47245bb
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
linearTexture: 1
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: .25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 1024
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: 1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: .5, y: .5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
textureType: 2
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user