Пример #1
0
        public void Init()
        {
            ikAimLeftArm             = true;
            ikAimRightArm            = true;
            useLeftAimTargetOnPlayer = false;
            hasAnimations            = true;
            hasFirstUseAnimation     = false;
            hasBashAnimation         = false;
            mainCollider             = GetComponent <BoxCollider>();
            socket   = PlayerTool.Socket.RightHand;
            animator = GetComponentInChildren <Animator>();

            var warper = (Resources.Load("WorldEntities/Creatures/Warper") as GameObject).GetComponent <Warper>();

            warpInEffectPrefab  = warper.warpInEffectPrefab;
            warpOutEffectPrefab = warper.warpOutEffectPrefab;

            warpedMaterial = warper.warpedMaterial;

            warpInSound  = warper.warpInSound;
            warpOutSound = warper.warpOutSound;

            overlayFXDuration = warper.overlayFXduration;

            Resources.UnloadAsset(warper);
        }
Пример #2
0
 private void Light()
 {
     if (this._fuel < Time.time)
     {
         GameStats.LitWeapon.Invoke();
         LocalPlayer.Inventory.DefaultLight.StashLighter();
         Transform transform = (!this._weaponFireSpawn) ? base.transform : this._weaponFireSpawn.transform;
         this._weaponFire = (GameObject)UnityEngine.Object.Instantiate(this._weaponFirePrefab, transform.position, transform.rotation);
         this._weaponFire.transform.parent = transform;
         if (!this._weaponFire.activeSelf)
         {
             this._weaponFire.gameObject.SetActive(true);
         }
         this._fireParticleScale = this._weaponFire.GetComponentInChildren <ParticleScaler>();
         this._firelight         = this._weaponFire.GetComponentInChildren <Light>();
         this._fireAudioEmitter  = this._weaponFire.GetComponent <FMOD_StudioEventEmitter>();
         base.GetComponent <Renderer>().sharedMaterial = this._burningMat;
         this._fuel      = this._burnDuration;
         this._startTime = Time.time;
         this._state     = BurnableItem.States.Burning;
         this._attacking = false;
         LocalPlayer.Inventory.IsWeaponBurning = true;
         FMODCommon.PlayOneshot("event:/fire/fire_built_start", transform);
     }
 }
Пример #3
0
 private void Awake()
 {
     this._emitter      = base.GetComponent <FMOD_StudioEventEmitter>();
     this._originalMass = base.transform.parent.GetComponent <Rigidbody>().mass;
     this._originalDrag = base.transform.parent.GetComponent <Rigidbody>().drag;
     this.SetEnabled(false);
 }
Пример #4
0
 public void Awake()
 {
     if (!this._initialized)
     {
         this._initialized     = true;
         this._validRecipeFill = 0f;
         this._validRecipe     = null;
         this._normalMaterial  = base.gameObject.GetComponent <Renderer>().sharedMaterial;
         this._upgradeCog      = base.GetComponent <UpgradeCog>();
         this._ingredients     = new HashSet <ReceipeIngredient>();
         this._itemViewsCache  = this._itemViews.ToDictionary((InventoryItemView iv) => iv._itemId, (InventoryItemView iv) => iv);
         if (this._inventory && Scene.HudGui)
         {
             this._clickToCombineButton = Scene.HudGui.ClickToCombineInfo;
         }
         if (this._craftSfx)
         {
             this._craftSfxEmitter = this._craftSfx.GetComponent <FMOD_StudioEventEmitter>();
         }
         if (this._craftSfx2)
         {
             this._craftSfx2Emitter = this._craftSfx2.GetComponent <FMOD_StudioEventEmitter>();
         }
         for (int i = 0; i < this._itemViews.Length; i++)
         {
             this._itemViews[i].Init();
         }
     }
 }
