示例#1
0
 void Update()
 {
     if (_protagonistScript != null)
     {
         UISanityBar.Instance.SetValue(_protagonistScript.GetSanity() / _maxSanity);
         UILightBar.Instance.SetValue(_protagonistScript.GetLightIntensity() / _maxLight);
     }
 }
示例#2
0
    public IEnumerator LoadProtagonistInfos(float delay)
    {
        _protagonistScript = null;
        yield return(new WaitForSeconds(delay));

        GameObject protagonist = GameObject.FindWithTag("Player");

        _protagonistScript = protagonist.GetComponent <ProtagonistScript>();
        _maxSanity         = _protagonistScript.GetSanity();
        _maxLight          = _protagonistScript.GetLightIntensity();

        UISanityBar.Instance.SetValue(1);
        UILightBar.Instance.SetValue(1);

        //Le texte disparait si le joueur quitte le radius du boss
        StartCoroutine("ShowBossTextToPlayer", 0.5f);
    }