using UnityEngine;
using System.Collections;
using System.Collections.Generic;
[ExecuteInEditMode]
public class PieceSpriteRandomiser : MonoBehaviour {
public List<Transform> ObjectPieces = new List<Transform>();
void Awake()
{
}
void OnEnable()
{
foreach (var item in ObjectPieces)
{
var otherRandomPiece = ObjectPieces[Random.Range (0, ObjectPieces.Count - 1)];
var currentPiecePrevPosition = item.position;
item.position = otherRandomPiece.position;
otherRandomPiece.position = currentPiecePrevPosition;
}
}
}