private void Update() { if (referenceModel != null && changeCount != referenceModel.changeCount) { referenceModel.CopyModelTo(this); } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); LowPolyModel lpm = target as LowPolyModel; EditorGUILayout.LabelField("ChangeCount: " + lpm.changeCount); if (lpm.referenceModel != null) { if (GUILayout.Button("Apply changes to reference")) { lpm.CopyModelTo(lpm.referenceModel); } } else { if (GUILayout.Button("Send changes")) { lpm.changeCount++; } } }