Пример #5
0
 private void Light()
 {
     if (this._fuel < Time.time)
     {
         GameStats.LitWeapon.Invoke();
         LocalPlayer.Inventory.DefaultLight.StashLighter();
         InventoryItemView component = this._inventoryMirror.transform.parent.GetComponent <InventoryItemView>();
         Transform         transform = (!this._weaponFireSpawn) ? base.transform : this._weaponFireSpawn.transform;
         this._weaponFire = (GameObject)UnityEngine.Object.Instantiate(this._weaponFirePrefab, transform.position, transform.rotation);
         this._weaponFire.transform.parent = transform;
         if (!this._weaponFire.activeSelf)
         {
             this._weaponFire.gameObject.SetActive(true);
         }
         this._fireParticleScale = this._weaponFire.GetComponentInChildren <ParticleScaler>();
         this._firelight         = this._weaponFire.GetComponentInChildren <Light>();
         this._fireAudioEmitter  = this._weaponFire.GetComponent <FMOD_StudioEventEmitter>();
         base.GetComponent <Renderer>().sharedMaterial = this._burningMat;
         this._fuel = ((this._state != BurnableCloth.States.PutOutLighting) ? this._burnDuration : this._putOutFuel);
         if (component.ActiveBonus == WeaponStatUpgrade.Types.BurningWeaponExtra)
         {
             this._extraBurn = true;
             this._fuel     *= 3f;
         }
         else
         {
             this._extraBurn = false;
         }
         this._state = BurnableCloth.States.Burning;
         this._player.IsWeaponBurning = true;
         this._attacking       = false;
         component.ActiveBonus = (WeaponStatUpgrade.Types)(-1);
         FMODCommon.PlayOneshot("event:/fire/fire_built_start", transform);
     }
 }
Пример #6
0
 public void SetDefaultParameter(float value)
 {
     if (FMOD_StudioEventEmitter.IsParameterValid(this.defaultParameter))
     {
         UnityUtil.ERRCHECK(this.defaultParameter.setValue(value));
     }
 }
Пример #7
0
 public void SetParamValue(AudioChannel channel, string param, float value)
 {
     if (!string.IsNullOrEmpty(param))
     {
         FMOD_StudioEventEmitter emitter = this.GetEmitter(channel);
         emitter.SetParamValue(param, value);
     }
 }
 //get volume of param, accounting for substitutions
 public float GetVolume(FMOD_StudioEventEmitter ev)
 {
     float paramVal = 0.0f;
        FMOD.Studio.ParameterInstance param = ev.getParameter(GetCurParam());
        if (param != null)
       param.getValue(out paramVal);
        return paramVal;
 }
Пример #9
0
    public void Play(AudioChannel channel = AudioChannel.Action)
    {
        FMOD_StudioEventEmitter emitter = this.GetEmitter(channel);

        if (emitter != null)
        {
            emitter.Play();
        }
    }
Пример #10
0
        private void Start()
        {
            FMOD_StudioEventEmitter component = base.GetComponent <FMOD_StudioEventEmitter>();

            if (component)
            {
                component.enabled = true;
            }
        }
Пример #11
0
    public static bool PlayEmitter(string estring)      //Called To Play A Sound From Designated Emitter
    {
        FMOD_StudioEventEmitter EmitterToPlay = (FMOD_StudioEventEmitter)emitterlist[estring];

        EmitterToPlay.Stop();         //Stop Sound
        EmitterToPlay.Play();         //Play Sound

        return(true);
    }
Пример #12
0
    public void Stop(AudioChannel channel = AudioChannel.Action)
    {
        FMOD_StudioEventEmitter emitter = this.GetEmitter(channel);

        if (emitter != null)
        {
            emitter.Stop(STOP_MODE.ALLOWFADEOUT);
        }
    }
Пример #13
0
 private void Awake()
 {
     base.enabled = false;
     this.emitter = base.GetComponent <FMOD_StudioEventEmitter>();
     if (this.Pushable)
     {
         this._originalMass = base.transform.parent.GetComponent <Rigidbody>().mass;
         this._originalDrag = base.transform.parent.GetComponent <Rigidbody>().drag;
     }
 }
Пример #14
0
    private void initAudioEmitter()
    {
        FMOD_StudioEventEmitter component = base.transform.GetComponent <FMOD_StudioEventEmitter>();

        if (component)
        {
            component.enabled           = true;
            component.startEventOnAwake = true;
        }
    }
Пример #15
0
 public void StartEvent(string key)
 {
     if (this.e == null)
     {
         this.e = base.gameObject.AddComponent <FMOD_StudioEventEmitter>();
     }
     this.e.path = key;
     this.e.CacheEventInstance();
     this.e.StartEvent();
 }
