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);
    }
Пример #2
0
    public void SetValues(Sabotageable sabotageable)
    {
        float fractionCompleted = sabotageable.startingAmountToFix - sabotageable.amountToFix;

        countdownCircle.fillAmount = fractionCompleted / sabotageable.startingAmountToFix;
        countdownText.text         = (int)fractionCompleted + "%";
    }
Пример #3
0
    private void Update()
    {
        Sabotageable sabotageable = sabotageManager.sabotageable;

        if (sabotageable != null)
        {
            Debug.Log("Setting values");
            SetValues(sabotageable);
        }
    }
Пример #4
0
 // 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;
 }
Пример #6
0
 //Ends the player fixing a given sabotageable
 public virtual void StopFix(Sabotageable item)
 {
     currentFixingItem = null;
 }
Пример #7
0
 //Starts the player fixing a given sabotageable
 public virtual void Fix(Sabotageable item)
 {
     currentFixingItem = item;
 }