private void TileMovingObjectScript_MoveableMoving(object sender, MoveEventArgs e)
 {
     if (e.ToTile != MoveScript.TilePosition)
     {
         return;
     }
     if ((sender as TileMovingObjectScript).gameObject != gameObject && (sender as TileMovingObjectScript).TryGetComponent <BeachBallBehavior>(out var ball))
     {
         if (!PushableScript.MovementAllowed)
         {
             return;
         }
         MoveScript.MoveInDirection(e.Direction);
         Direction = e.Direction;
         bouncing  = true;
     }
 }
Beispiel #2
0
    bool TryMove(TileMovingObjectScript TileObject, StinkyFile.SRotation Direction)
    {
        bool motionResult = TileObject.MoveInDirection(Direction, 1, 7);

        if (motionResult)
        {
            soundEffects.Play(0);
            var rotator = TileObject.GetComponentInChildren <AngleRotator>();
            if (rotator != null)
            {
                rotator.Rotate(Direction);
            }
        }
        return(motionResult);
    }