Пример #16
0
    private void OnEnable()
    {
        Debug.Log("Event Enabled");
        FMOD_StudioEventEmitter component = base.GetComponent <FMOD_StudioEventEmitter>();

        component.preStartAction = delegate(EventInstance evt)
        {
            evt.setParameterValue("Intensity", this.intensityLevel);
            Debug.Log("parameter set to: " + this.intensityLevel);
        };
    }
Пример #17
0
    public override void Awake()
    {
        GameObject gameObject = GameObject.FindWithTag("PaperSfx");

        this.PageSound = (FMOD_StudioEventEmitter)gameObject.GetComponent(typeof(FMOD_StudioEventEmitter));
        Material material = this.gameObject.GetComponent <Renderer>().material;

        this.SwitchColor   = material.color;
        this.SwitchColor.a = (float)0;
        this.gameObject.GetComponent <Renderer>().material.color = this.SwitchColor;
    }
Пример #18
0
    //set volume of param, accounting for substitutions that may need to happen
    public void SetVolume(float vol, FMOD_StudioEventEmitter ev)
    {
        //if we have substitutions, just silence all at first so we don't leave any tracks on accidently
           if (Substitutions.Length > 0)
          SilenceAll(ev);

           FMOD.Studio.ParameterInstance param = ev.getParameter(GetCurParam());
           if (param != null)
           {
          param.setValue(Mathf.Lerp(0.0f, MixVolume, vol));
           }
    }
Пример #19
0
 public static void Add(FMOD_StudioEventEmitter emitter)
 {
     for (int i = 0; i < FMOD_StudioEventEmitterManager.emitters.Count; i++)
     {
         if (FMOD_StudioEventEmitterManager.emitters[i].emitter == emitter)
         {
             FMOD_StudioEventEmitterManager.emitters[i].framesSinceLastMovement = 0;
             return;
         }
     }
     FMOD_StudioEventEmitterManager.emitters.Add(new FMOD_StudioEventEmitterManager.EmitterInfo(emitter));
 }
Пример #20
0
 public static void Remove(FMOD_StudioEventEmitter emitter)
 {
     for (int i = 0; i < FMOD_StudioEventEmitterManager.emitters.Count; i++)
     {
         if (FMOD_StudioEventEmitterManager.emitters[i].emitter == emitter)
         {
             FMOD_StudioEventEmitterManager.emitters[i] = FMOD_StudioEventEmitterManager.emitters[FMOD_StudioEventEmitterManager.emitters.Count - 1];
             FMOD_StudioEventEmitterManager.emitters.RemoveAt(FMOD_StudioEventEmitterManager.emitters.Count - 1);
             return;
         }
     }
 }
Пример #21
0
    public FMOD_StudioEventEmitter GetEmitter(AudioChannel channel)
    {
        switch (channel)
        {
        case AudioChannel.Motion:
            if (this._emitter2 == null)
            {
                this._emitter2 = base.gameObject.AddComponent <FMOD_StudioEventEmitter>();
            }
            return(this._emitter2);

        case AudioChannel.Action:
            if (this._emitter == null)
            {
                this._emitter = base.gameObject.AddComponent <FMOD_StudioEventEmitter>();
            }
            return(this._emitter);

        case (AudioChannel)3:
        case (AudioChannel)5:
        case (AudioChannel)6:
        case (AudioChannel)7:
IL_2A:
            if (channel != AudioChannel.SkillCombine)
            {
                return(null);
            }
            if (this._emitter5 == null)
            {
                this._emitter5 = base.gameObject.AddComponent <FMOD_StudioEventEmitter>();
            }
            return(this._emitter5);

        case AudioChannel.Skill:
            if (this._emitter3 == null)
            {
                this._emitter3 = base.gameObject.AddComponent <FMOD_StudioEventEmitter>();
            }
            return(this._emitter3);

        case AudioChannel.Behit:
            if (this._emitter4 == null)
            {
                this._emitter4 = base.gameObject.AddComponent <FMOD_StudioEventEmitter>();
            }
            return(this._emitter4);
        }
        goto IL_2A;
    }
    void Awake()
    {
        emitter = (FMOD_StudioEventEmitter)target;

        is3D = false;

        FMOD.Studio.EventDescription desc = FMODEditorExtension.GetEventDescription(emitter.asset.id);

        if (desc != null)
        {
            desc.is3D(out is3D);
            desc.getMinimumDistance(out minDistance);
            desc.getMaximumDistance(out maxDistance);
        }
    }
