Ejemplo n.º 1
0
    public void PlayRandomMusic()
    {
        var clip = _musicClips[_random.Next(_musicClips.Length)];

        _event = Fmod.CreateInstance(clip);
        _event.start();
    }
Ejemplo n.º 2
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }
        else if (instance != this)
        {
            Destroy(this);
            return;
        }

        musicInstance            = RuntimeManager.CreateInstance(music);
        gameStartInstance        = RuntimeManager.CreateInstance(gameStart);
        nfc_detect_leftInstance  = RuntimeManager.CreateInstance(nfc_detect_left);
        nfc_detect_rightInstance = RuntimeManager.CreateInstance(nfc_detect_right);
        killInstance             = RuntimeManager.CreateInstance(kill);
        bothDestroyedInstance    = RuntimeManager.CreateInstance(bothDestroyed);
        blockedInstance          = RuntimeManager.CreateInstance(blocked);
        baseDamageInstance       = RuntimeManager.CreateInstance(baseDamage);
        evolveP1       = RuntimeManager.CreateInstance(evolve);
        evolveP2       = RuntimeManager.CreateInstance(evolve);
        summonInstance = RuntimeManager.CreateInstance(summon);
    }
Ejemplo n.º 3
0
    private IEnumerator <WaitCommand> StartRebindInternal(InputBindingViewModel binding)
    {
        var bindingId = binding.Id;

        // TODO Update selected binding in the menu model
        Fmod.PlayOneShot("event:/ui/forward");
        // Disable menu input to view
        //_mouseInputToView.Disable();
        _inputModule.DeactivateModule();

        yield return(WaitCommand.WaitForNextFrame);

        _model.Rebinding = binding;

        if (bindingId.Group == InputBindingGroup.Menu)
        {
            MenuAction menuAction = (MenuAction)bindingId.ActionId;
            _inputRebinder.StartRebind(inputSource => {
                if (inputSource.IsJust)
                {
                    _menuInputBindings.UpdateMapping(menuAction, inputSource.Value);
                }
                _coroutineScheduler.Run(CompleteRebind(isCanceled: inputSource.IsNothing));
            });
        }
        else if (bindingId.Group == InputBindingGroup.Wingsuit)
        {
            WingsuitAction pilotAction = (WingsuitAction)bindingId.ActionId;
            _inputRebinder.StartRebind(inputSource => {
                if (inputSource.IsJust)
                {
                    _pilotInputBindings.UpdateMapping(pilotAction, inputSource.Value);
                }
                _coroutineScheduler.Run(CompleteRebind(isCanceled: inputSource.IsNothing));
            });
        }
        else if (bindingId.Group == InputBindingGroup.Spectator)
        {
            SpectatorAction spectatorAction = (SpectatorAction)bindingId.ActionId;
            _inputRebinder.StartRebind(inputSource => {
                if (inputSource.IsJust)
                {
                    _spectatorInputBindings.UpdateMapping(spectatorAction, inputSource.Value);
                }
                _coroutineScheduler.Run(CompleteRebind(isCanceled: inputSource.IsNothing));
            });
        }
        else if (bindingId.Group == InputBindingGroup.Parachute)
        {
            ParachuteAction parachuteAction = (ParachuteAction)bindingId.ActionId;
            _inputRebinder.StartRebind(inputSource => {
                if (inputSource.IsJust)
                {
                    _parachuteInputBindings.UpdateMapping(parachuteAction, inputSource.Value);
                }
                _coroutineScheduler.Run(CompleteRebind(isCanceled: inputSource.IsNothing));
            });
        }
    }
Ejemplo n.º 4
0
        private IEnumerator <WaitCommand> OnExit()
        {
            // Wait for next frame to prevent any input events from the options menu
            // being interpreted by the next state
            yield return(WaitCommand.WaitForNextFrame);

            Fmod.PlayOneShot("event:/ui/back");
        }
