Search Unity

Is there a hook prior to switching platforms?

Discussion in 'Scripting' started by Galf, Mar 27, 2015.

  1. Galf

    Galf

    Joined:
    Feb 24, 2013
    Posts:
    27
    I noticed there's a delegate called UnityEditor.EditorUserBuildSettings.activeBuildTargetChanged, which appears to get called directly after the platform has been fully switched -- is there any built-in hook to alert me just BEFORE the platform switch starts?

    I'm trying to cache platform assets, and while existing solutions exist, none seem to allow you to use Unity's built-in platform-switching dialog. I've also tried creating a custom AssetPostProcessor, to monitor the current build target during pre-processing, but it seems even that is too late.

    Anyone have any suggestions here, or know of a hook that fires earlier in the process?

    Thanks!