Exemplo n.º 1
0
    private VirtualInstrumentManager mVIM = null;        //!< The virtual instrument manager

    /*************************************************************************//**
     * @}
     * @defgroup SCMUnity Unity Functions
     * @ingroup DocSCM
     * These are functions called automatically by Unity.
     * @{
     ******************************************************************************/

    /**
     * @brief Initializes the @link DocSC Song Creation Interface@endlink by getting references to all of the modules within the scene.
     */
    void Awake()
    {
        // Initialize the song.
        mSong = new Song();

        // Get the virtual instrument manager.
        mVIM = GameObject.Find("VirtualInstrumentManager").GetComponent <VirtualInstrumentManager>();

        // Set up the container for showing the song's notes.
        mNoteDisplay = gameObject.transform.GetChild(1).GetChild(0).GetChild(0).gameObject.AddComponent <SC_NoteDisplayContainer>();

        // Set up the slider for the song's default BPM.
        mBPMSlider = gameObject.transform.GetChild(2).GetChild(2).gameObject.AddComponent <SC_InputFieldAndSlider>();
        mBPMSlider.SetReferenceToInputField(transform.GetChild(2).GetChild(1).GetComponent <InputField>());
        mBPMSlider.SetAsInt(true);
        mBPMSlider.ValueChanged.AddListener(OnBPMChange);

        // Set up the input field for naming the song.
        mSongNameInputField = gameObject.transform.GetChild(3).gameObject.GetComponent <InputField>();
        mSongNameInputField.onEndEdit.AddListener(mSong.SetName);

        // Set up the buttons.
        mNewNoteButton = gameObject.transform.GetChild(5).GetChild(1).gameObject.GetComponent <Button>();
        mNewNoteButton.onClick.AddListener(OnNewNoteButtonClicked);
        mSaveSongButton = gameObject.transform.GetChild(5).GetChild(2).gameObject.GetComponent <Button>();
        mSaveSongButton.onClick.AddListener(OnSaveSong);
        mPlaySongButton = gameObject.transform.GetChild(5).GetChild(0).GetComponent <Button>();
        mPlaySongButton.onClick.AddListener(OnPlaySong);
        mATIButton = gameObject.transform.GetChild(4).GetComponent <Button>();
        mATIButton.onClick.AddListener(UnloadSongCreationInterface);
        mLoadSongButton = transform.GetChild(5).GetChild(3).GetComponent <Button>();
        mLoadSongButton.onClick.AddListener(OnLoadSongButtonClicked);
    }
Exemplo n.º 2
0
 /**
  * @brief Sets the @link DocSC_NDC parent container@endlink.
  * @param[in] aParent The @link DocSC_NDC parent container@endlink.
  */
 public void SetParentContainer(SC_NoteDisplayContainer aParent)
 {
     // Set the parent.
     mParent = aParent;
 }