Пример #1
0
 // Methods
 static SeasonChange()
 {
     SeasonChange[][] changeArrayArray1 = new SeasonChange[5][];
     changeArrayArray1[0] = new SeasonChange[2];
     changeArrayArray1[1] = new SeasonChange[2];
     changeArrayArray1[2] = new SeasonChange[2];
     changeArrayArray1[3] = new SeasonChange[2];
     changeArrayArray1[4] = new SeasonChange[2];
     SeasonChange.m_Cache = changeArrayArray1;
 }
Пример #2
0
        public static SeasonChange Instantiate(int season, bool playSound)
        {
            int          num1;
            SeasonChange change1;

            if ((season >= 0) && (season < SeasonChange.m_Cache.Length))
            {
                num1    = (playSound ? 1 : 0);
                change1 = SeasonChange.m_Cache[season][num1];
                if (change1 == null)
                {
                    SeasonChange.m_Cache[season][num1] = (change1 = new SeasonChange(season, playSound));
                }
                return(change1);
            }
            return(new SeasonChange(season, playSound));
        }
Пример #3
0
        public static SeasonChange Instantiate(int season, bool playSound)
        {
            if (season >= 0 && season < m_Cache.Length)
            {
                var idx = playSound ? 1 : 0;

                var p = m_Cache[season][idx];

                if (p == null)
                {
                    m_Cache[season][idx] = p = new SeasonChange(season, playSound);
                    p.SetStatic();
                }

                return(p);
            }

            return(new SeasonChange(season, playSound));
        }
Пример #4
0
        public static SeasonChange Instantiate( int season, bool playSound )
        {
            if ( season >= 0 && season < m_Cache.Length )
            {
                int idx = playSound ? 1 : 0;

                SeasonChange p = m_Cache[season][idx];

                if ( p == null )
                    m_Cache[season][idx] = p = new SeasonChange( season, playSound );

                return p;
            }
            else
            {
                return new SeasonChange( season, playSound );
            }
        }
Пример #5
0
 public static SeasonChange Instantiate(int season)
 {
     return(SeasonChange.Instantiate(season, true));
 }