コード例 #1
0
    public static void GenerateInventory()
    {
        var inventory = ScriptableObject.CreateInstance <OneSignalFileInventory>();

        inventory.DistributedPaths = OneSignalFileInventory.GetCurrentPaths();

        Directory.CreateDirectory(OneSignalFileInventory.EditorResourcesPath);
        AssetDatabase.CreateAsset(inventory, OneSignalFileInventory.AssetPath);
    }
コード例 #2
0
    private IEnumerable <string> _getDiff()
    {
        if (_inventory == null)
        {
            _inventory = AssetDatabase.LoadAssetAtPath <OneSignalFileInventory>(OneSignalFileInventory.AssetPath);
        }

        if (_inventory == null)
        {
            return(null); // error
        }
        var currentPaths = OneSignalFileInventory.GetCurrentPaths();

        return(currentPaths.Except(_inventory.DistributedPaths));
    }
    private static void _checkForLegacy()
    {
#if !ONE_SIGNAL_INSTALLED
        EditorApplication.delayCall += _showOpenSetupDialog;
#else
        var inventory = AssetDatabase.LoadAssetAtPath <OneSignalFileInventory>(OneSignalFileInventory.AssetPath);

        if (inventory == null)
        {
            return; // error
        }
        var currentPaths = OneSignalFileInventory.GetCurrentPaths();
        var diff         = currentPaths.Except(inventory.DistributedPaths);

        if (diff.Any())
        {
            EditorApplication.delayCall += _showOpenSetupDialog;
        }
#endif
    }