상속: UnityEngine.MonoBehaviour
예제 #1
0
 void Start()
 {
     _backgroundSound       = this.gameObject.AddComponent <FMODUnity.StudioEventEmitter>();
     _backgroundSound.Event = GLOB.OutsidePeopleSound;
     _backgroundSound.EventInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(new Vector3(8, 0, 4)));
     _backgroundSound.Play();
 }
예제 #2
0
파일: Music.cs 프로젝트: apautrot/gdp11
    new void Awake()
    {
        GameObject.DontDestroyOnLoad(gameObject);

        fmodEmitter = GetComponent <FMODUnity.StudioEventEmitter> ();
        Debug.LogWarning("No music component detected. Start the Title Scene to hae music.");
    }
예제 #3
0
    // Start is called before the first frame update
    protected virtual void Start()
    {
        //Add event listener for interactable object.
        if (this is SandSpawner)
        {
            ImpactSound       = this.gameObject.AddComponent <FMODUnity.StudioEventEmitter>();
            ImpactSound.Event = GLOB.JarFallSound;
            ImpactSound.EventInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(this.gameObject.transform));
        }
        if (this is BottleFlip)
        {
            ImpactSound       = this.gameObject.AddComponent <FMODUnity.StudioEventEmitter>();
            ImpactSound.Event = GLOB.BottleFallSound;
            ImpactSound.EventInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(this.gameObject.transform));
        }
        if (this is BouncyBall)
        {
            ImpactSound       = this.gameObject.AddComponent <FMODUnity.StudioEventEmitter>();
            ImpactSound.Event = GLOB.BouncyBallSound;
            ImpactSound.EventInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(this.gameObject.transform));
        }
        GetComponent <VRTK_InteractableObject>().InteractableObjectGrabbed   += new InteractableObjectEventHandler(ObjectGrabbed);
        GetComponent <VRTK_InteractableObject>().InteractableObjectUngrabbed += new InteractableObjectEventHandler(ObjectReleased);

        if (GetComponent <VRTK_InteractableObject>() == null)
        {
            Debug.LogError("Team3_Interactable_Object_Extension is required to be attached to an Object that has the VRTK_InteractableObject script attached to it");
            return;
        }

        rb = GetComponent <Rigidbody>();
        //Adds the time of the spawning of the object (only listening on movement after X amount) This to patch the non-perfect spawns.
        _spawnTime = Time.time;
    }
예제 #4
0
    private GameObject CreatePowerup(Powerup.Type type, Vector3 location)
    {
        FMODUnity.StudioEventEmitter sound = GetComponent <FMODUnity.StudioEventEmitter> ();
        if (sound != null)
        {
            sound.Play();
        }

        GameObject powerup = PowerupModel(type);

        powerup.transform.localScale = Vector3.one * 2;
        powerup.transform.position   = location + transform.position;
        powerup.transform.rotation   = Quaternion.Euler(new Vector3(Random.Range(0, 360), Random.Range(0, 360), Random.Range(0, 360)));


        powerup.AddComponent <Rigidbody>();
        powerup.AddComponent <SphereCollider> ();
        powerup.AddComponent <PowerupController>().type = type;

        ParticleSystem ps = Instantiate(spawnEffect);

        ps.transform.parent        = powerup.transform;
        ps.transform.localPosition = powerup.GetComponent <SphereCollider> ().center;
        ParticleSystem.MinMaxGradient x = ps.main.startColor;
        x.color = Color.red;

        return(powerup);
    }
예제 #5
0
    IEnumerator WheelPuzzleActions()
    {
        Player.GetComponent <CharacterController2D>().MovementEnabled     = false;
        Player.GetComponent <CharacterInteractions>().InteractionsEnabled = false;

        GameObject topLight = GameObject.FindGameObjectWithTag("TopLight");

        topLight.GetComponent <FlickeringLight>().TurnOffLight();

        GameObject doorLight = GameObject.FindGameObjectWithTag("DoorLight");

        doorLight.GetComponent <FMODUnity.StudioEventEmitter>().Play();

        yield return(new WaitForSeconds(2.4f));

        doorLight.GetComponent <Animator>().SetBool("fadein", true);

        GameObject bgMusic = GameObject.FindGameObjectWithTag("BackgroundMusic");

        if (bgMusic)
        {
            FMODUnity.StudioEventEmitter emitter =
                GameObject.FindGameObjectWithTag("BackgroundMusic").GetComponent <FMODUnity.StudioEventEmitter>();
            emitter.SetParameter("Room", 1.0f);
        }

        Player.GetComponent <CharacterController2D>().MovementEnabled     = true;
        Player.GetComponent <CharacterInteractions>().InteractionsEnabled = true;

        GameObject.FindGameObjectWithTag("ExitDoor").GetComponent <BoxCollider2D>().enabled = true;

        yield return(null);
    }
