public void ObjectRemoved(DecorationLayoutData data, GameObject go) { ManipulatableStructure component = go.GetComponent <ManipulatableStructure>(); if ((bool)component) { Object.Destroy(component); } }
public void ObjectAdded(DecorationLayoutData data, GameObject go) { if (data.Type == DecorationLayoutData.DefinitionType.Structure) { ManipulatableStructure manipulatableStructure = go.AddComponent <ManipulatableStructure>(); int sizeUnits = 0; if (structureDefinitions.TryGetValue(data.DefinitionId, out StructureDefinition value)) { sizeUnits = value.SizeUnits; } manipulatableStructure.SizeUnits = sizeUnits; } }
public void AfterObjectSelected(ManipulatableObject obj, bool isNewObject) { if (obj.GetComponent <ManipulatableStructure>() != null) { ObjectManipulator component = obj.GetComponent <ObjectManipulator>(); ManipulatableStructure component2 = obj.GetComponent <ManipulatableStructure>(); component.BaseLocationIsValid = !isNewObject; for (int i = 0; i < attractors.Count; i++) { attractors[i].SetTrackedObject(component, component2.SizeUnits, sceneManipulationService.ObjectManipulationInputController); attractors[i].OnAttracted += onAttracted; } } }