protected override void InitializeExtraDataInstance(Object extraData, int targetIndex) { var targetSettings = extraData as TargetSettings; var currentTarget = targets[targetIndex] as VideoClipImporter; if (targetSettings != null && currentTarget != null) { var validPlatforms = BuildPlatforms.instance.GetValidPlatforms(); targetSettings.allSettings = new List <InspectorTargetSettings>(validPlatforms.Count() + 1); var defaultSetting = new InspectorTargetSettings(); defaultSetting.target = BuildTargetGroup.Unknown; defaultSetting.settings = currentTarget.defaultTargetSettings; defaultSetting.overridePlatform = true; targetSettings.allSettings.Add(defaultSetting); foreach (var validPlatform in validPlatforms) { var setting = new InspectorTargetSettings(); setting.target = validPlatform.targetGroup; setting.settings = currentTarget.Internal_GetTargetSettings(validPlatform.targetGroup); setting.overridePlatform = setting.settings != null; if (!setting.overridePlatform) { setting.settings = currentTarget.defaultTargetSettings; } targetSettings.allSettings.Add(setting); } } }
private void ResetSettingsFromBackend() { m_TargetSettings = null; if (targets.Length > 0) { List <BuildPlatform> validPlatforms = BuildPlatforms.instance.GetValidPlatforms(); m_TargetSettings = new InspectorTargetSettings[targets.Length, validPlatforms.Count + 1]; for (int i = 0; i < targets.Length; i++) { VideoClipImporter clipImporter = (VideoClipImporter)targets[i]; m_TargetSettings[i, 0] = new InspectorTargetSettings(); m_TargetSettings[i, 0].overridePlatform = true; m_TargetSettings[i, 0].settings = clipImporter.defaultTargetSettings; for (int j = 1; j < validPlatforms.Count + 1; j++) { BuildTargetGroup platformGroup = validPlatforms[j - 1].targetGroup; m_TargetSettings[i, j] = new InspectorTargetSettings(); m_TargetSettings[i, j].settings = clipImporter.Internal_GetTargetSettings(platformGroup); // We need to use this flag, and the nullity of the settings to determine if // we have an override. This is because we could create an override later during a toggle // and we want to keep that override even if we untoggle (to not lose the changes made) m_TargetSettings[i, j].overridePlatform = m_TargetSettings[i, j].settings != null; } } } m_ModifiedTargetSettings = false; }