Example #1
0
        public PrefabData(VehicleInfo info)
        {
            this._info = info;
            Utils.Log((object)("Creating PrefabData for " + this.ObjectName));
            if (this.ObjectName == "451494281.London 1992 Stock (4 car)_Data")
            {
                int length = 3;
                this._info.m_trailers = new VehicleInfo.VehicleTrailer[length];
                for (int index = 0; index < length; ++index)
                {
                    this._info.m_trailers[index].m_info = this._info;
                    this._info.m_trailers[index].m_invertProbability = 50;
                    this._info.m_trailers[index].m_probability       = 100;
                }
            }
            else if (this.ObjectName.Contains("D3S Solaris Urbino 24 '15") && this._info.m_trailers != null && this._info.m_trailers.Length != 0)
            {
                this._info.m_dampers = 0.6f;
                VehicleInfo loaded = PrefabCollection <VehicleInfo> .FindLoaded(this.ObjectName.Substring(0, this.ObjectName.IndexOf(".")) + ".D3S Solaris Urbino 24 '15 (II)_Data");

                if ((UnityEngine.Object)loaded != (UnityEngine.Object)null)
                {
                    Utils.Log((object)("Fixing " + this.ObjectName));
                    this._info.m_trailers[0].m_info.m_dampers = 0.6f;
                    loaded.m_attachOffsetFront      = 1.07f;
                    loaded.m_dampers                = 0.6f;
                    this._info.m_trailers[1].m_info = loaded;
                    this._info.m_trailers[1].m_invertProbability = 0;
                    this._info.m_trailers[1].m_probability       = 100;
                    this.ApplyBackEngine(loaded, 0);
                }
            }
            if (this._info.m_trailers != null)
            {
                int length = this._info.m_trailers.Length;
                if (length > 0)
                {
                    this._lastTrailer = this._info.m_trailers[length - 1];
                    this._trailerData = new PrefabData[length];
                    for (int index = 0; index < length; ++index)
                    {
                        VehicleInfo info1 = this._info.m_trailers[index].m_info;
                        if ((UnityEngine.Object)info1 != (UnityEngine.Object)null)
                        {
                            this._trailerData[index] = PrefabData.CreateTrailerData(info1);
                        }
                    }
                }
            }
            this.CacheDefaults();
            this.LoadPrefabData();
        }