Added Swigs left gui text.
This commit is contained in:
parent
7c6613987e
commit
d4a6d0bb00
10 changed files with 153 additions and 128 deletions
12
Assets/Audio/beneath-surface-3.ogg.meta
Normal file
12
Assets/Audio/beneath-surface-3.ogg.meta
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 36ecdbbae90239a4ea972d8b1517f5d3
|
||||||
|
AudioImporter:
|
||||||
|
serializedVersion: 4
|
||||||
|
format: 0
|
||||||
|
quality: -1
|
||||||
|
stream: 1
|
||||||
|
3D: 1
|
||||||
|
forceToMono: 0
|
||||||
|
useHardware: 0
|
||||||
|
loopable: 0
|
||||||
|
userData:
|
||||||
12
Assets/Audio/beneath-surface-4.ogg.meta
Normal file
12
Assets/Audio/beneath-surface-4.ogg.meta
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7f70abf26ead3304fa0fd0aa1e57992e
|
||||||
|
AudioImporter:
|
||||||
|
serializedVersion: 4
|
||||||
|
format: 0
|
||||||
|
quality: -1
|
||||||
|
stream: 1
|
||||||
|
3D: 1
|
||||||
|
forceToMono: 0
|
||||||
|
useHardware: 0
|
||||||
|
loopable: 0
|
||||||
|
userData:
|
||||||
12
Assets/Audio/shank.mp3.meta
Normal file
12
Assets/Audio/shank.mp3.meta
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d7b1c5faa669f6146a725ae85236bae9
|
||||||
|
AudioImporter:
|
||||||
|
serializedVersion: 4
|
||||||
|
format: 0
|
||||||
|
quality: -1
|
||||||
|
stream: 1
|
||||||
|
3D: 1
|
||||||
|
forceToMono: 0
|
||||||
|
useHardware: 0
|
||||||
|
loopable: 0
|
||||||
|
userData:
|
||||||
|
|
@ -152,7 +152,6 @@ GameObject:
|
||||||
m_Component:
|
m_Component:
|
||||||
- 4: {fileID: 57666823}
|
- 4: {fileID: 57666823}
|
||||||
- 65: {fileID: 57666826}
|
- 65: {fileID: 57666826}
|
||||||
- 82: {fileID: 57666824}
|
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Shank Spawn
|
m_Name: Shank Spawn
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
|
@ -171,65 +170,6 @@ Transform:
|
||||||
m_LocalScale: {x: 1, y: .0909090862, z: .0500000007}
|
m_LocalScale: {x: 1, y: .0909090862, z: .0500000007}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 745975992}
|
m_Father: {fileID: 745975992}
|
||||||
--- !u!82 &57666824
|
|
||||||
AudioSource:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_PrefabParentObject: {fileID: 8200000, guid: 0dd5d3e41887306468e6f9dd9d58b975,
|
|
||||||
type: 2}
|
|
||||||
m_PrefabInternal: {fileID: 296847678}
|
|
||||||
m_GameObject: {fileID: 57666822}
|
|
||||||
m_Enabled: 1
|
|
||||||
serializedVersion: 3
|
|
||||||
m_audioClip: {fileID: 8300000, guid: b189fb0007b0fc148a287b20274b0b51, type: 3}
|
|
||||||
m_PlayOnAwake: 1
|
|
||||||
m_Volume: 1
|
|
||||||
m_Pitch: 1
|
|
||||||
Loop: 0
|
|
||||||
Mute: 0
|
|
||||||
Priority: 128
|
|
||||||
DopplerLevel: 1
|
|
||||||
MinDistance: 1
|
|
||||||
MaxDistance: 500
|
|
||||||
Pan2D: 0
|
|
||||||
rolloffMode: 0
|
|
||||||
BypassEffects: 0
|
|
||||||
BypassListenerEffects: 0
|
|
||||||
BypassReverbZones: 0
|
|
||||||
rolloffCustomCurve:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Curve:
|
|
||||||
- time: 0
|
|
||||||
value: 1
|
|
||||||
inSlope: 0
|
|
||||||
outSlope: 0
|
|
||||||
tangentMode: 0
|
|
||||||
- time: 1
|
|
||||||
value: 0
|
|
||||||
inSlope: 0
|
|
||||||
outSlope: 0
|
|
||||||
tangentMode: 0
|
|
||||||
m_PreInfinity: 2
|
|
||||||
m_PostInfinity: 2
|
|
||||||
panLevelCustomCurve:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Curve:
|
|
||||||
- time: 0
|
|
||||||
value: 1
|
|
||||||
inSlope: 0
|
|
||||||
outSlope: 0
|
|
||||||
tangentMode: 0
|
|
||||||
m_PreInfinity: 2
|
|
||||||
m_PostInfinity: 2
|
|
||||||
spreadCustomCurve:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Curve:
|
|
||||||
- time: 0
|
|
||||||
value: 0
|
|
||||||
inSlope: 0
|
|
||||||
outSlope: 0
|
|
||||||
tangentMode: 0
|
|
||||||
m_PreInfinity: 2
|
|
||||||
m_PostInfinity: 2
|
|
||||||
--- !u!65 &57666826
|
--- !u!65 &57666826
|
||||||
BoxCollider:
|
BoxCollider:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -377,7 +317,6 @@ GameObject:
|
||||||
- 4: {fileID: 146718572}
|
- 4: {fileID: 146718572}
|
||||||
- 114: {fileID: 146718573}
|
- 114: {fileID: 146718573}
|
||||||
- 54: {fileID: 146718574}
|
- 54: {fileID: 146718574}
|
||||||
- 82: {fileID: 146718575}
|
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Player
|
m_Name: Player
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
|
@ -432,64 +371,6 @@ Rigidbody:
|
||||||
m_Interpolate: 0
|
m_Interpolate: 0
|
||||||
m_Constraints: 0
|
m_Constraints: 0
|
||||||
m_CollisionDetection: 0
|
m_CollisionDetection: 0
|
||||||
--- !u!82 &146718575
|
|
||||||
AudioSource:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_PrefabParentObject: {fileID: 0}
|
|
||||||
m_PrefabInternal: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 146718571}
|
|
||||||
m_Enabled: 1
|
|
||||||
serializedVersion: 3
|
|
||||||
m_audioClip: {fileID: 8300000, guid: b189fb0007b0fc148a287b20274b0b51, type: 3}
|
|
||||||
m_PlayOnAwake: 0
|
|
||||||
m_Volume: 1
|
|
||||||
m_Pitch: 1
|
|
||||||
Loop: 0
|
|
||||||
Mute: 0
|
|
||||||
Priority: 128
|
|
||||||
DopplerLevel: 1
|
|
||||||
MinDistance: 1
|
|
||||||
MaxDistance: 500
|
|
||||||
Pan2D: 0
|
|
||||||
rolloffMode: 0
|
|
||||||
BypassEffects: 0
|
|
||||||
BypassListenerEffects: 0
|
|
||||||
BypassReverbZones: 0
|
|
||||||
rolloffCustomCurve:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Curve:
|
|
||||||
- time: 0
|
|
||||||
value: 1
|
|
||||||
inSlope: 0
|
|
||||||
outSlope: 0
|
|
||||||
tangentMode: 0
|
|
||||||
- time: 1
|
|
||||||
value: 0
|
|
||||||
inSlope: 0
|
|
||||||
outSlope: 0
|
|
||||||
tangentMode: 0
|
|
||||||
m_PreInfinity: 2
|
|
||||||
m_PostInfinity: 2
|
|
||||||
panLevelCustomCurve:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Curve:
|
|
||||||
- time: 0
|
|
||||||
value: 1
|
|
||||||
inSlope: 0
|
|
||||||
outSlope: 0
|
|
||||||
tangentMode: 0
|
|
||||||
m_PreInfinity: 2
|
|
||||||
m_PostInfinity: 2
|
|
||||||
spreadCustomCurve:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Curve:
|
|
||||||
- time: 0
|
|
||||||
value: 0
|
|
||||||
inSlope: 0
|
|
||||||
outSlope: 0
|
|
||||||
tangentMode: 0
|
|
||||||
m_PreInfinity: 2
|
|
||||||
m_PostInfinity: 2
|
|
||||||
--- !u!1001 &296847678
|
--- !u!1001 &296847678
|
||||||
Prefab:
|
Prefab:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -553,6 +434,7 @@ Prefab:
|
||||||
- {fileID: 11400000, guid: 0dd5d3e41887306468e6f9dd9d58b975, type: 2}
|
- {fileID: 11400000, guid: 0dd5d3e41887306468e6f9dd9d58b975, type: 2}
|
||||||
- {fileID: 2300000, guid: 0dd5d3e41887306468e6f9dd9d58b975, type: 2}
|
- {fileID: 2300000, guid: 0dd5d3e41887306468e6f9dd9d58b975, type: 2}
|
||||||
- {fileID: 3300000, guid: 0dd5d3e41887306468e6f9dd9d58b975, type: 2}
|
- {fileID: 3300000, guid: 0dd5d3e41887306468e6f9dd9d58b975, type: 2}
|
||||||
|
- {fileID: 8200000, guid: 0dd5d3e41887306468e6f9dd9d58b975, type: 2}
|
||||||
m_ParentPrefab: {fileID: 100100000, guid: 0dd5d3e41887306468e6f9dd9d58b975, type: 2}
|
m_ParentPrefab: {fileID: 100100000, guid: 0dd5d3e41887306468e6f9dd9d58b975, type: 2}
|
||||||
m_RootGameObject: {fileID: 57666822}
|
m_RootGameObject: {fileID: 57666822}
|
||||||
m_IsPrefabParent: 0
|
m_IsPrefabParent: 0
|
||||||
|
|
@ -987,6 +869,7 @@ GameObject:
|
||||||
- 65: {fileID: 768198793}
|
- 65: {fileID: 768198793}
|
||||||
- 23: {fileID: 768198792}
|
- 23: {fileID: 768198792}
|
||||||
- 95: {fileID: 768198795}
|
- 95: {fileID: 768198795}
|
||||||
|
- 114: {fileID: 768198796}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: North Wall
|
m_Name: North Wall
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
|
@ -1059,6 +942,20 @@ Animator:
|
||||||
m_ApplyRootMotion: 1
|
m_ApplyRootMotion: 1
|
||||||
m_AnimatePhysics: 0
|
m_AnimatePhysics: 0
|
||||||
m_HasTransformHierarchy: 1
|
m_HasTransformHierarchy: 1
|
||||||
|
--- !u!114 &768198796
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 768198790}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 704d6d277dc28fa4c8a6a28688efd5a3, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
columns: 1
|
||||||
|
rows: 2
|
||||||
|
framesPerSecond: 10
|
||||||
--- !u!1 &787766216
|
--- !u!1 &787766216
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
41
Assets/Scripts/AnimateSprite.cs
Normal file
41
Assets/Scripts/AnimateSprite.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
public class AnimateSprite : MonoBehaviour {
|
||||||
|
|
||||||
|
public int columns = 2;
|
||||||
|
public int rows = 2;
|
||||||
|
public float framesPerSecond = 10f;
|
||||||
|
|
||||||
|
//the current frame to display
|
||||||
|
private int index = 0;
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
StartCoroutine(updateTiling());
|
||||||
|
|
||||||
|
//set the tile size of the texture (in UV units), based on the rows and columns
|
||||||
|
Vector2 size = new Vector2(1f / columns, 1f / rows);
|
||||||
|
renderer.sharedMaterial.SetTextureScale("_MainTex", size);
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerator updateTiling()
|
||||||
|
{
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
//move to the next index
|
||||||
|
index++;
|
||||||
|
if (index >= rows * columns)
|
||||||
|
index = 0;
|
||||||
|
|
||||||
|
//split into x and y indexes
|
||||||
|
Vector2 offset = new Vector2((float)index / columns - (index / columns), //x index
|
||||||
|
(index / columns) / (float)rows); //y index
|
||||||
|
|
||||||
|
renderer.sharedMaterial.SetTextureOffset("_MainTex", offset);
|
||||||
|
|
||||||
|
yield return new WaitForSeconds(1f / framesPerSecond);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
8
Assets/Scripts/AnimateSprite.cs.meta
Normal file
8
Assets/Scripts/AnimateSprite.cs.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 704d6d277dc28fa4c8a6a28688efd5a3
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
27
Assets/Scripts/GameController.cs
Normal file
27
Assets/Scripts/GameController.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
public class GameController : MonoBehaviour {
|
||||||
|
|
||||||
|
public int swigs;
|
||||||
|
public GUIText swigText;
|
||||||
|
|
||||||
|
// Use this for initialization
|
||||||
|
void Start () {
|
||||||
|
UpdateSwigText ();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update () {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TakeSwig() {
|
||||||
|
swigs -= 1;
|
||||||
|
UpdateSwigText();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateSwigText() {
|
||||||
|
swigText.text = "Swigs Left: " + swigs;
|
||||||
|
}
|
||||||
|
}
|
||||||
8
Assets/Scripts/GameController.cs.meta
Normal file
8
Assets/Scripts/GameController.cs.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: cc84b14a55660b643805ae0f1878c40b
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
|
@ -11,22 +11,30 @@ public class PlayerController : MonoBehaviour {
|
||||||
public Transform shankSpawn;
|
public Transform shankSpawn;
|
||||||
public GameObject vvAura;
|
public GameObject vvAura;
|
||||||
public int swigCounter;
|
public int swigCounter;
|
||||||
private int swigs = 0;
|
private GameController gameController;
|
||||||
|
|
||||||
|
void Start() {
|
||||||
|
GameObject gameControllerObject = GameObject.FindWithTag("GameController");
|
||||||
|
|
||||||
|
if (gameControllerObject != null)
|
||||||
|
gameController = gameControllerObject.GetComponent <GameController> ();
|
||||||
|
else
|
||||||
|
Debug.Log("Cannot find GameController script.");
|
||||||
|
}
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
if (Input.GetButton("Fire1") && Time.time > nextFire)
|
if (Input.GetButton("Fire1") && Time.time > nextFire)
|
||||||
{
|
{
|
||||||
//audio.Play ();
|
|
||||||
nextFire = Time.time + delay;
|
nextFire = Time.time + delay;
|
||||||
Instantiate(shank, shankSpawn.position, playerAngle.rotation);
|
Instantiate(shank, shankSpawn.position, playerAngle.rotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Input.GetButton("ActivateVV") && swigs < swigCounter && Time.time > nextFire)
|
if (Input.GetButton("ActivateVV") && gameController.swigs > 0 && Time.time > nextFire)
|
||||||
{
|
{
|
||||||
nextFire = Time.time + delay * 2;
|
nextFire = Time.time + delay * 2;
|
||||||
Instantiate (vvAura, rigidbody.position, rigidbody.rotation);
|
Instantiate (vvAura, rigidbody.position, rigidbody.rotation);
|
||||||
swigs++;
|
gameController.TakeSwig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -36,11 +44,11 @@ public class PlayerController : MonoBehaviour {
|
||||||
|
|
||||||
if (moveHorizontal < 0)
|
if (moveHorizontal < 0)
|
||||||
playerAngle.eulerAngles = new Vector3(0f, -180f, 0f);
|
playerAngle.eulerAngles = new Vector3(0f, -180f, 0f);
|
||||||
else if (moveHorizontal > 0)
|
if (moveHorizontal > 0)
|
||||||
playerAngle.eulerAngles = new Vector3(0f, 0f, 0f);
|
playerAngle.eulerAngles = new Vector3(0f, 0f, 0f);
|
||||||
else if (moveVertical < 0)
|
if (moveVertical < 0)
|
||||||
playerAngle.eulerAngles = new Vector3(0f, -270f, 0f);
|
playerAngle.eulerAngles = new Vector3(0f, -270f, 0f);
|
||||||
else if (moveVertical > 0)
|
if (moveVertical > 0)
|
||||||
playerAngle.eulerAngles = new Vector3(0f, -90f, 0f);
|
playerAngle.eulerAngles = new Vector3(0f, -90f, 0f);
|
||||||
|
|
||||||
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
|
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@ Material:
|
||||||
first:
|
first:
|
||||||
name: _MainTex
|
name: _MainTex
|
||||||
second:
|
second:
|
||||||
m_Texture: {fileID: 2800000, guid: f24a3f9e912f9b14b98097a9d998cfbc, type: 3}
|
m_Texture: {fileID: 2800000, guid: 26c9dff0fed396341b045e42e3a0b500, type: 3}
|
||||||
m_Scale: {x: 2, y: 1}
|
m_Scale: {x: 1, y: .5}
|
||||||
m_Offset: {x: 0, y: 0}
|
m_Offset: {x: 0, y: 0}
|
||||||
m_Floats: {}
|
m_Floats: {}
|
||||||
m_Colors:
|
m_Colors:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue