// Update is called once per frame void Update() { if (player.Device.Action4.WasPressed) { if (controller.currentBook != null) { int oldIdx = HealthBarUpdater.IndexInPieOrder(controller.currentBook.Kind); controller.currentBook.Kind = HealthBarUpdater.pieOrder[(oldIdx + 1) % 6];//6 = number of book types changeSource.PlayOneShot(changeSound); } } }
private void Awake() { _healthBarUpdater = GetComponent <HealthBarUpdater>(); _healthBarUpdater.HealthBarUIController = this; }