internal static void CollectRuleSceneObjects()
        {
            s_ParentRuleSet = null;

            var rules  = RuleSetInstanceExisting;
            var parent = rules ? rules.transform.parent : null;

            while (parent != null && s_ParentRuleSet == null)
            {
                s_ParentRuleSet = parent.GetComponent <ProxyRuleSet>();
                parent          = parent.parent;
            }
        }
Ejemplo n.º 2
0
        void OnGUI()
        {
            if (!MARSEntitlements.instance.EntitlementsCheckGUI(position.width))
            {
                return;
            }

            if (Event.current.commandName == "ObjectSelectorClosed" && !RulesModule.WasPicked)
            {
                RulesModule.PickedObject = EditorGUIUtility.GetObjectPickerObject();
            }

            RulesDrawer.OnGUI();

            if (GUIDispatch != null)
            {
                GUIDispatch();
                GUIDispatch = null;
            }

            m_SerializedActiveRuleSet = RulesModule.RuleSetInstanceExisting;
        }
        static void OnSelectionChanged()
        {
            var go = Selection.activeGameObject;

            if (go == null)
            {
                return;
            }

            var ruleSet = go.GetComponent <ProxyRuleSet>();

            if (ruleSet != null)
            {
                RuleSetInstance = ruleSet;
                RulesDrawer.BuildReplicatorsList();
                return;
            }

            var entity = go.GetComponent <MARSEntity>();

            if (entity == null)
            {
                return;
            }

            var moduleLoaderCore        = ModuleLoaderCore.instance;
            var simulatedObjectsManager = moduleLoaderCore.GetModule <SimulatedObjectsManager>();
            var originalSimTransform    = simulatedObjectsManager.GetOriginalTransform(go.transform);

            if (originalSimTransform == null)
            {
                return;
            }

            FrameObject(originalSimTransform);
        }