//---------------------------------------------------------------------------------- public override void FreeResources() { FieldControllerA.DestroyField(); FieldControllerB.DestroyField(); eManager.DestroyEntity(Data); }
//----------------------------------------------------------------------------------- public override void FreeResources() { DestroyEntities(); FieldControllerA.DestroyField(); FieldControllerB.DestroyField(); FieldControllerC.DestroyField(); }
//---------------------------------------------------------------------------------- public override void ApplyEntitySpec() { GameObject[] arrGameObjectA = FieldControllerA.GetUnityGameObjects(); GameObject[] arrGameObjectB = FieldControllerB.GetUnityGameObjects(); eManager.RecreateSubstituter(Data, arrGameObjectA, arrGameObjectB); }
//---------------------------------------------------------------------------------- public override void ApplyEntitySpec() { GameObject[] arrGameObjectA = FieldControllerA.GetUnityGameObjects(); GameObject[] arrGameObjectB = FieldControllerB.GetUnityGameObjects(); CommandNode[] arrCommandNode = FieldController.GetCommandNodes(); eManager.RecreateTriggerByContact(Data, arrGameObjectA, arrGameObjectB, arrCommandNode); }
//----------------------------------------------------------------------------------- public override void Init() { base.Init(); CNField.AllowedTypes allowedTypes = CNField.AllowedTypes.Geometry | CNField.AllowedTypes.RigidBodyNode; FieldControllerA.SetFieldType(allowedTypes); FieldControllerB.SetFieldType(allowedTypes); }
//----------------------------------------------------------------------------------- public void CheckUpdate() { bool updateNeeded = (FieldControllerA.IsUpdateNeeded() || FieldControllerB.IsUpdateNeeded()); if (updateNeeded) { Data.NeedsUpdate = true; EditorUtility.SetDirty(Data); } }
//----------------------------------------------------------------------------------- public override void Init() { base.Init(); CNFieldContentType allowedTypes = CNFieldContentType.Geometry | CNFieldContentType.RigidBodyNode | CNFieldContentType.IrresponsiveNode; FieldControllerA.SetFieldContentType(allowedTypes); FieldControllerB.SetFieldContentType(allowedTypes); }
//----------------------------------------------------------------------------------- public void CheckUpdate() { bool creationModeWithLocators = (Data.CreationMode == CNJointGroups.CreationModeEnum.AtLocatorsBBoxCenters || Data.CreationMode == CNJointGroups.CreationModeEnum.AtLocatorsPositions || Data.CreationMode == CNJointGroups.CreationModeEnum.AtLocatorsVertexes); bool updateNeeded = Data.NeedsUpdate || (FieldControllerA.IsUpdateNeeded() || FieldControllerB.IsUpdateNeeded() || (FieldControllerC.IsUpdateNeeded() && creationModeWithLocators)); if (updateNeeded) { DestroyEntities(); } }
//----------------------------------------------------------------------------------- public void CreateEntities() { if (!IsExcludedInHierarchy) { GameObject[] arrGameObjectA; GameObject[] arrGameObjectB; Vector3[] arrLocatorsC; GetFieldGameObjects(FieldControllerA, out arrGameObjectA); GetFieldGameObjects(FieldControllerB, out arrGameObjectB); bool fieldAIsReallyEmpty = FieldControllerA.HasNoReferences(); bool fieldBIsReallyEmpty = FieldControllerB.HasNoReferences(); GetFieldLocators(FieldControllerC, out arrLocatorsC); eManager.CreateMultiJoint(Data, arrGameObjectA, arrGameObjectB, arrLocatorsC, fieldAIsReallyEmpty, fieldBIsReallyEmpty); cnManager.SceneSelection(); LoadState(); } }
//----------------------------------------------------------------------------------- public override void SetScopeId(uint scopeId) { FieldControllerA.SetScopeId(scopeId); FieldControllerB.SetScopeId(scopeId); }
//----------------------------------------------------------------------------------- public override void BuildListItems() { FieldControllerA.BuildListItems(); FieldControllerB.BuildListItems(); }
//----------------------------------------------------------------------------------- public override void StoreInfo() { FieldControllerA.StoreFieldInfo(); FieldControllerB.StoreFieldInfo(); }
//----------------------------------------------------------------------------------- public override void LoadInfo() { FieldControllerA.RestoreFieldInfo(); FieldControllerB.RestoreFieldInfo(); }
//----------------------------------------------------------------------------------- public void AddGameObjectsToB(UnityEngine.Object[] draggedObjects, bool recalculateFields) { FieldControllerB.AddGameObjects(draggedObjects, recalculateFields); }