예제 #6
0
    // Start is called before the first frame update
    protected override void Start()
    {
        base.Start();

        _tutorial = GameObject.Find("LightHolders").GetComponent <Tutorial>();

        startRotation = TargetTerrain.transform.eulerAngles;

        IsActive = IsActiveOnAwake;

        this.SetActive(true);
        _tabletShootSound = this.gameObject.AddComponent <FMODUnity.StudioEventEmitter>();
        _tabletstickSound = this.gameObject.AddComponent <FMODUnity.StudioEventEmitter>();

        _tabletShootSound.Event = GLOB.TabletShootSound;
        _tabletstickSound.Event = GLOB.TabletStickSound;

        _tabletShootSound.EventInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(this.gameObject.transform));
        _tabletstickSound.EventInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(this.gameObject.transform));
        this.SetActive(false);
        if (!IsActive)
        {
            HandleActiveState(false);
        }
    }
예제 #7
0
파일: Visualizer.cs 프로젝트: usdivad/AMAI
    void Start()
    {
        lineRenderer = gameObject.AddComponent <LineRenderer>();
        lineRenderer.SetVertexCount(WindowSize);
        lineRenderer.SetWidth(.1f, .1f);

        //musicInstance = FMODUnity.RuntimeManager.CreateInstance("event:/Music/Basic/Random Layered");

        //int instanceID = emitter.GetInstanceID();
        //musicInstance = FMODUnity.RuntimeManager.StudioSystem.getEventByID(instanceID);

        if (emitter == null)
        {
            emitter = GameObject.Find("Music Emitter").GetComponent <FMODUnity.StudioEventEmitter> ();
        }

        musicInstance = emitter.GetInstance();

        FMODUnity.RuntimeManager.LowlevelSystem.createDSPByType(FMOD.DSP_TYPE.FFT, out fft);
        fft.setParameterInt((int)FMOD.DSP_FFT.WINDOWTYPE, (int)FMOD.DSP_FFT_WINDOW.HANNING);
        fft.setParameterInt((int)FMOD.DSP_FFT.WINDOWSIZE, WindowSize * 2);

        FMOD.ChannelGroup channelGroup;
        FMODUnity.RuntimeManager.LowlevelSystem.getMasterChannelGroup(out channelGroup);
        channelGroup.addDSP(FMOD.CHANNELCONTROL_DSP_INDEX.HEAD, fft);

        musicInstance.start();
    }
 // Start is called before the first frame update
 protected override void Start()
 {
     base.Start();
     _sliderSoundSoundEmitter       = this.gameObject.AddComponent <FMODUnity.StudioEventEmitter>();
     _sliderSoundSoundEmitter.Event = GLOB.TouchingSliderSound;
     _sliderSoundSoundEmitter.EventInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(this.gameObject.transform));
 }
예제 #9
0
 private void Awake()
 {
     spawnedVases       = new List <SpawnedVase>();
     spawnedBrokenVases = new List <GameObject>();
     spawnedEnemies     = new List <SpawnedEnemy>();
     musicEv            = GetComponent <FMODUnity.StudioEventEmitter>();
 }
예제 #10
0
 public void PlayEmitterOnce(FMODUnity.StudioEventEmitter fmodComponent)
 {
     if (!fmodComponent.IsPlaying())
     {
         fmodComponent.Play();
     }
 }
예제 #11
0
    public void SetMusicToObjectsOfTile(GameObject tile)
    {
        Transform tileTransform = tile.transform;

        Rigidbody[] bodies = tileTransform.GetComponentsInChildren <Rigidbody>();
        foreach (Rigidbody rb in bodies)
        {
            FMODUnity.StudioEventEmitter x = rb.gameObject.AddComponent <FMODUnity.StudioEventEmitter> ();
            x.PlayEvent = FMODUnity.EmitterGameEvent.CollisionEnter;
            int i = Random.Range(0, 3);
            if (i == 0)
            {
                x.Event = "event:/FX/player/player_collision_impact";
            }
            else if (i == 1)
            {
                x.Event = "event:/FX/powerups/powerup_spawn";
            }
            else
            {
                //x.Event = "event:/FX/environment/furniture_destruction";
                x.Event = "event:/FX/player/player_collision_impact";
            }
        }
    }
