Exemplo n.º 1
0
        private void OnUserTrackingDesctiptionGUI()
        {
            if (platform != BuildTarget.iOS)
            {
                return;
            }
            HelpStyles.BeginBoxScope();
            var enabled = userTrackingUsageDescriptionProp.arraySize > 0;

            EditorGUILayout.BeginHorizontal();
            if (enabled != EditorGUILayout.ToggleLeft("Set User Tracking Usage description in Info.plist", enabled))
            {
                enabled = !enabled;
                if (enabled)
                {
                    var defDescr = Utils.DefaultUserTrackingUsageDescription();
                    userTrackingUsageDescriptionProp.arraySize = defDescr.Length;
                    for (int i = 0; i < defDescr.Length; i++)
                    {
                        var pair = userTrackingUsageDescriptionProp.GetArrayElementAtIndex(i);
                        pair.Next(true);
                        pair.stringValue = defDescr[i].key;
                        pair.Next(false);
                        pair.stringValue = defDescr[i].value;
                    }
                }
                else
                {
                    userTrackingUsageDescriptionProp.ClearArray();
                }
            }
            HelpStyles.HelpButton(Utils.gitUnityRepoURL + "/wiki/App-Tracking-Transparency");
            EditorGUILayout.EndHorizontal();
            if (enabled)
            {
                userTrackingList.DoLayoutList();
            }
            HelpStyles.EndBoxScope();
        }