Пример #1
0
        public override bool Rollback()
        {
            if (!base.Rollback())
            {
                return(false);
            }

            if (m_snappedObj.Obj == null)
            {
                Debug.LogError("LE_CmdSnapObjectToObject: Rollback: could not rollback, m_snappedObj is null!");
                return(false);
            }

            if (m_gui3d == null)
            {
                Debug.LogError("LE_CmdSnapObjectToObject: Rollback: could not rollback, m_gui3d is null!");
                return(false);
            }

            LE_LogicObjects.DeleteObject(m_gui3d, m_snappedObj.Obj);
            return(true);
        }
Пример #2
0
        public override bool Rollback()
        {
            if (!base.Rollback())
            {
                return(false);
            }

            if (m_objectInstance.Obj == null)
            {
                Debug.LogError("LE_CmdPlaceObject: Rollback: could not rollback, m_objectInstance is null!");
                return(false);
            }

            if (m_gui3d == null)
            {
                Debug.LogError("LE_CmdPlaceObject: Rollback: could not rollback, m_gui3d is null!");
                return(false);
            }

            LE_LogicObjects.DeleteObject(m_gui3d, m_objectInstance.Obj);
            return(true);
        }
Пример #3
0
        public override bool Execute()
        {
            if (!base.Execute())
            {
                return(false);
            }

            if (m_objectInstance.Obj == null)
            {
                Debug.LogError("LE_CmdDeleteObject: Execute: could not execute, m_objectInstance is null!");
                return(false);
            }

            if (m_gui3d == null)
            {
                Debug.LogError("LE_CmdDeleteObject: Execute: could not execute, m_gui3d is null!");
                return(false);
            }

            // save objects state for rollback
            m_position = m_objectInstance.Obj.transform.position;
            m_rotation = m_objectInstance.Obj.transform.rotation;
            m_scale    = m_objectInstance.Obj.transform.localScale;
            m_isRigidbodySleepingStart = m_objectInstance.Obj.IsRigidbodySleepingStart;
            m_color          = m_objectInstance.Obj.ColorProperty;
            m_variationIndex = m_objectInstance.Obj.VariationsDefaultIndex;
            m_snapPointLinks.Clear();
            List <KeyValuePair <string, int> > snapPointLinks = m_gui3d.GetSnapPointsToReactivate(m_UID, m_objectInstance.Obj.ObjectSnapPoints.Length);

            foreach (KeyValuePair <string, int> link in snapPointLinks)
            {
                m_snapPointLinks.Add(link.Key, link.Value);
            }
            // delete object
            LE_LogicObjects.DeleteObject(m_gui3d, m_objectInstance.Obj);
            return(true);
        }