Ejemplo n.º 5
0
    public void Initialize()
    {
        _transform = gameObject.GetComponent <Transform>();

        _emitter = Fmod.CreateInstance(_eventName);
        _emitter.getParameter("airspeed", out _airspeedParam);
        _emitter.getParameter("AoA", out _angleOfAttackParam);
    }
Ejemplo n.º 6
0
    // Start is called before the first frame update
    void Start()
    {
        rb = this.GetComponent <Rigidbody>();
        mouvementSpeedBase = mouvementSpeed;


        snailMovementEvent = RuntimeManager.CreateInstance(snailMovementRef);
        snailMovementEvent.start();
        snailMovementEvent.setPaused(true);
    }
Ejemplo n.º 7
0
 public void Play(string id)
 {
     for (int i = 0; i < _sounds.Length; i++)
     {
         var sound = _sounds[i];
         if (id.Equals(sound.Id))
         {
             Fmod.PlayOneShot(sound.FmodEventId, Vector3.zero);
         }
     }
 }
Ejemplo n.º 8
0
    private IEnumerator <WaitCommand> CompleteRebind(bool isCanceled)
    {
        if (isCanceled)
        {
            Fmod.PlayOneShot("event:/ui/back");
        }
        else
        {
            Fmod.PlayOneShot("event:/ui/forward");
        }

        yield return(WaitCommand.WaitForNextFrame);

        _inputModule.ActivateModule();
        _model.Rebinding = null;
    }
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }
        else if (instance != this)
        {
            Destroy(this);
            return;
        }

        //gameBeginInstance = RuntimeManager.CreateInstance(gameBegin);
        monsterAppearanceInstance = RuntimeManager.CreateInstance(monsterAppearance);
        negotiationBeginInstance  = RuntimeManager.CreateInstance(negotiationBegin);
        scanPositifInstance       = RuntimeManager.CreateInstance(scanPositif);
        scanNegatifInstance       = RuntimeManager.CreateInstance(scanNegatif);
        attachStuffInstance       = RuntimeManager.CreateInstance(attachStuff);
        deattachStuffInstance     = RuntimeManager.CreateInstance(deattachStuff);
        validationStuffInstance   = RuntimeManager.CreateInstance(validationStuff);
        endOfNegotiationInstance  = RuntimeManager.CreateInstance(endOfNegotiation);
        lanchFightInstance        = RuntimeManager.CreateInstance(lanchFight);
        livingCrowdInstance       = RuntimeManager.CreateInstance(livingCrowd);
        monsterCryInstance        = RuntimeManager.CreateInstance(monsterCry);
        attackInstance            = RuntimeManager.CreateInstance(attack);
        damageRecieveInstance     = RuntimeManager.CreateInstance(damageRecieve);
        fireDamageInstance        = RuntimeManager.CreateInstance(fireDamage);
        iceDamageInstance         = RuntimeManager.CreateInstance(iceDamage);
        electricDamageInstance    = RuntimeManager.CreateInstance(electricDamage);
        idleMonsterInstance       = RuntimeManager.CreateInstance(idleMonster);
        deadMonsterCryInstance    = RuntimeManager.CreateInstance(deadMonsterCry);
        victoryCryInstance        = RuntimeManager.CreateInstance(victoryCry);
        collectGoldInstance       = RuntimeManager.CreateInstance(collectGold);
        levelUpingInstance        = RuntimeManager.CreateInstance(levelUping);
        monsterVictoryCryInstance = RuntimeManager.CreateInstance(monsterVictoryCry);
        deathOfGladiatorInstance  = RuntimeManager.CreateInstance(deathOfGladiator);
        losingCrowdInstance       = RuntimeManager.CreateInstance(losingCrowd);
        endOfFightInstance        = RuntimeManager.CreateInstance(endOfFight);
        //endOfGameInstance = RuntimeManager.CreateInstance(endOfGame);
    }
Ejemplo n.º 10
0
 void OnDestroy()
 {
     if (studioSystem != null)
     {
         UnityEngine.Debug.Log("FMOD Studio: Destroying runtime system instance");
         studioSystem.release();
         studioSystem = null;
     }
     initException = null;
     instance = null;
     isQuitting = true;
 }
