コード例 #1
0
 public bool TryGetWideEnvIDList(
     SoundPack.PlayAreaType areaType,
     Weather weather,
     ref List <int> idList)
 {
     if (idList == null)
     {
         return(false);
     }
     SoundPack.WideRangeEnviroInfo envInfo1;
     if (this._wideRangeEnvTable.TryGetValue(areaType, out envInfo1))
     {
         int[] wideEnviroId = this.GetWideEnviroID(envInfo1, weather);
         if (!wideEnviroId.IsNullOrEmpty <int>())
         {
             idList.AddRange((IEnumerable <int>)wideEnviroId);
             return(true);
         }
     }
     SoundPack.WideRangeEnviroInfo envInfo2;
     if (this._wideRangeEnvTable.TryGetValue(SoundPack.PlayAreaType.Normal, out envInfo2))
     {
         int[] wideEnviroId = this.GetWideEnviroID(envInfo2, weather);
         if (!wideEnviroId.IsNullOrEmpty <int>())
         {
             idList.AddRange((IEnumerable <int>)wideEnviroId);
             return(true);
         }
     }
     return(false);
 }
コード例 #2
0
        public override void Do()
        {
            base.Do();
            int num1 = 0;

            string[] args1  = this.args;
            int      index1 = num1;
            int      num2   = index1 + 1;
            int      num3   = int.Parse(args1[index1]);

            string[] args2    = this.args;
            int      index2   = num2;
            int      num4     = index2 + 1;
            bool     bareFoot = bool.Parse(args2[index2]);

            string[] args3  = this.args;
            int      index3 = num4;
            int      num5   = index3 + 1;

            AIProject.Definitions.Map.FootStepSE seType = (AIProject.Definitions.Map.FootStepSE)PlayFootStepSE.Get <AIProject.Definitions.Map.FootStepSE>(args3[index3]);
            string[] args4   = this.args;
            int      index4  = num5;
            int      num6    = index4 + 1;
            Weather  weather = (Weather)PlayFootStepSE.Get <Weather>(args4[index4]);

            string[] args5  = this.args;
            int      index5 = num6;
            int      num7   = index5 + 1;

            SoundPack.PlayAreaType areaType = (SoundPack.PlayAreaType)PlayFootStepSE.Get <SoundPack.PlayAreaType>(args5[index5]);
            string posStr = string.Empty;

            string[] args6  = this.args;
            int      index6 = num7;
            int      num8   = index6 + 1;

            System.Action <string> act = (System.Action <string>)(s => posStr = s);
            args6.SafeProc(index6, act);
            AudioSource audioSource = Singleton <Resources> .Instance.SoundPack.PlayFootStep((byte)num3, bareFoot, seType, weather, areaType);

            if (!Object.op_Inequality((Object)audioSource, (Object)null))
            {
                return;
            }
            Vector3 vector3;

            if (this.scenario.commandController.V3Dic.TryGetValue(posStr, out vector3))
            {
                ((Component)audioSource).get_transform().set_position(vector3);
            }
            else
            {
                if (!Object.op_Inequality((Object)this.scenario.AdvCamera, (Object)null))
                {
                    return;
                }
                ((Component)audioSource).get_transform().set_position(((Component)this.scenario.AdvCamera).get_transform().get_position());
            }
        }
