コード例 #1
0
 public bool Setup(Targeting t, BoolDelegate endResult)
 {
     current    = t;
     returnCall = endResult;
     //current = t.Initialize();
     if (current.BeginTargetting(Player.player.location, LOS.lastCall))
     {
         if (highlights != null)
         {
             if (highlights.GetLength(0) != current.length || highlights.GetLength(1) != current.length)
             {
                 foreach (HighlightBlock h in highlights)
                 {
                     Destroy(h.gameObject);
                 }
                 BuildArea();
             }
         }
         else
         {
             BuildArea();
         }
         for (int i = 0; i < current.length; i++)
         {
             for (int j = 0; j < current.length; j++)
             {
                 //Debug pattern
                 highlights[i, j].Hide();
             }
         }
         return(true);
     }
     else
     {
         Debug.Log("UI asked to quit early, so locking point in now");
         if (!current.LockPoint()) //UI thinks we don't even need it, so just skip this whole thing
         {
             Debug.LogError("Targeting item that skips can NOT have more than one point! This is unecessary behaviour, and must be fixed immediately to maintain invariants.");
             #if UNITY_EDITOR
             UnityEditor.EditorApplication.isPlaying = false;
             #endif
         }
         return(false);
     }
 }