Пример #23
0
 public static void Postfix(FMOD_StudioEventEmitter __instance, bool allowFadeout)
 {
     if (fmodSystem.IsWhitelisted(__instance.asset.path))
     {
         __instance.TryGetComponent(out NitroxEntity nitroxEntity);
         if (!nitroxEntity)
         {
             nitroxEntity = __instance.GetComponentInParent <NitroxEntity>();
         }
         if (nitroxEntity)
         {
             fmodSystem.PlayStudioEmitter(nitroxEntity.Id, __instance.asset.path, false, allowFadeout);
         }
     }
 }
        protected void Start()
        {
#pragma warning disable CS0612 // Type or member is obsolete
            if (repulsionCannonFireSound is null && PrefabDatabase.TryGetPrefabFilename(CraftData.GetClassIdForTechType(TechType.RepulsionCannon), out var RCFilename))
            {
                AddressablesUtility.LoadAsync <GameObject>(RCFilename).Completed += (x) =>
                {
                    var gameObject1 = x.Result;
                    var component   = gameObject1?.GetComponent <RepulsionCannon>();
                    repulsionCannonFireSound = component?.shootSound;
                };
            }

            if ((stasisRifleFireSound is null || stasisRifleEvent is null) && PrefabDatabase.TryGetPrefabFilename(CraftData.GetClassIdForTechType(TechType.StasisRifle), out var SRFilename))
            {
                AddressablesUtility.LoadAsync <GameObject>(SRFilename).Completed += (x) =>
                {
                    var gameObject2 = x.Result;
                    var component2  = gameObject2?.GetComponent <StasisRifle>();
                    stasisRifleFireSound = component2?.fireSound;
                    stasisRifleEvent     = component2?.chargeBegin;
                };
            }

            if (modeChangeSound is null && PrefabDatabase.TryGetPrefabFilename(CraftData.GetClassIdForTechType(TechType.PropulsionCannon), out var PCFilename))
            {
                AddressablesUtility.LoadAsync <GameObject>(PCFilename).Completed += (x) =>
                {
                    var gameObject3 = x.Result;
                    var component3  = gameObject3?.GetComponent <PropulsionCannon>();
                    modeChangeSound = component3?.shootSound;
                };
            }

            if (laserShootSound is null && PrefabDatabase.TryGetPrefabFilename(CraftData.GetClassIdForTechType(TechType.Welder), out var WFilename))
            {
                AddressablesUtility.LoadAsync <GameObject>(WFilename).Completed += (x) =>
                {
                    var gameObject4 = x.Result;
                    var component4  = gameObject4?.GetComponent <Welder>();
                    laserShootSound = component4?.weldSound;
                };
            }
#pragma warning restore CS0612 // Type or member is obsolete

            laserEndParticleSystem = LaserParticles.transform.Find("Laserend").gameObject.GetComponent <ParticleSystem>();
            scaleParticleSystem    = LaserParticles.transform.Find("scale").GetComponent <ParticleSystem>();
        }
Пример #25
0
    public override void Attached()
    {
        Rigidbody componentInParent = base.GetComponentInParent <Rigidbody>();

        if (!base.entity.isOwner)
        {
            if (componentInParent)
            {
                componentInParent.useGravity  = false;
                componentInParent.isKinematic = true;
            }
            FMOD_StudioEventEmitter.CreateStartOnAwakeEmitter(base.transform, "event:/combat/molotov_held");
        }
        base.state.Transform.SetTransforms((!componentInParent) ? base.transform : componentInParent.transform);
        base.state.AddCallback("Broken", new PropertyCallbackSimple(this.doBreakReal));
    }