예제 #12
0
    private GameObject CreateItem(Item.Type type)
    {
        spawnEffect.Play();
        FMODUnity.StudioEventEmitter x = GetComponent <FMODUnity.StudioEventEmitter> ();
        if (x != null)
        {
            x.Play();
        }
        switch (type)
        {
        case Item.Type.SUPER_BOOST:
            GameObject boost = Instantiate(atlas.fireBoostItem);
            boost.AddComponent <ItemController>().type = type;
            return(boost);

        case Item.Type.STICKY_THROWABLE:
            GameObject throwable = Instantiate(atlas.snowballItem);
            throwable.AddComponent <ItemController>().type = type;
            return(throwable);

        case Item.Type.BANANA_THROWABLE:
            GameObject banana = Instantiate(atlas.bananaItem);
            banana.AddComponent <ItemController>().type = type;
            return(banana);

        default:
            return(null);
        }
    }
예제 #13
0
 // Start is called before the first frame update
 void Start()
 {
     interactable = Utils.GetRequiredComponent <Interactable>(this);
     interactable.OnInteractEnd += ChangeStation;
     musicEv = Utils.GetRequiredComponent <FMODUnity.StudioEventEmitter>(this);
     musicEv.Play();
 }
    // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
    public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        eventEmitter = animator.gameObject.GetComponent<FMODUnity.StudioEventEmitter>();

        if (eventEmitter != null)
            eventEmitter.Play();    // lamp and lanterns play flickering sound
    }
예제 #15
0
 private void Start()
 {
     excitedAudio  = AudioManager.Instance.InitializeAudioOnObject(gameObject, "event:/excitedBunny");
     animator      = GetComponent <Animator>();
     houseComparer = FindObjectOfType <HouseComparer>();
     currentScore  = houseComparer.score;
     MakeIdle();
 }
예제 #16
0
    // Use this for initialization
    void Start()
    {
        playingSound = false;
        platformScript = GetComponentInParent<Zmovement> ();
        target = GetComponent<StudioEventEmitter> ();

        platformTrans = transform.parent;
    }
예제 #17
0
 private void Start()
 {
     // Starts the timer automatically
     timerIsRunning = true;
     timerDisplay   = this.gameObject.GetComponent <Text>();
     timeRemaining  = startTimeInSecs;
     fmodEvent      = GetComponent <FMODUnity.StudioEventEmitter>();
 }
예제 #18
0
    // Start is called before the first frame update
    void Start()
    {
        _chimeSound = this.gameObject.AddComponent <FMODUnity.StudioEventEmitter>();
        //_chimeSound.Event = GLOB.CelebrationSound;
        _chimeInstance = FMODUnity.RuntimeManager.CreateInstance(GLOB.CelebrationSound);

        FMODUnity.RuntimeManager.AttachInstanceToGameObject(_chimeInstance, this.gameObject.transform, GetComponent <Rigidbody>());
    }
예제 #19
0
 private void Start()
 {
     player       = FindObjectOfType <Player>();
     ropeRenderer = GetComponentInChildren <RopeRenderer>();
     target       = GetComponentInChildren <Target>();
     ropeRenderer.gameObject.SetActive(false);
     emitter = GetComponent <FMODUnity.StudioEventEmitter>();
 }
예제 #20
0
    private FMODUnity.StudioEventEmitter emitter;   //l'emitter attaché à l'objet


    void Start()
    {
        emitter = gameObject.GetComponent <FMODUnity.StudioEventEmitter>();  //init l'emitter
        if (emitter && emitter.Event != "")
        {
            SoundManager.GetSingleton.AddKey(emitter.Event + additionnalName, this);
        }
    }
예제 #21
0
    public void PlaySoundWithDelay(FMODUnity.StudioEventEmitter emitter, float delay)
    {
        soundParameters aux_ = new soundParameters();

        aux_.emitter = emitter;
        aux_.delay   = delay;
        sounds.Add(aux_);
    }
