public IEnumerator SabotageStarted(Sabotageable sabotageable) { this.sabotageable = sabotageable; StartCoroutine(NotifySabotage()); // Wait till sabotage starts yield return(new WaitForSeconds(5)); // Start sabotage timer timerManager.StartTimer(Timer.sabotageTimer); // Play music sabotageMusic.Play(); // Update UI sabotageMiddleUI.SetActive(true); taskUI.SetActive(false); taskNotificationUI.SetActive(false); warningText.gameObject.SetActive(true); sabotageUI.SetActive(true); // Set task marker PlayableCharacter me = NetworkManager.instance.GetMe(); if (me is Loyal) { me.DisableTaskMarker(); } yield return(new WaitForSeconds(7)); warningText.gameObject.SetActive(false); }
public void SetValues(Sabotageable sabotageable) { float fractionCompleted = sabotageable.startingAmountToFix - sabotageable.amountToFix; countdownCircle.fillAmount = fractionCompleted / sabotageable.startingAmountToFix; countdownText.text = (int)fractionCompleted + "%"; }
private void Update() { Sabotageable sabotageable = sabotageManager.sabotageable; if (sabotageable != null) { Debug.Log("Setting values"); SetValues(sabotageable); } }
// private float fillAmount = 1.0f; private void OnEnable() { sabotageManager = GameObject.Find("/SabotageManager").GetComponent <SabotageManager>(); Sabotageable sabotageable = sabotageManager.sabotageable; }
// Adds overlay to screen to show sabotage is happening public void SetBackgroundImageColor(Sabotageable sabotageable) { colorOverlay.color = sabotageable.color; warningText.text = sabotageable.warningText; sabotageInfoTMP.text = sabotageable.infoText; }
//Ends the player fixing a given sabotageable public virtual void StopFix(Sabotageable item) { currentFixingItem = null; }
//Starts the player fixing a given sabotageable public virtual void Fix(Sabotageable item) { currentFixingItem = item; }