// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.UI;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Utilities
{
///
/// Migration handler for migrating buttons with custom icons to the button config helper.
///
public class ButtonConfigHelperMigrationHandler : IMigrationHandler
{
///
public bool CanMigrate(GameObject gameObject)
{
ButtonConfigHelper bch = gameObject.GetComponent();
return bch != null && bch.EditorCheckForCustomIcon();
}
///
public void Migrate(GameObject gameObject)
{
ButtonConfigHelper bch = gameObject.GetComponent();
bch.EditorUpgradeCustomIcon();
}
}
}