static public void RegisterModificationTargetTransformHierarchy(ITE3SceneModificationReceiver receiver, Transform target) { for (var xform = target; xform; xform = xform.parent) { RegisterModificationTarget(receiver, xform); } }
static public void RegisterModificationReceiver(ITE3SceneModificationReceiver receiver) { Debug.Assert(!ms_ModificationReceiverTargets.ContainsKey(receiver)); ms_ModificationReceiverTargets.Add(receiver, new List <Component>()); foreach (var receivers in ms_TargetToReceiverMap.Values) { receivers.Remove(receiver); } }
static public void UnregisterModificationTarget(ITE3SceneModificationReceiver receiver, Component target) { Debug.Assert(ms_ModificationReceiverTargets.ContainsKey(receiver)); Debug.Assert(ms_TargetToReceiverMap.ContainsKey(target)); ms_ModificationReceiverTargets[receiver].Remove(target); var receivers = ms_TargetToReceiverMap[target]; receivers.Remove(receiver); if (receivers.Count == 0) { ms_TargetToReceiverMap.Remove(target); } }
static public void RegisterModificationTarget(ITE3SceneModificationReceiver receiver, Component target) { Debug.Assert(ms_ModificationReceiverTargets.ContainsKey(receiver)); ms_ModificationReceiverTargets[receiver].Add(target); List <ITE3SceneModificationReceiver> receivers; if (!ms_TargetToReceiverMap.TryGetValue(target, out receivers)) { receivers = ms_TargetToReceiverMap[target] = new List <ITE3SceneModificationReceiver>(); } receivers.Add(receiver); }
static public void UnregisterModificationReceiver(ITE3SceneModificationReceiver receiver) { Debug.Assert(ms_ModificationReceiverTargets.ContainsKey(receiver)); ms_ModificationReceiverTargets.Remove(receiver); }