Exemplo n.º 1
0
 public static void ShowSuperGlue(Contraption contraption, Type type, List <BasePart> parts)
 {
     foreach (BasePart basePart in parts)
     {
         if (Glue.IsPartTypeRequireGlue(basePart.m_partType))
         {
             BasePart anotherPart  = contraption.FindPartAt(basePart.m_coordX - 1, basePart.m_coordY);
             BasePart anotherPart2 = contraption.FindPartAt(basePart.m_coordX + 1, basePart.m_coordY);
             BasePart anotherPart3 = contraption.FindPartAt(basePart.m_coordX, basePart.m_coordY - 1);
             BasePart anotherPart4 = contraption.FindPartAt(basePart.m_coordX, basePart.m_coordY + 1);
             Glue     exists       = basePart.GetComponent <Glue>();
             if (exists == null)
             {
                 exists = basePart.gameObject.AddComponent <Glue>();
             }
             Glue.CheckSideAndAppendGlue(basePart, anotherPart, Glue.Direction.Left, type);
             Glue.CheckSideAndAppendGlue(basePart, anotherPart2, Glue.Direction.Right, type);
             Glue.CheckSideAndAppendGlue(basePart, anotherPart4, Glue.Direction.Up, type);
             Glue.CheckSideAndAppendGlue(basePart, anotherPart3, Glue.Direction.Down, type);
         }
     }
 }