Ejemplo n.º 11
0
 private void Awake()
 {
     _event = Fmod.CreateInstance("event:/Amb/amb_2D");
     _event.getParameter("altitude", out _altitude);
 }
Ejemplo n.º 12
0
 private void Awake()
 {
     uphillEvent = RuntimeManager.CreateInstance(uphillRef);
     uphillEvent.start();
 }
Ejemplo n.º 13
0
        public void Play()
        {
            if (TriggerOnce && hasTriggered)
            {
                return;
            }

            if (String.IsNullOrEmpty(Event))
            {
                return;
            }

            if (!eventDescription.isValid())
            {
                Lookup();
            }

            bool isOneshot = false;

            if (!Event.StartsWith("snapshot", StringComparison.CurrentCultureIgnoreCase))
            {
                eventDescription.isOneshot(out isOneshot);
            }
            bool is3D;

            eventDescription.is3D(out is3D);

            if (!instance.isValid())
            {
                instance.clearHandle();
            }

            // Let previous oneshot instances play out
            if (isOneshot && instance.isValid())
            {
                instance.release();
                instance.clearHandle();
            }

            if (!instance.isValid())
            {
                eventDescription.createInstance(out instance);

                // Only want to update if we need to set 3D attributes
                if (is3D)
                {
                    var rigidBody   = GetComponent <Rigidbody>();
                    var rigidBody2D = GetComponent <Rigidbody2D>();
                    var transform   = GetComponent <Transform>();
                    if (rigidBody)
                    {
                        instance.set3DAttributes(RuntimeUtils.To3DAttributes(gameObject, rigidBody));
                        RuntimeManager.AttachInstanceToGameObject(instance, transform, rigidBody);
                    }
                    else
                    {
                        instance.set3DAttributes(RuntimeUtils.To3DAttributes(gameObject, rigidBody2D));
                        RuntimeManager.AttachInstanceToGameObject(instance, transform, rigidBody2D);
                    }
                }
            }

            foreach (var param in Params)
            {
                instance.setParameterValue(param.Name, param.Value);
            }

            if (is3D && OverrideAttenuation)
            {
                instance.setProperty(FMOD.Studio.EVENT_PROPERTY.MINIMUM_DISTANCE, OverrideMinDistance);
                instance.setProperty(FMOD.Studio.EVENT_PROPERTY.MAXIMUM_DISTANCE, OverrideMaxDistance);
            }

            instance.start();

            hasTriggered = true;
        }
Ejemplo n.º 14
0
 void Awake()
 {
     _emitter = Fmod.CreateInstance("event:/wingsuit/proximity_ground");
     _emitter.getParameter("altitude_ground", out _altitudeGround);
     _emitter.getParameter("airspeed", out _airspeed);
 }
Ejemplo n.º 15
0
 void Start()
 {
     _collisionSource.OnCollisionEntered += OnCollisionEntered;
     _collisionSoundEvent = Fmod.CreateInstance("event:/wingsuit/Collisions/ground");
 }
Ejemplo n.º 16
0
 void Start()
 {
     rigidBody = gameObject.GetComponent <Rigidbody>();
     RuntimeManager.HasListener = true;
     RuntimeManager.SetListenerLocation(gameObject, rigidBody);
 }
Ejemplo n.º 17
0
 public void PlayIntro()
 {
     _event = Fmod.CreateInstance(_introMusic);
     _event.start();
 }
Ejemplo n.º 18
0
 void Update()
 {
     RuntimeManager.SetListenerLocation(gameObject, rigidBody);
 }
Ejemplo n.º 19
0
 void OnDestroy()
 {
     if (studioSystem != null)
     {
         studioSystem.release();
         studioSystem = null;
     }
     initException = null;
     instance = null;
 }
Ejemplo n.º 20
0
 void Lookup()
 {
     eventDescription = RuntimeManager.GetEventDescription(Event);
 }