コード例 #1
0
 /// <summary>
 /// Checks interaction with the braziers
 /// Returns true if dialogue will be displayed
 /// </summary>
 protected bool CheckBraziers()
 {
     //Loop through braziers
     for (int i = 0; i < braziers.Length; ++i)
     {
         //Check to see if you're within range (and in the same level)
         if (braziers[i].gameObject.activeInHierarchy && (braziers[i].transform.position - player.transform.position).sqrMagnitude <= Mathf.Pow(interactRange, 2f))
         {
             //Make shadow people hate you
             flags.FlagList[FlagManager.FlagNames.EnemyOfShadow] = true;
             //Light up the brazier
             string result = braziers[i].IgniteBrazier();
             if (result != null)
             {
                 flags.ActivateDialogueLines(result);
                 return(true);
             }
         }
     }
     return(false);
 }