docs.unity3d.com
    Show / Hide Table of Contents

    Class AnalyzeRule

    Base class for creating rules to analyze Addressables data. Use AnalyzeWindow.RegisterNewRule<T>() to register. a rule with the GUI window.

    Inheritance
    Object
    AnalyzeRule
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEditor.AddressableAssets.Build.AnalyzeRules
    Syntax
    [Serializable]
    public class AnalyzeRule

    Fields

    kDelimiter

    Delimiter character used in analyze rule string names. This is used when a rule result needs to display as a tree view hierarchy. A rule result of A:B:C will end up in the tree view with:

    • A --- B ----- C
    Declaration
    public const char kDelimiter = ':'
    Field Value
    Type Description
    Char

    noErrors

    Represents a state where no errors were found after analyzing Addressables data.

    Declaration
    [NonSerialized]
    protected AnalyzeRule.AnalyzeResult noErrors
    Field Value
    Type Description
    AnalyzeRule.AnalyzeResult

    Properties

    CanFix

    True if this rule can fix itself. If child class sets this to true, class must override FixIssues

    Declaration
    public virtual bool CanFix { get; set; }
    Property Value
    Type Description
    Boolean

    ruleName

    Display name for rule

    Declaration
    public virtual string ruleName { get; }
    Property Value
    Type Description
    String

    Methods

    ClearAnalysis()

    Clears out the analysis results. When overriding, use to clear rule-specific data as well.

    Declaration
    public virtual void ClearAnalysis()

    FixIssues(AddressableAssetSettings)

    Fixing method to be run on results of the RefreshAnalysis. If CanFix returns true, this method must be overriden. It is recommended that RefreshAnalysis caches any data that will be needed to fix. Fix should not rerun RefreshAnalysis before fixing.

    Declaration
    public virtual void FixIssues(AddressableAssetSettings settings)
    Parameters
    Type Name Description
    AddressableAssetSettings settings

    The settings object to analyze

    RefreshAnalysis(AddressableAssetSettings)

    This method runs the actual analysis for the rule.

    Declaration
    public virtual List<AnalyzeRule.AnalyzeResult> RefreshAnalysis(AddressableAssetSettings settings)
    Parameters
    Type Name Description
    AddressableAssetSettings settings

    The settings object to analyze

    Returns
    Type Description
    List<AnalyzeRule.AnalyzeResult>

    A list of resulting information (warnings, errors, or info)

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023