示例#1
0
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //	* New Method: Draw Button Options
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    protected void DrawButtonOptions()
    {
        if (Target.NormalMode)        // NORMAL CYMBAL
        {
            EditorGUILayout.LabelField("~Normal Cymbal~");
            if (GUILayout.Button(new GUIContent("Copy Sprite to \"Normal Cymbal\" Sprite", "whatever sprite is attached to the sprite renderer currently will be applied as the new \"Normal Sprite\" for this cymbal.")))
            {
                Target.m_sprUnPressedSprite = Target.GetComponent <SpriteRenderer>().sprite;
            }
            if (GUILayout.Button(new GUIContent("Lock \"Normal Cymbal\" Pos Coordinates", "Whatever the current position coordinates are will be applied to the \"Normal Cymbal\" as it's position to switch to whilst animating between \"touched\" and \"normal\" modes.")))
            {
                Target.m_vNormalPos = Target.transform.localPosition;
            }
            if (GUILayout.Button(new GUIContent("Lock \"Normal Cymbal\" Rotation Coordinates", "Whatever the current rotation coordinates are will be applied to the \"Normal Cymbal\" as it's rotation to switch to whilst animating between \"touched\" and \"normal\" modes.")))
            {
                Target.m_vNormalRotation = Target.transform.localRotation.eulerAngles;
            }
        }
        else                                    // TOUCHED CYMBAL
        {
            EditorGUILayout.LabelField("~Touched Cymbal~");
            if (GUILayout.Button(new GUIContent("Copy Sprite to \"Touched Cymbal\" Sprite", "whatever sprite is attached to the sprite renderer currently will be applied as the new \"Touched Sprite\" for this cymbal.")))
            {
                Target.m_sprPressedSprite = Target.GetComponent <SpriteRenderer>().sprite;
            }
            if (GUILayout.Button(new GUIContent("Lock \"Touched Cymbal\" Pos Coordinates", "Whatever the current position coordinates are will be applied to the \"Touched Cymbal\" as it's position to switch to whilst animating between \"touched\" and \"normal\" modes.")))
            {
                Target.m_vShakePos = Target.transform.localPosition;
            }
            if (GUILayout.Button(new GUIContent("Lock \"Touched Cymbal\" Rotation Coordinates", "Whatever the current rotation coordinates are will be applied to the \"Touched Cymbal\" as it's rotation to switch to whilst animating between \"touched\" and \"normal\" modes.")))
            {
                Target.m_vShakeRotation = Target.transform.localRotation.eulerAngles;
            }
        }

        // Switch between the two modes!
        if (GUILayout.Button(new GUIContent("Toggle Sprite", "Toggle between the \"Normal Cymbal\" and \"Touched Cymbal\" modes. Revealing different options")))
        {
            Target.ToggleSprite();
        }

        // If wanting to hear what this cymbal sounds like; here's the code to interact with the TambourineSoundManager (AKA: The SoundBank)
        AddSpaces(3);
        if (Target.m_sprUnPressedSprite != null)
        {
            InstrumentManager.InstrumentMode eTambMode = (Target.m_sprUnPressedSprite.name.ToUpper().Contains("RIQ") ? InstrumentManager.InstrumentMode.RIQ_TAMBOURINE : (Target.m_sprUnPressedSprite.name.ToUpper().Contains("KANJIRA") ? InstrumentManager.InstrumentMode.KANJIRA_TAMBOURINE : InstrumentManager.InstrumentMode.PANDEIRO_TAMBOURINE));
            DrawAudioClipOption("Selected Tambourine Sound (Readonly):", Target.m_rSoundManager.GetTambourineSound(eTambMode, Target.m_eSoundType), "The AudioCLip Associated with this Tambourine Cymbal");
        }
    }
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //	* Derived Method: On Enable
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    protected override void OnEnable()
    {
        base.OnEnable();

        float newTambSize = 0.731f;

        m_bPriorTambTargetsVisible = m_rInstrumentManager.InstrumentColoursManager.Visible;
        m_ePriorInstrumentMode     = (InstrumentManager.InstrumentMode)SavedPreferenceTool.GetInt("InstrumentMode");
        m_fPriorShakeSensitivity   = SavedPreferenceTool.GetFloat("SensitivityPreference", 1.0f);
        m_fPriorInstrumentSize     = SavedPreferenceTool.GetFloat("SizePreference", newTambSize);

        m_rInstrumentManager.CurrentInstrumentMode = InstrumentManager.InstrumentMode.RIQ_TAMBOURINE;
        m_rShakeDetector.ShakeSensitivity          = 1.0f;
        m_rTambourineZoomHandler.SetValue(newTambSize);
    }
