private void removeObjectManipulators()
 {
     modifyObjectManipulators(delegate(GameObject go, DecorationLayoutData data)
     {
         ManipulatableObjectEffects component = go.GetComponent <ManipulatableObjectEffects>();
         if ((bool)component)
         {
             UnityEngine.Object.Destroy(component);
         }
         ManipulatableObject component2 = go.GetComponent <ManipulatableObject>();
         if ((bool)component2)
         {
             component2.OnRemoved           -= onObjectRemoved;
             component2.BeforeParentChanged -= onBeforeManipulatableObjectReParented;
             component2.AfterParentChanged  -= onAfterManipulatableObjectReParented;
             UnityEngine.Object.Destroy(component2);
         }
         CollidableObject component3 = go.GetComponent <CollidableObject>();
         if ((bool)component3)
         {
             UnityEngine.Object.Destroy(component3);
         }
         for (int i = 0; i < sceneModifiers.Length; i++)
         {
             sceneModifiers[i].ObjectRemoved(data, go);
         }
     });
 }
    public void ProcessObject(GameObject go)
    {
        ManipulatableObjectEffects component = go.GetComponent <ManipulatableObjectEffects>();

        if (component != null && go.GetComponent <ManipulatableStructure>() == null)
        {
            component.SetSelectable(!structuresEnabled);
        }
        PartneredObject component2 = go.GetComponent <PartneredObject>();

        if (component2 != null)
        {
            sceneManipulationService.numberTracker.RegisterNumber(component2.Number);
        }
    }
        private void onObjectedDeselected(ObjectManipulator obj)
        {
            ManipulatableObject        component  = obj.GetComponent <ManipulatableObject>();
            ManipulatableObjectEffects component2 = obj.gameObject.GetComponent <ManipulatableObjectEffects>();
            Rigidbody component3 = obj.gameObject.GetComponent <Rigidbody>();

            if (!obj.WasReparented)
            {
                DecorationLayoutData decorationLayoutData = default(DecorationLayoutData);
                decorationLayoutData.Id           = DecorationLayoutData.ID.FromFullPath(GetRelativeGameObjectPath(obj.gameObject));
                decorationLayoutData.DefinitionId = component.DefinitionId;
                decorationLayoutData.Type         = component.Type;
                decorationLayoutData.Position     = obj.transform.localPosition;
                decorationLayoutData.Rotation     = obj.transform.localRotation;
                decorationLayoutData.UniformScale = obj.transform.localScale.x;
                DecorationLayoutData data = decorationLayoutData;
                SetCustomPropertiesInDecoration(ref data, obj.GetComponent <PartneredObject>());
                if (selectedObjectStartingId == null)
                {
                    SceneLayoutData.AddDecoration(data);
                }
                else
                {
                    string relativeGameObjectPath = GetRelativeGameObjectPath(component.gameObject);
                    SceneLayoutData.UpdateDecoration(relativeGameObjectPath, data);
                }
            }
            selectedObjectStartingId = null;
            if ((bool)component2)
            {
                component2.ClearObjectManipulator();
            }
            if ((bool)obj)
            {
                UnityEngine.Object.Destroy(obj);
            }
            if ((bool)component3)
            {
                UnityEngine.Object.Destroy(component3);
            }
            component.GetComponent <CollidableObject>().EnableTriggers(isTrigger: false);
            for (int i = 0; i < sceneModifiers.Length; i++)
            {
                sceneModifiers[i].AfterObjectDeselected(obj);
            }
            this.ObjectDeselected.InvokeSafe(component);
        }