コード例 #1
0
 private void playSoundForEmote(EmoteDefinition definition)
 {
     if (!string.IsNullOrEmpty(definition.Sound))
     {
         DataEntityHandle handle = Service.Get <CPDataEntityCollection>().FindEntity <SessionIdData, long>(sessionId);
         if (Service.Get <CPDataEntityCollection>().TryGetComponent <GameObjectReferenceData>(handle, out var component))
         {
             SoundUtils.PlayAudioEvent(definition.Sound, component.GameObject);
         }
     }
 }
コード例 #2
0
        private void damageItem()
        {
            if (currentHitPoints <= 0)
            {
                return;
            }
            currentHitPoints--;
            int num = ThresholdData.Length;

            for (int i = 0; i < num; i++)
            {
                if (currentHitPoints == ThresholdData[i].Threshold)
                {
                    if (i == 0 && DestroyedParticles != null)
                    {
                        createParticles(DestroyedParticles);
                    }
                    else
                    {
                        createParticles(DamagedParticles);
                    }
                    if (UseAnimTriggers)
                    {
                        setAnimTrigger(ThresholdData[i].TriggerName);
                    }
                    else
                    {
                        setMeshFrame(currentHitPoints);
                    }
                    if (currentHitPoints > 0)
                    {
                        iTween.PunchPosition(base.gameObject, iTween.Hash("position", base.gameObject.transform.position, "amount", DamageDimensions, "easeType", DamageEaseType, "time", DamageTweenTime));
                        SoundUtils.PlayAudioEvent(AudioDamage, base.gameObject);
                    }
                    else
                    {
                        SoundUtils.PlayAudioEvent(AudioDestroyed, base.gameObject);
                    }
                }
            }
            if (currentHitPoints <= 0)
            {
                currentHitPoints = 0;
                if (RestoreAfterSeconds > 0f)
                {
                    Invoke("resetItem", RestoreAfterSeconds);
                }
            }
        }
コード例 #3
0
 private void resetItem()
 {
     SoundUtils.PlayAudioEvent(AudioReappear, base.gameObject);
     createParticles(AppearParticles);
     initialize();
 }