示例#3
0
    public AudioClip GetTambourineSound(InstrumentManager.InstrumentMode eTambourineType, SoundTypes eSoundType)
    {
        // Full Version of App!
        //if(GameManager.IsFullVersion)
        //{
        switch (eTambourineType)
        {
        case InstrumentManager.InstrumentMode.NORMAL_TAMBOURINE:        return(m_aacNormalTambourineSounds[(int)eSoundType]);

        case InstrumentManager.InstrumentMode.PANDEIRO_TAMBOURINE:      return(m_aacPandeiroTambourineSounds[(int)eSoundType]);

        case InstrumentManager.InstrumentMode.KANJIRA_TAMBOURINE:       return(m_aacKanjiraTambourineSounds[(int)eSoundType]);

        default:                                                                                                        return(m_aacRiqTambourineSounds[(int)eSoundType]);
        }
        //}

        // Lite Version Only!
        //return m_aacRiqTambourineSounds[(int)eSoundType];
    }
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //	* Overwritten Method: Draw Inspector Options
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    protected override void DrawInspectorOptions()
    {
        if (GUILayout.Button(new GUIContent("Create From MIDI File", "Create challenge using a information provided via a Midi File")))
        {
            Target.UseMidiForAutoPlacement();
        }
        if (GUILayout.Button(new GUIContent("Import Challenge Info Text File", "Read Information regarding the challenge from a text file")))
        {
            ImportChallengeInfoTextFile();
        }

        Target.m_rGameManager                 = DrawObjectOption("Challenge Game Manager Ref: ", Target.m_rGameManager, "Reference to the Challenge Game Manager, which will be used to change the current Instrument and start/stop challenges");
        Target.m_rChallengeTitleText          = DrawObjectOption("Challenge Name Text Ref: ", Target.m_rChallengeTitleText, "Reference to the TextRenderer which will display the name of this challenge");
        Target.m_rInstrumentSoundTypeRenderer = DrawObjectOption("Instrument Sound Type SprRenderer: ", Target.m_rInstrumentSoundTypeRenderer, "Reference to the SpriteRenderer which will show the Instrument that is to be used during this Challenge");
        //Target.m_rPracticeButton				= DrawObjectOption("\"Example\" Button Ref: ", Target.m_rPracticeButton, "Reference to the Challenge \"Example\" Button which will have it's \"Current Challenge\" reference changed to the reference of this Challenge");
        Target.m_rSoundsRhythmMemoryGame = DrawObjectOption("Rhythm Game Ref: ", Target.m_rSoundsRhythmMemoryGame, "Reference to the Rhythm Game, so that when this challenge is called so show an example. It can tell the RhythmGame How to perform it");
        AddSpaces(1);
        Target.m_goChallengeNotePrefab = DrawObjectOption("Challenge Note Prefab: ", Target.m_goChallengeNotePrefab, "Reference to the Challenge Note Prefab, so that this script can Generate/Build challenges for us.");
        AddSpaces(3);
        Target.m_ePlaylistTrack = (SoundsRhythmMemoryGame.Playlist)Mathf.Clamp((int)((SoundsRhythmMemoryGame.Playlist)EditorGUILayout.EnumPopup(new GUIContent("Representing Track: ", "Which challenge is this object supposed to represent"), Target.m_ePlaylistTrack)), 0, (int)SoundsRhythmMemoryGame.Playlist.TOTAL_PLAYLISTS - 1);


        if (Target.m_rInstrumentSoundTypeRenderer != null)
        {
            InstrumentManager.InstrumentMode eTambMode = (InstrumentManager.InstrumentMode)EditorGUILayout.EnumPopup(new GUIContent("Instrument Type: ", "Which Instrument should be active when this challenge is in effect?"), Target.m_eInstrumentSoundType);
            if (eTambMode != Target.m_eInstrumentSoundType)
            {
                Target.m_eInstrumentSoundType   = eTambMode;
                Target.m_sprInstrumentSoundType = (eTambMode == InstrumentManager.InstrumentMode.NORMAL_TAMBOURINE)       ?       Target.m_sprNormalTambourine :
                                                  (eTambMode == InstrumentManager.InstrumentMode.KANJIRA_TAMBOURINE)      ?       Target.m_sprKanjiraTambourine :
                                                  (eTambMode == InstrumentManager.InstrumentMode.PANDEIRO_TAMBOURINE)     ?       Target.m_sprPandeiroTambourine :
                                                  Target.m_sprRiqTambourine;
                Target.m_rInstrumentSoundTypeRenderer.sprite = Target.m_sprInstrumentSoundType;
            }
        }
    }
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //	* Derived Method: On Enabled
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 void OnEnable()
 {
     m_eInstrumentBeforeChange = m_rInstrumentManager.CurrentInstrumentMode;
 }
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //	* New Method: Set Current Instrument
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 public void SetCurrentInstrument(InstrumentManager.InstrumentMode newInstrument)
 {
     m_rInstrumentManager.CurrentInstrumentMode = newInstrument;
 }
示例#7
0
 public int PlayTambourineSound(InstrumentManager.InstrumentMode eTambourineType, SoundTypes eSoundType)
 {
     return(AudioSourceManager.PlayAudioClip(GetTambourineSound(eTambourineType, eSoundType)));
 }