Пример #26
0
    private static GameObject CreateEmitter(Transform parent, Vector3 position, string eventPath, bool startEventOnAwake, bool startEventOnTriggerEnter)
    {
        GameObject gameObject = new GameObject("Audio");

        gameObject.transform.parent   = parent;
        gameObject.transform.position = position;
        gameObject.SetActive(false);
        FMOD_StudioEventEmitter fmod_StudioEventEmitter = gameObject.AddComponent <FMOD_StudioEventEmitter>();

        fmod_StudioEventEmitter.startEventOnAwake        = startEventOnAwake;
        fmod_StudioEventEmitter.startEventOnTriggerEnter = startEventOnTriggerEnter;
        fmod_StudioEventEmitter.triggerType = FMOD_StudioEventEmitter.TriggerType.EventMaximumDistance;
        fmod_StudioEventEmitter.path        = eventPath;
        gameObject.SetActive(true);
        return(gameObject);
    }
Пример #27
0
        public void AddEmitter(string path, FMOD_StudioEventEmitter studioEmitter, float radius)
        {
            if (!customEmitters.ContainsKey(path))
            {
                EventInstance evt = (EventInstance)studioEmitterEvtField.GetValue(studioEmitter);
                evt.setProperty(EVENT_PROPERTY.MINIMUM_DISTANCE, 1f);
                evt.setProperty(EVENT_PROPERTY.MAXIMUM_DISTANCE, radius);
                studioEmitterEvtField.SetValue(studioEmitter, evt);

                studioEmitters.Add(path, studioEmitter);
            }
            else
            {
                Log.Warn($"[FMODEmitterController] studioEmitters already contains {path}");
            }
        }
        public void Init()
        {
            var warper = (Resources.Load("WorldEntities/Creatures/Warper") as GameObject).GetComponent <Warper>();

            warpInEffectPrefab  = warper.warpInEffectPrefab;
            warpOutEffectPrefab = warper.warpOutEffectPrefab;

            warpedMaterial = warper.warpedMaterial;

            warpInSound  = warper.warpInSound;
            warpOutSound = warper.warpOutSound;

            overlayFXDuration = warper.overlayFXduration;

            Resources.UnloadAsset(warper);
        }
Пример #29
0
    public void TransplantEventInstance(Transform parent)
    {
        GameObject gameObject = new GameObject("Audio");

        gameObject.transform.SetParent(parent, false);
        gameObject.SetActive(false);
        FMOD_StudioEventEmitter fmod_StudioEventEmitter = gameObject.AddComponent <FMOD_StudioEventEmitter>();

        fmod_StudioEventEmitter.startEventOnAwake        = false;
        fmod_StudioEventEmitter.startEventOnTriggerEnter = false;
        fmod_StudioEventEmitter.path             = this.path;
        fmod_StudioEventEmitter.eventDescription = this.eventDescription;
        fmod_StudioEventEmitter.evt = this.evt;
        gameObject.SetActive(true);
        this.evt = null;
        this.Stop();
    }
Пример #30
0
 public static void PlayFmod(string eventPath)
 {
     if (NGUITools.mEmitter == null)
     {
         if (GameObject.Find("UIRoot/uiplayaudio") != null)
         {
             NGUITools.mEmitter = GameObject.Find("UIRoot/uiplayaudio").GetComponent <FMOD_StudioEventEmitter>();
         }
         else
         {
             NGUITools.mEmitter = GameObject.Find("UIRoot(Clone)/uiplayaudio").GetComponent <FMOD_StudioEventEmitter>();
         }
     }
     NGUITools.mEmitter.path = eventPath;
     NGUITools.mEmitter.CacheEventInstance();
     NGUITools.mEmitter.StartEvent();
 }
