コード例 #1
0
 public void _LoadDefaults(MegacoolConfiguration config)
 {
     if (!_HasMaxFrames())
     {
         MaxFrames = config.maxFrames;
     }
     if (!_HasFrameRate())
     {
         FrameRate = config.recordingFrameRate;
     }
     if (!_HasPeakLocation())
     {
         PeakLocation = config.peakLocation;
     }
     if (!_HasLastFrameDelay())
     {
         LastFrameDelay = config.lastFrameDelay;
     }
     if (!_HasPlaybackFrameRate())
     {
         PlaybackFrameRate = config.playbackFrameRate;
     }
     if (LastFrameOverlay == null && !string.IsNullOrEmpty(config.lastFrameOverlay))
     {
         LastFrameOverlay = config.lastFrameOverlay;
     }
 }
コード例 #2
0
    public static void GenerateMegacoolConfiguration()
    {
        MegacoolConfiguration configuration = MegacoolConfiguration.Instance;

        EditorUtility.FocusProjectWindow();
        Selection.activeObject = configuration;
    }
コード例 #3
0
 public void _LoadDefaults(MegacoolConfiguration config)
 {
     if (!_HasMessage() && !string.IsNullOrEmpty(config.sharingText))
     {
         Message = config.sharingText;
     }
     if (FallbackImage == null && !string.IsNullOrEmpty(config.sharingFallback))
     {
         FallbackImage = config.sharingFallback;
     }
     if (!_HasModalTitle() && !string.IsNullOrEmpty(config.shareModalTitle))
     {
         ModalTitle = config.shareModalTitle;
     }
     if (!_HasStrategy())
     {
         Strategy = config.sharingStrategy;
     }
 }
コード例 #4
0
    private static void LoadInstance()
    {
        instance = Resources.Load(configurationAsset) as MegacoolConfiguration;
        if (instance == null)
        {
            instance = CreateInstance <MegacoolConfiguration>();

#if UNITY_EDITOR
            if (!AssetDatabase.IsValidFolder("Assets/Megacool"))
            {
                AssetDatabase.CreateFolder("Assets", "Megacool");
            }
            if (!AssetDatabase.IsValidFolder("Assets/Megacool/Resources"))
            {
                AssetDatabase.CreateFolder("Assets/Megacool", "Resources");
            }
            string configurationAssetPath = Path.Combine("Assets/Megacool/Resources", configurationAsset + ".asset");
            AssetDatabase.CreateAsset(instance, configurationAssetPath);
#endif
        }
    }
コード例 #5
0
    public static void OnPostprocessBuild(BuildTarget bt, string path)
    {
        if (bt != BuildTarget.iOS)
        {
            // This is only to modify the XCode project file and the Info.plist, not needed for other targets
            return;
        }

        // Not using MegacoolConfiguration.Instance since we don't want a new instance if
        // it's absent, better to issue warning
        MegacoolConfiguration configuration = Resources.Load <MegacoolConfiguration>("MegacoolConfiguration");

        if (configuration == null)
        {
            Debug.LogWarning("No Megacool configuration found, not adding support for universal linking or URL " +
                             "schemes");
            return;
        }

        AddMegacoolToXcodeProject(path, configuration.universalLinksIOS, configuration.schemeIOS);
    }