Commit 3dfc6d4a authored by Mitchie Maluschnig's avatar Mitchie Maluschnig
Browse files

gave indicator text whenever time is added or removed

parent 2b919a9e
......@@ -149,6 +149,8 @@ MonoBehaviour:
specialItem: {fileID: 1649884426353186}
OnCollectParticles: {fileID: 1290046360213332, guid: 107a7a15d7e65914d89e2647ad01e920,
type: 2}
textParticles: {fileID: 1044449210632190, guid: bf8747e4259d9bd46acdd2b6e3588586,
type: 2}
--- !u!212 &212344781101984214
SpriteRenderer:
m_ObjectHideFlags: 1
......
......@@ -1322,8 +1322,8 @@ ParticleSystem:
maxColor: {r: 1, g: 1, b: 1, a: 1}
maxGradient:
serializedVersion: 2
key0: {r: 0, g: 1, b: 0, a: 1}
key1: {r: 0, g: 1, b: 0, a: 0}
key0: {r: 1, g: 1, b: 1, a: 1}
key1: {r: 1, g: 1, b: 1, a: 0}
key2: {r: 1, g: 1, b: 1, a: 0}
key3: {r: 0, g: 0, b: 0, a: 0}
key4: {r: 0, g: 0, b: 0, a: 0}
......
......@@ -329,7 +329,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1345098002592372}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 7.14, z: 0}
m_LocalPosition: {x: 0, y: 9.34, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4078250888816992}
......@@ -351,7 +351,7 @@ Transform:
m_GameObject: {fileID: 1050029343530560}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -50, y: 5.8, z: 0}
m_LocalScale: {x: 8, y: 8, z: 1}
m_LocalScale: {x: 5, y: 5, z: 1}
m_Children:
- {fileID: 4294090477210918}
- {fileID: 4802455543859232}
......
......@@ -1170,7 +1170,7 @@ GameObject:
- component: {fileID: 1055966192}
m_Layer: 0
m_Name: ParticleText
m_TagString: Untagged
m_TagString: Perfect
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
......@@ -1533,18 +1533,6 @@ Prefab:
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4872350856089052, guid: a13b0bed2e5711a4fbda550f1ba732b7, type: 2}
propertyPath: m_LocalScale.x
value: 5
objectReference: {fileID: 0}
- target: {fileID: 4872350856089052, guid: a13b0bed2e5711a4fbda550f1ba732b7, type: 2}
propertyPath: m_LocalScale.y
value: 5
objectReference: {fileID: 0}
- target: {fileID: 4852310194904870, guid: a13b0bed2e5711a4fbda550f1ba732b7, type: 2}
propertyPath: m_LocalPosition.y
value: 9.34
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a13b0bed2e5711a4fbda550f1ba732b7, type: 2}
m_IsPrefabAsset: 0
......@@ -1968,7 +1956,7 @@ Transform:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1817158840}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -53.23, y: -7.87, z: 338.2461}
m_LocalPosition: {x: -84.19, y: -7.87, z: 338.2461}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 906334283}
......@@ -2065,6 +2053,9 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
player: {fileID: 95257389}
text: {fileID: 1055966192}
textParticles: {fileID: 1044449210632190, guid: bf8747e4259d9bd46acdd2b6e3588586,
type: 2}
--- !u!61 &2023603710
BoxCollider2D:
m_ObjectHideFlags: 0
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class FollowPlayerx : MonoBehaviour {
......@@ -8,6 +9,10 @@ public class FollowPlayerx : MonoBehaviour {
private Animator anim;
private bool facingRight;
public Text text;
public GameObject textParticles;
// Use this for initialization
void Start () {
anim = GetComponentInChildren<Animator>();
......@@ -48,7 +53,13 @@ public class FollowPlayerx : MonoBehaviour {
gameObject.GetComponent<AudioSource>().Play();
if (!FindObjectOfType<TrapezeTutorial>())
{
TrapezeController.AddTime(-5f);
if (collision.gameObject.tag == "Player") {
TrapezeController.AddTime(-5f);
text.text = "-5 Seconds";
GameObject particles = Instantiate(textParticles, Camera.main.transform);
var m = particles.GetComponent<ParticleSystem>().main;
m.startColor = Color.red;
}
}
}
}
......@@ -28,10 +28,12 @@ public class HandsTrigger : MonoBehaviour {
lastTrapeze = collision.gameObject;
trapezePerson.AttachToTrapeze(collision.gameObject);
//tutorial stuff
if(collision.gameObject.tag == "Silas") {
GameObject.FindWithTag("LevelMaster").GetComponent<TrapezeTutorial>().landed(false);
}else if(collision.gameObject.tag == "Pie") {
GameObject.FindWithTag("LevelMaster").GetComponent<TrapezeTutorial>().landed(true);
if (GameManager.JohnTutorial) {
if (collision.gameObject.tag == "Silas") {
GameObject.FindWithTag("LevelMaster").GetComponent<TrapezeTutorial>().landed(false);
} else if (collision.gameObject.tag == "Pie") {
GameObject.FindWithTag("LevelMaster").GetComponent<TrapezeTutorial>().landed(true);
}
}
}
}
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class SpecialTrapeze : MonoBehaviour {
public int points = 100;
......@@ -11,9 +12,12 @@ public class SpecialTrapeze : MonoBehaviour {
public GameObject specialItem;
public GameObject OnCollectParticles;
private Text text;
public GameObject textParticles;
// Use this for initialization
void Start () {
text = GameObject.FindWithTag("Perfect").GetComponent<Text>();
}
// Update is called once per frame
......@@ -29,6 +33,11 @@ public class SpecialTrapeze : MonoBehaviour {
TrapezeController.AddTime(TimeBonus);
specialItem.SetActive(false);
Instantiate(OnCollectParticles, transform);
text.text = "+5 Seconds";
GameObject particles = Instantiate(textParticles, Camera.main.transform);
var m = particles.GetComponent<ParticleSystem>().main;
m.startColor = Color.green;
}
}
}
......@@ -147,10 +147,10 @@ public class TrapezePerson : MonoBehaviour {
int flips = rotations.rotations;
if (flips != prevFlip && !onTrapeze) {
if(flips > 0) {
flipText.text = "Back Flip";
flipText.text = "Back Flip\n+1 Second";
Instantiate(flipParticles, Camera.main.transform);
} else {
flipText.text = "Front Flip";
flipText.text = "Front Flip\n+1 Second";
Instantiate(flipParticles, Camera.main.transform);
}
TrapezeController.score += 10 * Mathf.Abs(flips);
......
......@@ -83,6 +83,7 @@ public class TrapezeTutorial : MonoBehaviour {
if (state < 9) {
progress();
} else {
GameManager.JohnTutorial = false;
SceneManager.LoadScene("Trapeze");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment