//================================================================================ // //================================================================================ using UnityEngine; using System.Collections; using System.Collections.Generic; //================================================================================ // //================================================================================ namespace ReaderRabbit { //================================================================================ // //================================================================================ public class MarblesLine : MonoBehaviour { //================================================================================ // //================================================================================ [SerializeField] private List m_Marbles; //================================================================================ // //================================================================================ public void StartSinging(int index) { m_Marbles[index].StartSinging(); } //================================================================================ // //================================================================================ public void StopSinging(int index) { m_Marbles[index].StopSinging(); } //================================================================================ // //================================================================================ public void Block(int index) { m_Marbles[index].Block(); } //================================================================================ // //================================================================================ public void Unblock(int index) { m_Marbles[index].Unblock(); } //================================================================================ // //================================================================================ public void EnableMarblesDragging() { foreach (MusicalMarble marble in m_Marbles) { if (!marble.IsBlocked) { marble.EnableDrag(); } } } //================================================================================ // //================================================================================ public void DisableMarblesDragging() { foreach (MusicalMarble marble in m_Marbles) { if (!marble.IsBlocked) { marble.DisableDrag(); } } } //================================================================================ // //================================================================================ public void DeactivateAll() { foreach (MusicalMarble marble in m_Marbles) { marble.gameObject.SetActive(false); } } //================================================================================ // //================================================================================ public void Reset() { DeactivateAll(); } //================================================================================ // //================================================================================ public void SetMarbleActive(bool active, int index) { m_Marbles[index].gameObject.SetActive(active); m_Marbles[index].Unblock(); } //================================================================================ // //================================================================================ public bool IsMarbleActive(int index) { return m_Marbles[index].gameObject.activeSelf; } //================================================================================ // //================================================================================ public bool Contains(MusicalMarble marble) { return m_Marbles.Contains(marble); } //================================================================================ // //================================================================================ public int IndexOf(MusicalMarble marble) { return m_Marbles.IndexOf(marble); } //================================================================================ // //================================================================================ public MusicalMarble GetMarble(int index) { return m_Marbles[index]; } //================================================================================ // //================================================================================ public int NumberOfMarbles { get { return m_Marbles.Count; } } } // public class MarblesLine : MonoBehaviour } // namespace ReaderRabbit