static void Init() { Debug.Log("Android Performance Tuner Initializer"); setupConfig = FileUtil.LoadSetupConfig(); devDescriptor = CreateDescriptor(); // When a new package is imported in Unity 2018, EditorBuildSettings.scenes are not updated yet when // Initializer() is called, thus the .proto file does not reflect possible changes in the scenes. // This callback creates the .proto file when the package has finished importing and the // EditorBuildSettings are up to date. #if UNITY_2018 AssetDatabase.importPackageCompleted += (packageName) => { CreateProtoFile(devDescriptor); }; #endif enumInfoHelper = new EnumInfoHelper(devDescriptor.fileDescriptor); protoFile = CreateProtoFile(devDescriptor); CreateAsmdefFile(); projectData = new ProjectData(); projectData.LoadFromStreamingAssets(devDescriptor); EditorBuildSettings.sceneListChanged += () => { Debug.Log("Android Performance Tuner SceneListChanged"); UpdateSceneEnum(); }; if (!FidelityBuilder.builder.valid) { initMessage = "Fidelity message is not generated yet or your project is still compiling. " + "If this message persists, try to re-import the plugin and generated assets." + "\n[macOS] Check if protoc compiler can be opened. " + "In the Finder locate protoc binary in AndroidPerformanceTuner/Editor/Protoc, " + "control-click the binary, choose Open and then click Open. "; Debug.Log(initMessage); valid = false; return; } UpdateFidelityMessages(); CheckForLoadingStateInAnnotation(); // TODO(kseniia): Check for possible inconsistencies in the data, set to false if any found // TODO(kseniia): or remove "valid" if all problems could be fixed in-place valid = true; }
static Initializer() { Debug.Log("Android Performance Tuner Initializer"); setupConfig = FileUtil.LoadSetupConfig(); devDescriptor = CreateDescriptor(); protoFile = CreateProtoFile(devDescriptor); CreateAsmdefFile(); projectData = new ProjectData(); projectData.LoadFromStreamingAssets(devDescriptor); enumInfoHelper = new EnumInfoHelper(devDescriptor.fileDescriptor); EditorBuildSettings.sceneListChanged += () => { Debug.Log("Android Performance Tuner SceneListChanged"); UpdateSceneEnum(); }; if (!FidelityBuilder.builder.valid) { initMessage = "Fidelity message is not generated yet or your project is still compiling. " + "If this message persists, try to re-import the plugin and generated assets." + "\n[macOS] Check if protoc compiler can be opened. " + "In the Finder locate protoc binary in AndroidPerformanceTuner/Editor/Protoc, " + "control-click the binary, choose Open and then click Open. "; Debug.Log(initMessage); valid = false; return; } UpdateFidelityMessages(); // TODO(kseniia): Check for possible inconsistencies in the data, set to false if any found // TODO(kseniia): or remove "valid" if all problems could be fixed in-place valid = true; }