예제 #22
0
 // Start is called before the first frame update
 void Start()
 {
     _lastScoreTime    = Time.time;
     _scoreSound       = this.gameObject.AddComponent <FMODUnity.StudioEventEmitter>();
     _scoreSound.Event = GLOB.CelebrationSound;
     _scoreSound.EventInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(this.gameObject.transform));
     highscoreText.text = _highScore.ToString();
 }
예제 #23
0
    public bool triggered;                                //Triggered set to a bool

    void Start()
    {
        //Setting up references
        sc              = GetComponent <SphereCollider>();
        mr              = GetComponent <MeshRenderer>();
        pc              = GetComponent <PauseController>();
        player          = gameObject.GetComponent <Player>();
        eventEmitterRef = GetComponent <FMODUnity.StudioEventEmitter>();
    }
예제 #24
0
    void Awake()
    {
        //var target = GameObject.Find(playerObj);
        var target = playerObj;

        emitter = target.GetComponent <FMODUnity.StudioEventEmitter>();
        emitter.SetParameter("Surface_index", 1.1f);
        anim = gameObject.GetComponent <Animator>();
    }
예제 #25
0
 public void defeat()
 {
     FMODUnity.StudioEventEmitter emitter = mainTheme.GetComponent <FMODUnity.StudioEventEmitter>();
     Time.timeScale = 0;
     GameObject.Find("TimePanel").GetComponentInChildren <Slider>().value = 0;
     endScreenLose.SetActive(true);
     GetComponent <AudioSource>().enabled = false;
     mainTheme.GetComponent <FMODUnity.StudioEventEmitter>().Stop();
     GameObject.Find("Sounds").GetComponentInChildren <Slider>().value = 0;
 }
예제 #26
0
    private void InitializeAudio()
    {
        musicController = AudioManager.Instance.InitializeAudioOnObject(this.gameObject, _Fmod.Events.Music.musicController);
        AudioManager.Instance.PlayEmitterOnce(musicController);

        ambienceController = AudioManager.Instance.InitializeAudioOnObject(this.gameObject, _Fmod.Events.Misc.ambController);
        AudioManager.Instance.PlayEmitterOnce(ambienceController);

        s_onPause = AudioManager.Instance.InitializeAudioOnObject(this.gameObject, _Fmod.Snapshots.onPause);
    }
예제 #27
0
    // Use this for initialization
    void Start()
    {
        oldXpos = transform.position.x;
        oldXpos = transform.position.y;
        var target = GameObject.Find(trackname);

        track1 = target.GetComponent <FMODUnity.StudioEventEmitter>();

        InvokeRepeating("CheckMovement", 2.0f, 0.1f);
    }
예제 #28
0
 // Start is called before the first frame update
 void Start()
 {
     _spotLightHandler       = this.GetComponent <SpotlightHandler>();
     _chladniTalkBoard       = this.gameObject.AddComponent <FMODUnity.StudioEventEmitter>();
     _chladniTalkBoard.Event = _tutorialSounds[0];
     _chladniTalkBoard.EventInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(chladniSoundEmitter.transform));
     _soundAfterTutorial       = this.gameObject.AddComponent <FMODUnity.StudioEventEmitter>();
     _soundAfterTutorial.Event = GLOB.BackgroundSound;
     _soundAfterTutorial.Stop();
 }
예제 #29
0
    void Start()
    {
        emitter     = GetComponent <FMODUnity.StudioEventEmitter>();
        gunAnimator = gunSprite.GetComponent <Animator>();
        player      = GetComponentInParent <Player>();
        playerBody  = GetComponentInParent <Rigidbody2D>();
        cam         = Camera.main;

        attractorParticles = Instantiate(attractParticlesPrefab, transform.position, attractParticlesPrefab.transform.rotation).GetComponent <MultiParticleHandler>();
    }
