private bool IsCanUpdate() { if (this.prefabRoot == null) { return(false); } MaterialControllerMark component = this.prefabRoot.get_gameObject().GetComponent <MaterialControllerMark>(); return(!(component != null) || !(component.Current != null) || this is ChangeMaterialBase); }
protected void ClearChangeMaterialMark() { if (this.prefabRoot != null) { MaterialControllerMark component = this.prefabRoot.get_gameObject().GetComponent <MaterialControllerMark>(); if (component != null && component.Current != null) { component.Current = null; } } }
protected void SetChangeMaterialMark() { this.UseOriginalPrevious = false; MaterialControllerMark materialControllerMark = this.prefabRoot.get_gameObject().AddUniqueComponent <MaterialControllerMark>(); if (materialControllerMark.Current != null && materialControllerMark.Current.GetInstanceID() != base.GetInstanceID()) { this.UseOriginalPrevious = true; this.SaveMarkMaterials(materialControllerMark); materialControllerMark.Current.m_src_matmap.Clear(); materialControllerMark.Current.DoOnDisable(); } materialControllerMark.Current = this; }
protected void SaveMarkMaterials(MaterialControllerMark mark) { if (mark == null) { return; } if (mark.Current == null) { return; } if (mark.Current.m_src_matmap.get_Count() <= 0) { return; } using (Dictionary <int, Material[]> .Enumerator enumerator = mark.Current.m_src_matmap.GetEnumerator()) { while (enumerator.MoveNext()) { KeyValuePair <int, Material[]> current = enumerator.get_Current(); this.m_src_matmap.set_Item(current.get_Key(), current.get_Value()); } } }