using UnityEngine; namespace Oculus.Platform.Samples.VrBoardGame { public class GamePiece : MonoBehaviour { public enum Piece { A = 0, B = 1, PowerBall = 2 } [SerializeField] private Piece m_type; [SerializeField] private GameObject m_prefabA; [SerializeField] private GameObject m_prefabB; [SerializeField] private GameObject m_prefabPower; private BoardPosition m_position; public Piece Type { get { return m_type; } } public BoardPosition Position { get { return m_position; } set { m_position = value; } } public GameObject Prefab { get { switch (m_type) { case Piece.A: return m_prefabA; case Piece.B: return m_prefabB; default: return m_prefabPower; } } } public GameObject PrefabFor(Piece p) { switch (p) { case Piece.A: return m_prefabA; case Piece.B: return m_prefabB; default: return m_prefabPower; } } } }