Exemple #1
0
        protected override void ConstructBody(StringBuilder text)
        {
            text.Append(Location == RecordLocation.Scene ? "<b>Scene:</b> " : "<b>Prefab:</b> ");

            var nicePath = CSPathTools.NicifyAssetPath(Path, true);

            text.Append(nicePath);

            if (!string.IsNullOrEmpty(transformPath))
            {
                text.Append("\n<b>Object:</b> ").Append(transformPath);
            }
            if (!string.IsNullOrEmpty(componentName))
            {
                text.Append("\n<b>Component:</b> ").Append(componentName);
            }
            if (!string.IsNullOrEmpty(componentNamePostfix))
            {
                text.Append(componentNamePostfix);
            }
            if (!string.IsNullOrEmpty(propertyPath))
            {
                var propertyName = CSObjectTools.GetNicePropertyPath(propertyPath);
                text.Append("\n<b>Property:</b> ").Append(propertyName);
            }
        }
Exemple #2
0
 protected override void ConstructBody(StringBuilder text)
 {
     text.Append("<b>Settings: </b>" + SettingsKind);
     if (!string.IsNullOrEmpty(PropertyPath))
     {
         var propertyName = CSObjectTools.GetNicePropertyPath(PropertyPath);
         text.Append("\n<b>Property:</b> ").Append(propertyName);
     }
 }
        protected override void ConstructBody(StringBuilder text)
        {
            text.Append("<b>Scriptable Object:</b> ");
            text.Append(CSPathTools.NicifyAssetPath(Path, true));

            if (!string.IsNullOrEmpty(typeName))
            {
                text.Append("\n<b>Type:</b>").Append(typeName);
            }

            if (!string.IsNullOrEmpty(propertyPath))
            {
                var propertyName = CSObjectTools.GetNicePropertyPath(propertyPath);
                text.Append("\n<b>Property:</b> ").Append(propertyName);
            }
        }
Exemple #4
0
        /// <summary>
        /// Get structured label of the exact reference for the output.
        /// </summary>
        /// <returns>String in format '[optional prefix] [transform path] | [component name]: [property path] [optional suffix]'.</returns>
        public string GetLabel()
        {
            if (label != null)
            {
                return(label);
            }

            labelStringBuilder = new StringBuilder();

            var needsSpace = false;

            if (!string.IsNullOrEmpty(prefixLabel))
            {
                labelStringBuilder.Append(prefixLabel);
                needsSpace = true;
            }

            if (!string.IsNullOrEmpty(transformPath))
            {
                if (needsSpace)
                {
                    labelStringBuilder.Append(' ');
                }

                string labelTransformPath;

                if (location == Location.PrefabAssetGameObject)
                {
                    var transformPathSplitterIndex = transformPath.IndexOf('/');
                    if (transformPathSplitterIndex != -1)
                    {
                        labelTransformPath = transformPath.Remove(0, transformPathSplitterIndex + 1);
                    }
                    else
                    {
                        labelTransformPath = "[Prefab Root]";
                    }
                }
                else
                {
                    labelTransformPath = transformPath;
                }

                if (labelTransformPath != null)
                {
                    labelStringBuilder.Append(labelTransformPath);
                    needsSpace = true;
                }
            }

            if (!string.IsNullOrEmpty(componentName))
            {
                if (needsSpace)
                {
                    labelStringBuilder.Append(" | ");
                }
                labelStringBuilder.Append(componentName);
                needsSpace = true;
            }

            if (!string.IsNullOrEmpty(propertyPath))
            {
                if (needsSpace)
                {
                    labelStringBuilder.Append(": ");
                }
                var nicePropertyPath = CSObjectTools.GetNicePropertyPath(propertyPath);
                labelStringBuilder.Append(nicePropertyPath);
                needsSpace = true;
            }

            if (!string.IsNullOrEmpty(suffixLabel))
            {
                if (needsSpace)
                {
                    labelStringBuilder.Append(' ');
                }
                labelStringBuilder.Append(suffixLabel);
            }

            label = labelStringBuilder.ToString();

            labelStringBuilder.Length = 0;

            return(label);
        }