private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.name == "VaporDeathCollider") { if (returnToSpawn == true) { if (platform != null) { transform.position = platform.transform.position + new Vector3(0, 1f, 0); } else { transform.position = startPosition; } rb.velocity = new Vector2(0, 0); } } if (collision.tag == "CondensationArea") { manager.SetCondensedVapour(manager.GetCondensedVapour() + 1); manager.ChangeCloudColour(); Destroy(gameObject); } }
protected override void Start() { base.Start(); manager = managerObj.GetComponent <ILevelManagerCondensation>(); //condensation bar condensationBar = this.transform.GetChild(4).gameObject.GetComponent <ProgressBar>(); setInitialBarValues(condensationBar, manager.GetCondensedVapour(), manager.GetCondensedVapourNeeded()); }
protected override void Update() { base.Update(); condensationBar.BarValue = manager.GetCondensedVapour(); }