コード例 #3
0
        public AudioSource PlayFootStep(
            byte sex,
            bool bareFoot,
            AIProject.Definitions.Map.FootStepSE seType,
            Weather weather,
            SoundPack.PlayAreaType areaType)
        {
            if (sex != (byte)0 && sex != (byte)1)
            {
                return((AudioSource)null);
            }
            List <int> source = (List <int>)null;

            if (areaType == SoundPack.PlayAreaType.Normal && source.IsNullOrEmpty <int>() && (weather == Weather.Rain || weather == Weather.Storm))
            {
                if (!(sex != (byte)0 ? this._femaleRainFootStepSEMeshTable : this._maleRainFootStepSEMeshTable).TryGetValue(seType, out source))
                {
                    source = (List <int>)null;
                }
                else if (source.IsNullOrEmpty <int>())
                {
                    return((AudioSource)null);
                }
            }
            if (bareFoot && source.IsNullOrEmpty <int>())
            {
                if (!(sex != (byte)0 ? this._femaleBareFootStepSEMeshTable : this._maleBareFootStepSEMeshTable).TryGetValue(seType, out source))
                {
                    source = (List <int>)null;
                }
                else if (source.IsNullOrEmpty <int>())
                {
                    return((AudioSource)null);
                }
            }
            if (source.IsNullOrEmpty <int>())
            {
                if (!(sex != (byte)0 ? this._femaleFootStepSEMeshTable : this._maleFootStepSEMeshTable).TryGetValue(seType, out source))
                {
                    return((AudioSource)null);
                }
                if (source.IsNullOrEmpty <int>())
                {
                    return((AudioSource)null);
                }
            }
            if (source.IsNullOrEmpty <int>())
            {
                return((AudioSource)null);
            }
            int key = source[Random.Range(0, source.Count)];

            SoundPack.Data2D data2D;
            return(!(sex != (byte)0 ? this._femaleFootStepSEData : this._maleFootStepSEData).TryGetValue(key, out data2D) ? (AudioSource)null : this.Play((SoundPack.IData)data2D, Manager.Sound.Type.GameSE3D, 0.0f));
        }
コード例 #4
0
        public AudioSource PlayFootStep(
            byte sex,
            bool bareFoot,
            int mapID,
            int areaID,
            Weather weather,
            SoundPack.PlayAreaType areaType)
        {
            if (!Singleton <Resources> .IsInstance())
            {
                return((AudioSource)null);
            }
            if (sex != (byte)0 && sex != (byte)1)
            {
                return((AudioSource)null);
            }
            int[] source = (int[])null;
            Dictionary <int, Dictionary <int, ValueTuple <int[], int[], int[]> > > dictionary1;
            Dictionary <int, ValueTuple <int[], int[], int[]> > dictionary2;
            ValueTuple <int[], int[], int[]> valueTuple;

            if (Singleton <Resources> .Instance.Sound.DefaultFootStepSETable.TryGetValue((int)sex, out dictionary1) && dictionary1.TryGetValue(mapID, out dictionary2) && dictionary2.TryGetValue(areaID, out valueTuple))
            {
                if (areaType == SoundPack.PlayAreaType.Normal && source.IsNullOrEmpty <int>() && (weather == Weather.Rain || weather == Weather.Storm))
                {
                    source = (int[])valueTuple.Item3;
                }
                if (bareFoot && source.IsNullOrEmpty <int>())
                {
                    source = (int[])valueTuple.Item2;
                }
                if (source.IsNullOrEmpty <int>())
                {
                    source = (int[])valueTuple.Item1;
                }
            }
            if (source.IsNullOrEmpty <int>())
            {
                return((AudioSource)null);
            }
            int key = source[Random.Range(0, source.Length)];

            SoundPack.Data2D data2D;
            return(!(sex != (byte)0 ? this._femaleFootStepSEData : this._maleFootStepSEData).TryGetValue(key, out data2D) ? (AudioSource)null : this.Play((SoundPack.IData)data2D, Manager.Sound.Type.GameSE3D, 0.0f));
        }
コード例 #5
0
 public AudioSource PlayFootStep(
     byte sex,
     bool bareFoot,
     string tag,
     Weather weather,
     SoundPack.PlayAreaType areaType)
 {
     if (tag == "Untagged")
     {
         return((AudioSource)null);
     }
     if (sex != (byte)0 && sex != (byte)1)
     {
         return((AudioSource)null);
     }
     AIProject.Definitions.Map.FootStepSE seType;
     return(!this._footStepSETagTable.TryGetValue(tag ?? string.Empty, out seType) ? (AudioSource)null : this.PlayFootStep(sex, bareFoot, seType, weather, areaType));
 }