Ejemplo n.º 1
0
 private void CheckAllAtOnce(ObjectPaint tulp)
 {
     foreach (var paint in tulp.PaintAmounts)
     {
         paint.StartUpdate();
         paint.Amount = 0;
     }
     try
     {
         CheckObject(tulp);
     }
     catch (NullReferenceException e)
     {
         Debug.Log("Property is null", tulp.Mesh.gameObject);
         throw e;
     }
     finally
     {
         foreach (var paint in tulp.PaintAmounts)
         {
             paint.FinishUpdate();
         }
         tulp.Mesh.CheckedForPaint();
     }
 }
Ejemplo n.º 2
0
 private static void PostCheck(ObjectPaint tulp, TexturePartInfo item = null)
 {
     foreach (var paint in tulp.PaintAmounts)
     {
         if (item != null)
         {
             paint.Amount += (ulong)item.GetSize();
         }
         paint.FinishUpdate();
     }
     tulp.Mesh.CheckedForPaint();
 }
Ejemplo n.º 3
0
 private static Color32[] GetPixelArray(ObjectPaint tulp, TexturePartInfo item)
 {
     if (item != null)
     {
         var temporary = tulp.Mesh.Countable.GetPixels32();
         return(GraphicsL.GetPartOfArray(temporary, tulp.Mesh.Countable.height, item.Start.x, item.Start.y, item.Finish.x, item.Finish.y));
     }
     else
     {
         return(tulp.Mesh.Countable.GetPixels32());
     }
 }
Ejemplo n.º 4
0
 private static void CheckObject(ObjectPaint tulp, TexturePartInfo item = null)
 {
     Color32[] textureToCheck = GetPixelArray(tulp, item);
     foreach (var colorToCheck in textureToCheck)
     {
         foreach (var checkFor in tulp.PaintAmounts)
         {
             if (GraphicsL.CheckIfEqualColors(colorToCheck, checkFor.Color))
             {
                 checkFor.Amount++;
             }
         }
     }
 }
Ejemplo n.º 5
0
 private void HandleObject(ObjectPaint tulp)
 {
     if (tulp.Mesh.Changed)
     {
         if (tulp.Mesh.TextureSize < CHECK_ALL_UPPER_LIMIT)
         {
             CheckAllAtOnce(tulp);
         }
         else
         {
             CheckModifiedParts(tulp);
         }
     }
 }
Ejemplo n.º 6
0
 private static void PreCheck(ObjectPaint tulp, TexturePartInfo item = null)
 {
     foreach (var paint in tulp.PaintAmounts)
     {
         paint.StartUpdate();
         if (item == null)
         {
             paint.Amount = 0;
         }
         else
         {
             paint.Amount = paint.MaxAmount - (ulong)item.GetSize();
         }
     }
 }
Ejemplo n.º 7
0
        private ObjectPaint CreateTulp(PaintableMesh mesh)
        {
            var Tulp = new ObjectPaint();

            Tulp.Mesh = mesh;

            var list = new List <LocalPaintAmount>();

            foreach (var Global in GlobalPaintAmounts)
            {
                LocalPaintAmount a = new LocalPaintAmount(Global);
                list.Add(a);
            }
            Tulp.PaintAmounts = list.ToArray();
            return(Tulp);
        }
Ejemplo n.º 8
0
 private void CheckModifiedParts(ObjectPaint tulp)
 {
     throw new NotImplementedException();
 }