Table of Contents

Class IssueDetector

Namespace
CodeStage.Maintainer.Issues.Detectors
Assembly
Build.dll

Base class for all Issues Detectors. Use to extend Issues Detector with your own Issues Detectors.

public abstract class IssueDetector : MaintainerExtension, IIssueDetector, IMaintainerExtension
Inheritance
object
IssueDetector
Implements
Derived

Examples

// Here is an example of how to create a custom issue detector
internal class ExternalIssueDetector : IssueDetector, IGameObjectBeginIssueDetector
{
    public override DetectorInfo Info =>
        DetectorInfo.From(
            IssueGroup.Other,
            DetectorKind.Defect,
            IssueSeverity.Warning,
            "Custom problem (⌐■_■)",
            "External issue detector example: checks 'ValidationTarget' Game Object hideFlags to be HideFlags.NotEditable.");

    public void GameObjectBegin(DetectorResults results, GameObjectLocation location)
    {
        if (location.GameObject.name != "ValidationTarget")
            return;

        if (location.GameObject.hideFlags == HideFlags.NotEditable)
            return;

        var issue = GameObjectIssueRecord.ForGameObject(this, IssueKind.Other, location);
        issue.BodyPostfix = "Incorrect hideFlags: " + location.GameObject.hideFlags + " while " + HideFlags.NotEditable + " expected!";
        results.Add(issue);
    }
}

Properties

Enabled

protected override bool Enabled { get; set; }

Property Value

bool

Info

Represents this detector information, such as name, severity and so on.

public abstract DetectorInfo Info { get; }

Property Value

DetectorInfo

See Also