private bool Remove(int index) { if (index >= 0 && index < m_AddedCurves.Count) { // Make color available again Color color = m_AddedCurves[index].m_Color; m_AvailableColors.Add(color); // Remove from inspector state string curveName = m_AddedCurves[index].m_UniqueName; SessionState.EraseVector3(curveName); // Remove from list m_AddedCurves.RemoveAt(index); // When no added curves reset available colors if (m_AddedCurves.Count == 0) { //if (m_AvailableColors.Count != m_Colors.Length) // Debug.LogError ("Color count mismatch : " + m_AvailableColors.Count + " != " + m_Colors.Length); m_AvailableColors = new List <Color>(m_Colors); } return(true); } Debug.Log("Invalid index in ParticleSystemCurveEditor::Remove"); return(false); }
private bool Remove(int index) { if (index >= 0 && index < this.m_AddedCurves.Count) { this.m_AvailableColors.Add(this.m_AddedCurves[index].m_Color); SessionState.EraseVector3(this.m_AddedCurves[index].m_UniqueName); this.m_AddedCurves.RemoveAt(index); if (this.m_AddedCurves.Count == 0) { this.m_AvailableColors = new List <Color>((IEnumerable <Color>) this.m_Colors); } return(true); } Debug.Log((object)"Invalid index in ParticleSystemCurveEditor::Remove"); return(false); }
private bool Remove(int index) { if ((index >= 0) && (index < this.m_AddedCurves.Count)) { Color item = this.m_AddedCurves[index].m_Color; this.m_AvailableColors.Add(item); SessionState.EraseVector3(this.m_AddedCurves[index].m_UniqueName); this.m_AddedCurves.RemoveAt(index); if (this.m_AddedCurves.Count == 0) { this.m_AvailableColors = new List<Color>(this.m_Colors); } return true; } Debug.Log("Invalid index in ParticleSystemCurveEditor::Remove"); return false; }
private bool Remove(int index) { bool result; if (index >= 0 && index < this.m_AddedCurves.Count) { Color color = this.m_AddedCurves[index].m_Color; this.m_AvailableColors.Add(color); string uniqueName = this.m_AddedCurves[index].m_UniqueName; SessionState.EraseVector3(uniqueName); this.m_AddedCurves.RemoveAt(index); if (this.m_AddedCurves.Count == 0) { this.m_AvailableColors = new List <Color>(this.m_Colors); } result = true; } else { Debug.Log("Invalid index in ParticleSystemCurveEditor::Remove"); result = false; } return(result); }