Exemplo n.º 1
0
    public static void SetCheckPointValue(DLC_Checkpoint checkPoint)
    {
        var cpController = GameObject.FindObjectOfType <DLC_CheckPointController>();
        var array        = cpController.manualCheckpoints;

        if (array.Length != 0)
        {
            if (checkPointList == null)
            {
                checkPointList = new bool[array.Length];
                for (var i = 0; i < array.Length; i++)
                {
                    checkPointList[i] = true;
                }
            }

            for (var i = 0; i < array.Length; i++)
            {
                if (array[i] == checkPoint)
                {
                    checkPointList[i] = false;
                }
            }
        }
    }
Exemplo n.º 2
0
 public static bool FindCheckPointValue(DLC_Checkpoint checkPoint)
 {
     if (checkPointList == null)
     {
         Debug.Log("didn't have a dictionary set up");
         return(true);
     }
     else
     {
         var cpController = GameObject.FindObjectOfType <DLC_CheckPointController>();
         var array        = cpController.manualCheckpoints;
         if (array.Length != 0)
         {
             for (var i = 0; i < array.Length; i++)
             {
                 if (array[i] == checkPoint)
                 {
                     if (checkPointList[i] == false)
                     {
                         return(false);
                     }
                     else
                     {
                         Debug.Log("Didn't have that value in the dictionary");  return(true);
                     }
                 }
             }
             Debug.Log("Didn't find the component in the array");
             return(true);
         }
         else
         {
             Debug.Log("array length is zero");  return(true);
         }
     }
 }