Skip to content

Is there a way to check if any changes were made? #146

Answered by vanifatovvlad
Zoodinger asked this question in Q&A
Discussion options

You must be logged in to vote

One of the ways is to create a validator that will add a synchronization button

source code
using System.Linq;
using System.Reflection;
using TriInspector;
using UnityEngine;

[assembly: RegisterTriValueValidator(typeof(OutOfSyncValidator))]

public class OutOfSyncValidator : TriValueValidator<MonoBehaviour>
{
    public override TriExtensionInitializationResult Initialize(TriPropertyDefinition propertyDefinition)
    {
        var isRoot = propertyDefinition.OwnerType == null;
        return isRoot ? TriExtensionInitializationResult.Ok : TriExtensionInitializationResult.Skip;
    }

    public override TriValidationResult Validate(TriValue<MonoBehaviour> propertyValue)
    {
        var 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Zoodinger
Comment options

Answer selected by vanifatovvlad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants