Beispiel #1
0
 public void RotateThemTiles(BaseTile TileToExclude)
 {
     foreach (Transform CurrentChild in CurrentLevel.transform)
     {
         if (CurrentChild.GetComponent <BaseTile>() && CurrentChild.GetComponent <BaseTile>().GetTileRole() == TileRoles.Rotating &&
             CurrentChild.gameObject != TileToExclude.gameObject)
         {
             if (CurrentChild.GetComponent <BaseTile>().ThisTileRotation == TileRotation.Clockwise)
             {
                 QueueNewRotation(RotateTileSo.Clockwise, TileRotationReason.Remote, CurrentChild.GetComponent <BaseTile>());
             }
             else
             {
                 QueueNewRotation(RotateTileSo.AntiClockwise, TileRotationReason.Remote, CurrentChild.GetComponent <BaseTile>());
             }
         }
     }
 }
Beispiel #2
0
    public void UngroupTiles(BaseTile ParentTile)
    {
        List <GameObject> AllGrouped = new List <GameObject>();

        foreach (Transform CurrentChild in ParentTile.transform)
        {
            if (CurrentChild.GetComponent <BaseTile>())
            {
                AllGrouped.Add(CurrentChild.gameObject);
            }
        }

        foreach (GameObject CurrTile in AllGrouped)
        {
            CurrTile.transform.parent = ParentTile.transform.parent;
            CurrTile.GetComponent <BaseTile>().ShadowParented(false);
            CurrTile.GetComponent <BaseTile>().RealignAxles();
        }

        BindPositionToTile(false);
    }