// LOGIC public void Initialize(string i_DatabasePath) { tnBallsDatabase database = Resources.Load <tnBallsDatabase>(i_DatabasePath); if (database != null) { m_BallPrefabPath = database.ballPrefabPath; for (int index = 0; index < database.ballsCount; ++index) { tnBallDataEntry entry = database.GetBallDataEntry(index); if (entry != null) { string key = entry.id; tnBallDataDescriptor descriptor = entry.descriptor; if (key != "" && descriptor != null) { int hash = StringUtils.GetHashCode(key); tnBallData data = new tnBallData(descriptor); m_Data.Add(hash, data); m_Keys.Add(hash); } } } } else { LogManager.LogWarning(this, "Database not loaded."); } }
// CTOR public tnBallData(tnBallDataDescriptor i_Descriptor) { if (i_Descriptor != null) { m_Name = i_Descriptor.ballName; m_Texture = i_Descriptor.texture; m_TrailMaterial = i_Descriptor.trailMaterial; m_ParticleEffect = i_Descriptor.particleEffect; m_Icon = i_Descriptor.icon; m_CanRotate = i_Descriptor.canRotate; } }