예제 #30
0
 // Start is called before the first frame update
 protected override void Start()
 {
     base.Start();
     _celebrationSound       = this.gameObject.AddComponent <FMODUnity.StudioEventEmitter>();
     _celebrationSound.Event = GLOB.CelebrationSound;
     _celebrationSound.EventInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(this.gameObject.transform));
     _bottlePickUpSound       = this.gameObject.AddComponent <FMODUnity.StudioEventEmitter>();
     _bottlePickUpSound.Event = GLOB.BottlePickupSound;
     _bottlePickUpSound.EventInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(this.gameObject.transform));
 }
 // Start is called before the first frame update
 void Start()
 {
     openBool                = Animator.StringToHash("OpenCupula");
     _cupulaAnimator         = this.gameObject.GetComponent <Animator>();
     _cupulaSound            = this.gameObject.AddComponent <FMODUnity.StudioEventEmitter>();
     _cupulaSound.Event      = GLOB.DomeOpeningSound;
     _outsideBackGroundSound = this.gameObject.AddComponent <FMODUnity.StudioEventEmitter>();
     _outsideBackGroundSound.EventInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(new Vector3(-8, 0, 0)));
     _outsideBackGroundSound.Event = GLOB.OutsideWavesSound;
 }
예제 #32
0
    private FMODUnity.StudioEventEmitter emitter;   //l'emitter attaché à l'objet


    void Start()
    {
        emitter = gameObject.GetComponent <FMODUnity.StudioEventEmitter>();  //init l'emitter
        string addParent = (addIdOfObject) ? addIdOfObject.GetInstanceID().ToString() : "";

        if (emitter && emitter.Event != "")
        {
            SoundManager.GetSingleton.AddKey(emitter.Event + additionnalName + addParent, this);
        }
    }
예제 #33
0
    void Start()
    {
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
        Input.gyro.enabled = true;

        _timer = symbolCooldown;

        emitter = GetComponent<FMODUnity.StudioEventEmitter>();
        emitter.Play();

        //studioSystem = FMODUnity.RuntimeManager.StudioSystem;
        //FMODUnity.RuntimeManager.PlayOneShot("event:/Teste");
    }
 static void DrawGizmo(StudioEventEmitter studioEmitter, GizmoType gizmoType)
 {
     Gizmos.DrawIcon(studioEmitter.transform.position, "FMODEmitter.tiff", true);
     if ((int)(gizmoType & GizmoType.Selected) != 0 && studioEmitter.Event != null)
     {
         EditorEventRef editorEvent = EventManager.EventFromPath(studioEmitter.Event);
         if (editorEvent != null && editorEvent.Is3D)
         {
             Gizmos.DrawWireSphere(studioEmitter.transform.position, editorEvent.MinDistance);
             Gizmos.DrawWireSphere(studioEmitter.transform.position, editorEvent.MaxDistance);
         }
     }
 }
 void OnEnable()
 {
     emitters = serializedObject.FindProperty("Emitters");
     trigger = serializedObject.FindProperty("TriggerEvent");
     tag = serializedObject.FindProperty("CollisionTag");
     targetEmitter = null;
     for (int i = 0; i < emitters.arraySize; i++)
     {
         targetEmitter = emitters.GetArrayElementAtIndex(i).FindPropertyRelative("Target").objectReferenceValue as StudioEventEmitter;
         if (targetEmitter != null)
         {
             expanded = new bool[targetEmitter.GetComponents<StudioEventEmitter>().Length];
             break;
         }
     }
 }
예제 #36
0
	void Awake(){
		label=GetComponent<Text>();
		fmod=fsm.GetComponent<StudioEventEmitter>();
	}
 bool ReplaceText(StudioEventEmitter emitter)
 {
     int findLength = findText.Length;
     int replaceLength = replaceText.Length;
     int position = 0;
     var serializedObject = new SerializedObject(emitter);
     var pathProperty = serializedObject.FindProperty("Event");
     string path = pathProperty.stringValue;
     position = path.IndexOf(findText, position, StringComparison.CurrentCultureIgnoreCase);
     while (position >= 0)
     {
         path = path.Remove(position, findLength).Insert(position, replaceText);
         position += replaceLength;
         position = path.IndexOf(findText, position, StringComparison.CurrentCultureIgnoreCase);
     }
     pathProperty.stringValue = path;
     return serializedObject.ApplyModifiedProperties();
 }
 static void DrawGizmo(StudioEventEmitter studioEmitter, GizmoType gizmoType)
 {
     Gizmos.DrawIcon(studioEmitter.transform.position, "FMODEmitter.tiff", true);
 }
