public void RemoveChild() { VFXModel modelA = ScriptableObject.CreateInstance <VFXModelA>(); VFXModel modelB = ScriptableObject.CreateInstance <VFXModelB>(); VFXModel modelC = ScriptableObject.CreateInstance <VFXModelC>(); // First add children but don't notify modelB.Attach(modelA, false); modelC.Attach(modelB, false); // Test both interfaces s_logs.Clear(); modelC.Detach(); modelA.RemoveChild(modelB); Assert.AreEqual(0, modelA.GetNbChildren()); Assert.IsNull(modelB.GetParent()); Assert.AreEqual(0, modelB.GetNbChildren()); Assert.IsNull(modelC.GetParent()); Assert.AreEqual(5, s_logs.Count); Assert.AreEqual("OnRemoved VFXModelC", s_logs[0]); Assert.AreEqual("OnInvalidate VFXModelB kStructureChanged", s_logs[1]); Assert.AreEqual("OnInvalidate VFXModelA kStructureChanged", s_logs[2]); Assert.AreEqual("OnRemoved VFXModelB", s_logs[3]); Assert.AreEqual("OnInvalidate VFXModelA kStructureChanged", s_logs[4]); }