Exemple #1
0
        protected override IEnumerable <IValueEntity> GetChildren(IObjectValueRole <TValue> valueRole,
                                                                  IMetadataTypeLite instanceType,
                                                                  IPresentationOptions options,
                                                                  IUserDataHolder dataHolder,
                                                                  CancellationToken token)
        {
            // GetChildren is always called with evaluation enabled (e.g. to calculate IEnumerable's "Results" node).
            // If the user has disabled "Allow property evaluation..."  we shouldn't show the "Scene Path" item.
            // Ideally, we should add it with a "Refresh" link to calculate it if required. This involves returning a
            // reference to calculate the value rather than calculating it eagerly.
            // TODO: Make "Scene Path" lazy in 212
            if (mySession.EvaluationOptions.AllowTargetInvoke)
            {
                var scenePathValue = ScenePathValueHelper.GetScenePathValue(valueRole, options, ValueServices, Logger);
                if (scenePathValue != null)
                {
                    yield return(scenePathValue);
                }
            }

            yield return(new GameObjectComponentsGroup(valueRole, ValueServices, Logger));

            yield return(new GameObjectChildrenGroup(valueRole, ValueServices, Logger));

            foreach (var valueEntity in base.GetChildren(valueRole, instanceType, options, dataHolder, token))
            {
                yield return(valueEntity);
            }
        }
Exemple #2
0
        private IValueEntity GetGameObjectScenePath(IObjectValueRole <TValue> componentRole,
                                                    IPresentationOptions options)
        {
            var gameObjectRole = Logger.CatchEvaluatorException <TValue, IObjectValueRole <TValue> >(
                () => componentRole.GetInstancePropertyReference("gameObject", true)
                ?.AsObjectSafe(options),
                exception => Logger.LogThrownUnityException(exception, componentRole.ValueReference.OriginatingFrame,
                                                            ValueServices, options));

            return(ScenePathValueHelper.GetScenePathValue(gameObjectRole, options, ValueServices, Logger));
        }
Exemple #3
0
        private IValueEntity GetGameObjectScenePath(IObjectValueRole <TValue> componentRole, IPresentationOptions options)
        {
            var gameObjectRole =
                componentRole.GetInstancePropertyReference("gameObject", true)?.AsObjectSafe(options);

            if (gameObjectRole == null)
            {
                return(null);
            }
            return(ScenePathValueHelper.GetScenePathValue(gameObjectRole, options, ValueServices, myLogger));
        }
        protected override IEnumerable <IValueEntity> GetChildren(IObjectValueRole <TValue> valueRole,
                                                                  IMetadataTypeLite instanceType,
                                                                  IPresentationOptions options,
                                                                  IUserDataHolder dataHolder, CancellationToken token)
        {
            var scenePathValue = ScenePathValueHelper.GetScenePathValue(valueRole, options, ValueServices, myLogger);

            if (scenePathValue != null)
            {
                yield return(scenePathValue);
            }

            yield return(new GameObjectComponentsGroup(valueRole, ValueServices, myLogger));

            yield return(new GameObjectChildrenGroup(valueRole, ValueServices, myLogger));

            foreach (var valueEntity in base.GetChildren(valueRole, instanceType, options, dataHolder, token))
            {
                yield return(valueEntity);
            }
        }