/// <summary>
 /// Sorts the depth objects by depth, rendering those with lower values first
 /// </summary>
 /// <param name="first"></param>
 /// <param name="second"></param>
 /// <returns></returns>
 private int SortObjects(DepthObject first, DepthObject second)
 {
     if (first.Depth < second.Depth)
     {
         return(-1);
     }
     else if (first.Depth > second.Depth)
     {
         return(1);
     }
     return(0);
 }
コード例 #2
0
    int Compare(DepthObject d0, DepthObject d1)
    {
        float d0x = d0.transform.position.x;
        float d0y = d0.transform.position.y;

        float d1x = d1.transform.position.x;
        float d1y = d1.transform.position.y;

        if (d0y != d1y)
        {
            return(d0y.CompareTo(d1y));
        }

        return(d0x.CompareTo(d1x));
    }
コード例 #3
0
 public void Unregister(DepthObject depthObject)
 {
     _objects.Remove(depthObject);
 }
コード例 #4
0
 public void Register(DepthObject depthObject)
 {
     _objects.Add(depthObject);
 }