예제 #39
0
 // Use this for initialization
 void Start()
 {
     wplat = GetComponentInParent<WheelPlatforms> ();
     Target = GetComponent<StudioEventEmitter> ();
     LevelReset.myLevelElements.Add(this);
 }
        public override void OnInspectorGUI()
        {
            var newTargetEmitter = EditorGUILayout.ObjectField("Target", targetEmitter, typeof(StudioEventEmitter), true) as StudioEventEmitter;
            if (newTargetEmitter != targetEmitter)
            {
                emitters.ClearArray();
                targetEmitter = newTargetEmitter;

                if (targetEmitter == null)
                {
                    serializedObject.ApplyModifiedProperties();
                    return;
                }

                List<StudioEventEmitter> newEmitters = new List<StudioEventEmitter>();
                targetEmitter.GetComponents<StudioEventEmitter>(newEmitters);
                expanded = new bool[newEmitters.Count];
                foreach (var emitter in newEmitters)
                {
                    emitters.InsertArrayElementAtIndex(0);
                    emitters.GetArrayElementAtIndex(0).FindPropertyRelative("Target").objectReferenceValue = emitter;
                }
            }

            if (targetEmitter == null)
            {
                return;
            }


            EditorGUILayout.PropertyField(trigger, new GUIContent("Trigger"));

            if (trigger.enumValueIndex == 3 || trigger.enumValueIndex == 4)
            {
                tag.stringValue = EditorGUILayout.TagField("Collision Tag", tag.stringValue);
            }

            var localEmitters = new List<StudioEventEmitter>();
            targetEmitter.GetComponents<StudioEventEmitter>(localEmitters);

            int emitterIndex = 0;
            foreach (var emitter in localEmitters)
            {
                SerializedProperty emitterProperty = null;
                for(int i = 0; i < emitters.arraySize; i++)
                {
                    if (emitters.GetArrayElementAtIndex(i).FindPropertyRelative("Target").objectReferenceValue == emitter)
                    {
                        emitterProperty = emitters.GetArrayElementAtIndex(i);
                        break;
                    }
                }

                // New emitter component added to game object since we last looked
                if (emitterProperty == null)
                {
                    emitters.InsertArrayElementAtIndex(0);
                    emitterProperty = emitters.GetArrayElementAtIndex(0);
                    emitterProperty.FindPropertyRelative("Target").objectReferenceValue = emitter;
                }


                if (!String.IsNullOrEmpty(emitter.Event))
                {
                    expanded[emitterIndex] = EditorGUILayout.Foldout(expanded[emitterIndex], emitter.Event);
                    if (expanded[emitterIndex])
                    {
                        var eventRef = EventManager.EventFromPath(emitter.Event);
                        foreach (var paramRef in eventRef.Parameters)
                        {
                            bool set = false;
                            int index = -1;
                            for (int i = 0; i < emitterProperty.FindPropertyRelative("Params").arraySize; i++)
                            {
                                if (emitterProperty.FindPropertyRelative("Params").GetArrayElementAtIndex(i).FindPropertyRelative("Name").stringValue == paramRef.Name)
                                {
                                    index = i;
                                    set = true;
                                    break;
                                }
                            }
                            EditorGUILayout.BeginHorizontal();
                            EditorGUILayout.PrefixLabel(paramRef.Name);
                            bool newSet = GUILayout.Toggle(set, "");
                            if (!set && newSet)
                            {
                                index = 0;
                                emitterProperty.FindPropertyRelative("Params").InsertArrayElementAtIndex(0);
                                emitterProperty.FindPropertyRelative("Params").GetArrayElementAtIndex(0).FindPropertyRelative("Name").stringValue = paramRef.Name;
                                emitterProperty.FindPropertyRelative("Params").GetArrayElementAtIndex(0).FindPropertyRelative("Value").floatValue = 0;
                            }
                            if (set && !newSet)
                            {
                                emitterProperty.FindPropertyRelative("Params").DeleteArrayElementAtIndex(index);
                            }
                            set = newSet;
                            EditorGUI.BeginDisabledGroup(!set);
                            if (set)
                            {
                                var valueProperty = emitterProperty.FindPropertyRelative("Params").GetArrayElementAtIndex(index).FindPropertyRelative("Value");
                                valueProperty.floatValue = EditorGUILayout.Slider(valueProperty.floatValue, paramRef.Min, paramRef.Max);
                            }
                            else
                            {
                                EditorGUILayout.Slider(0, paramRef.Min, paramRef.Max);
                            }
                            EditorGUI.EndDisabledGroup();
                            EditorGUILayout.EndHorizontal();
                        }
                    }
                }

                emitterIndex++;
            }           

            serializedObject.ApplyModifiedProperties();
        }