Пример #31
0
    public override void Awake()
    {
        FMOD_StudioEventEmitter fMOD_StudioEventEmitter = (FMOD_StudioEventEmitter)this.GetComponent(typeof(FMOD_StudioEventEmitter));

        this.WindDice     = UnityEngine.Random.Range(0, 4);
        this.WindDiceStop = UnityEngine.Random.Range(0, 3);
        if (this.WindDice == 2 && !this.Playing)
        {
            this.Playing = true;
            fMOD_StudioEventEmitter.Play();
        }
        else if (this.WindDiceStop == 2 && this.Playing)
        {
            this.Playing = false;
            fMOD_StudioEventEmitter.Stop();
        }
    }
        protected void Start()
        {
            if (repulsionCannonFireSound is null)
            {
                if (PrefabDatabase.TryGetPrefabFilename(CraftData.GetClassIdForTechType(TechType.RepulsionCannon), out var RCFilename))
                {
                    var gameObject1 = Resources.Load <GameObject>(RCFilename);
                    var component   = gameObject1.GetComponent <RepulsionCannon>();
                    repulsionCannonFireSound = component.shootSound;
                    gameObject1.SetActive(false);
                }

                if (PrefabDatabase.TryGetPrefabFilename(CraftData.GetClassIdForTechType(TechType.StasisRifle), out var SRFilename))
                {
                    var gameObject2 = Resources.Load <GameObject>(SRFilename);
                    var component2  = gameObject2.GetComponent <StasisRifle>();
                    stasisRifleFireSound = component2.fireSound;
                    stasisRifleEvent     = component2.chargeBegin;
                    gameObject2.SetActive(false);
                }

                if (PrefabDatabase.TryGetPrefabFilename(CraftData.GetClassIdForTechType(TechType.PropulsionCannon), out var PCFilename))
                {
                    var gameObject3 = Resources.Load <GameObject>(PCFilename);
                    var component3  = gameObject3.GetComponent <PropulsionCannon>();
                    modeChangeSound = component3.shootSound;
                    gameObject3.SetActive(false);
                }

                if (PrefabDatabase.TryGetPrefabFilename(CraftData.GetClassIdForTechType(TechType.Welder), out var WFilename))
                {
                    var gameObject4 = Resources.Load <GameObject>(WFilename);
                    var component4  = gameObject4.GetComponent <Welder>();
                    laserShootSound = component4.weldSound;
                    gameObject4.SetActive(false);
                }

                Transform transform1;
                laserEndParticleSystem = LaserParticles.transform.Find("Laserend").gameObject.GetComponent <ParticleSystem>();
                scaleParticleSystem    = LaserParticles.transform.Find("scale").GetComponent <ParticleSystem>();
            }
            else
            {
                rigidbody.detectCollisions = true;
            }
        }
Пример #33
0
	//the start access and saves a few "pointers" to the necessary scrips and variables

	//(this is to provide shortcuts to what we want to access and/or change)
	void Start(){
		try{
		m_Emitter = gameObject.GetComponent<FMOD_StudioEventEmitter> ();
		}catch{
			Debug.LogWarning("No Emitter attached to this object, i guess i have to do EVERYTHING myself");
			//AttachFmodEmitter();
		}

		surfaceTexture = gameObject.GetComponent<GetDominantTexture> ();

		if(m_Parameter == null){
			try{
				m_Parameter = m_Emitter.getParameter("Surface");
			} catch  {
				Debug.LogWarning("FMOD parameter failed, will try again");
				//TryGetParameterAgain();
			}
		}
	}
Пример #34
0
    static void DrawGizmo(FMOD_StudioEventEmitter studioEmitter, GizmoType gizmoType)
    {
        if (studioEmitter.asset != null && studioEmitter.enabled &&
            (!UnityEditor.EditorApplication.isPlayingOrWillChangePlaymode || UnityEditor.EditorApplication.isPlaying))
        {
            FMOD.Studio.EventDescription desc = null;
            desc = FMODEditorExtension.GetEventDescription(studioEmitter.asset.id);

            if (desc != null)
            {
                float max, min;
                desc.getMaximumDistance(out max);
                desc.getMinimumDistance(out min);

                Gizmos.color = Color.blue;
                Gizmos.DrawWireSphere(studioEmitter.transform.position, min);
                Gizmos.DrawWireSphere(studioEmitter.transform.position, max);
            }
        }
    }
	void Awake()
	{
        emitter = (FMOD_StudioEventEmitter)target;
		
		is3D = false;

        if (emitter == null || emitter.asset == null)
        {
            return;
        }
		
		FMOD.Studio.EventDescription desc = FMODEditorExtension.GetEventDescription(emitter.asset.id);
		
		if (desc != null)
		{
			desc.is3D(out is3D);
			desc.getMinimumDistance(out minDistance);
			desc.getMaximumDistance(out maxDistance);
		}
	}
 // Use this for initialization
 void Start()
 {
     inventory = GameObject.FindGameObjectWithTag("Inventory").GetComponent<Inventory>();
     animator = this.GetComponent<Animator>();
     health = GameControl.control.health;
     tempSpeed = speed + new Vector2 (0, 0);
     //hearts.Add(GameObject.FindGameObjectsWithTag("Health"));
     //GameControl.control.UpdateHealth ();
     emitter = GetComponent<FMOD_StudioEventEmitter> ();
     direction = GameControl.control.direction;
     animator.SetInteger ("direction", direction);
 }
Пример #37
0
	void Start()
	{
		r_Emitter = GetComponent<FMOD_StudioEventEmitter> ();
	}
Пример #38
0
    void SilenceAll(FMOD_StudioEventEmitter ev)
    {
        FMOD.Studio.ParameterInstance param = ev.getParameter(FModParamName);
           if (param != null)
          param.setValue(0.0f);

           for (int i = 0; i < Substitutions.Length; i++)
           {
          FMOD.Studio.ParameterInstance sParm = ev.getParameter(Substitutions[i].SubstituteParamName);
          if (sParm != null)
             sParm.setValue(0.0f);
           }
    }
Пример #39
0
	//This function is obsolete and do not function the way i want
	private void AttachFmodEmitter()
	{
		if(GetComponents<FMOD_StudioEventEmitter>().Length != 0)
		{
			foreach(FMOD_StudioEventEmitter see in GetComponents<FMOD_StudioEventEmitter>())
			{
				Destroy(see);
			}
		}
		if(GetComponent<FMOD_StudioEventEmitter>() == null)
		{
			gameObject.AddComponent<FMOD_StudioEventEmitter>();

			FMOD_StudioEventEmitter emitter = gameObject.GetComponent<FMOD_StudioEventEmitter>();
			emitter.startEventOnAwake = false;

			m_Emitter = emitter;
		}
	}
 void Awake()
 {
     emitter = (FMOD_StudioEventEmitter)target;
 }
Пример #41
0
 // Use this for initialization
 void Start()
 {
     isPressed = false;
     door = GameObject.FindGameObjectsWithTag("door")[0].GetComponent<changeSceneScript>();
     emitter = GetComponent<FMOD_StudioEventEmitter> ();
 }
Пример #42
0
    void Start()
    {
        //print out color of each candle along with where in the progression it lives
        /*int progreshIdx = -1;
        for(int i = 0 ; i < Nights2Mgr.Instance.CandlePathOrderLength() ; i++)
        {
           if (Nights2Mgr.Instance.GetPath(i).LeadsToBeacon == this)
           {
              progreshIdx = i;
              break;
           }
        }
        Debug.Log("color " +  progreshIdx + ": ( " + CandleColor.r * 255.0f + ", " + CandleColor.g * 255.0f + ", " + CandleColor.b * 255.0f + " ) " + gameObject.name); */

        if (Nights2SpotMgr.Instance != null)
            _closestSpot = Nights2SpotMgr.Instance.FindClosestSpotTo(transform.position);

        _animator = gameObject.GetComponent<Animator>();

        EightNightsMgr.GroupID group = Nights2AudioMgr.Instance.GetGroupForBeacon(this);
        _narrationSound = Nights2AudioMgr.Instance.GetNarrationForGroup(group);
        if (_narrationSound != null)
        {
           _narrationMeter = _narrationSound.gameObject.GetComponent<FModLevelMeter>();
           _narrationFFT = _narrationSound.gameObject.GetComponent<FModPrecomputedFFT>();
        }
        _narrationDuration = Nights2AudioMgr.Instance.GetNarrationTimeForGroup(group);

        SetIsNext(false);
        SetLit(false);

        //set our color
        for (int i = 0; i < DriveColors.Length; i++)
        {
           Renderer r = DriveColors[i].Mesh;
           string propName = DriveColors[i].ColorPropName;
           if ((r != null) && (propName.Length > 0))
              r.material.SetColor(propName, CandleColor);
        }

        //subscribe to state changed events
        if (Nights2Mgr.Instance != null)
        {
           Nights2Mgr.Instance.OnTeleported += OnTeleported;
           Nights2Mgr.Instance.OnStateChanged += OnNights2StateChanged;
        }
    }
Пример #43
0
 void Start()
 {
     _event = gameObject.GetComponent<FMOD_StudioEventEmitter>();
       Load();
 }
Пример #44
0
 void Start()
 {
     fmodSource = GetComponent<FMOD_StudioEventEmitter>();
 }