public override void OnInspectorGUI()
    {
        serializedObject.Update();

        ImpressionData           id   = target as ImpressionData;
        List <Shared.ImpressTag> tags = id.Tags;

        EditorGUILayout.LabelField("感想");
        string_property.stringValue = EditorGUILayout.TextArea(string_property.stringValue);

        EditorGUILayout.BeginHorizontal();      // 開始
        tags_flag = EditorGUILayout.Foldout(tags_flag, "タグ設定");
        //追加ボタンを作る
        if (GUILayout.Button("タグ追加"))
        {
            list_property.InsertArrayElementAtIndex(list_property.arraySize);
        }
        EditorGUILayout.EndHorizontal();        // 終了
        if (tags_flag)
        {
            for (int i = 0; i < id.tags.Count; i++)
            {
                EditorGUILayout.BeginHorizontal();      // 開始
                list_property.GetArrayElementAtIndex(i).enumValueIndex = (int)(Shared.ImpressTag)EditorGUILayout.EnumPopup("タグ", (Shared.ImpressTag)System.Enum.GetValues(typeof(Shared.ImpressTag)).GetValue(list_property.GetArrayElementAtIndex(i).enumValueIndex));

                EditorGUILayout.EndHorizontal();        // 終了
            }
            if (GUILayout.Button("削除"))
            {
                list_property.DeleteArrayElementAtIndex(list_property.arraySize - 1);
            }
        }

        serializedObject.ApplyModifiedProperties();
    }
Exemplo n.º 2
0
 private void OnBannerDisplayedEvent(string placement, ImpressionData impressionData)
 {
     if (BannerDisplayedEvent != null)
     {
         BannerDisplayedEvent(placement, impressionData);
     }
 }
    public void SetCurrentImpression(ImpressionData data)
    {
        if (this.currentReviewCommentText == null)
        {
            Debug.Log("ごみ");
        }
        if (data == null)
        {
            Debug.Log("ddddddd");
        }

        this.currentImpression.Text = data.Text;
        this.currentImpression.Tags = data.Tags;
    }
    public override void OnInspectorGUI()
    {
        ImpressDataBase db = target as ImpressDataBase;

        serializedObject.Update();

        ImpressionData add = null;

        add = (ImpressionData)EditorGUILayout.ObjectField("追加するもの", add, typeof(ImpressionData), true);

        if (add != null)
        {
            db.AddImpression(add);
            add = null;
        }
        if (GUILayout.Button("リストの追加"))
        {
            db.AddImpression();
        }
        // 登録されているデータ一覧
        if (data_flag = EditorGUILayout.Foldout(data_flag, "データ一覧"))
        {
            // リストを表示
            for (int i = 0; i < list_datas.arraySize; ++i)
            {
                EditorGUILayout.BeginHorizontal();      // 開始


                //list_datas.GetArrayElementAtIndex(i).stringValue = GUILayout.TextArea(list_datas.GetArrayElementAtIndex(i).stringValue);

                //EditorGUILayout.LabelField(list_datas.GetArrayElementAtIndex(i).stringValue);

                EditorGUILayout.PropertyField(list_datas.GetArrayElementAtIndex(i));
                //data_list[i].Text = GUILayout.TextField(data_list[i].Text);
                if (GUILayout.Button("削除", GUILayout.Width(100), GUILayout.Height(20)))
                {
                    list_datas.DeleteArrayElementAtIndex(i);
                    continue;
                }
                EditorGUILayout.EndHorizontal();        // 終了
            }
        }
        if (GUILayout.Button("クリア"))
        {
            list_datas.ClearArray();
        }
        serializedObject.ApplyModifiedProperties();
    }
 public void AddImpression(ImpressionData _add)
 {
     impress_datas.Add(_add);
 }
Exemplo n.º 6
0
 /// <summary>
 /// This an example of Listening to FairBid Banner Callbacks and events.
 /// </summary>
 /// <param name="placementName">The Placement name.</param>
 /// <param name="impressionData">The Impression Data.</param>
 public void OnShow(string placementName, ImpressionData impressionData)
 {
     mUserInterfaceWrapper.addLog("OnShow()");
 }
Exemplo n.º 7
0
        public static ImpressionData FromJson(string json)
        {
            var impData = new ImpressionData();

            if (string.IsNullOrEmpty(json))
            {
                return(impData);
            }

            var fields = MJ.Json.Deserialize(json) as Dictionary <string, object>;

            if (fields == null)
            {
                return(impData);
            }

            object obj;
            double parsedDouble;
            int    parsedInt;

            if (fields.TryGetValue("app_version", out obj) && obj != null)
            {
                impData.AppVersion = obj.ToString();
            }

            if (fields.TryGetValue("adunit_id", out obj) && obj != null)
            {
                impData.AdUnitId = obj.ToString();
            }

            if (fields.TryGetValue("adunit_name", out obj) && obj != null)
            {
                impData.AdUnitName = obj.ToString();
            }

            if (fields.TryGetValue("adunit_format", out obj) && obj != null)
            {
                impData.AdUnitFormat = obj.ToString();
            }

            if (fields.TryGetValue("id", out obj) && obj != null)
            {
                impData.ImpressionId = obj.ToString();
            }

            if (fields.TryGetValue("currency", out obj) && obj != null)
            {
                impData.Currency = obj.ToString();
            }

            if (fields.TryGetValue("publisher_revenue", out obj) && obj != null &&
                double.TryParse(MoPubUtils.InvariantCultureToString(obj), NumberStyles.Any,
                                CultureInfo.InvariantCulture, out parsedDouble))
            {
                impData.PublisherRevenue = parsedDouble;
            }

            if (fields.TryGetValue("adgroup_id", out obj) && obj != null)
            {
                impData.AdGroupId = obj.ToString();
            }

            if (fields.TryGetValue("adgroup_name", out obj) && obj != null)
            {
                impData.AdGroupName = obj.ToString();
            }

            if (fields.TryGetValue("adgroup_type", out obj) && obj != null)
            {
                impData.AdGroupType = obj.ToString();
            }

            if (fields.TryGetValue("adgroup_priority", out obj) && obj != null &&
                int.TryParse(MoPubUtils.InvariantCultureToString(obj), NumberStyles.Any,
                             CultureInfo.InvariantCulture, out parsedInt))
            {
                impData.AdGroupPriority = parsedInt;
            }

            if (fields.TryGetValue("country", out obj) && obj != null)
            {
                impData.Country = obj.ToString();
            }

            if (fields.TryGetValue("precision", out obj) && obj != null)
            {
                impData.Precision = obj.ToString();
            }

            if (fields.TryGetValue("network_name", out obj) && obj != null)
            {
                impData.NetworkName = obj.ToString();
            }

            if (fields.TryGetValue("network_placement_id", out obj) && obj != null)
            {
                impData.NetworkPlacementId = obj.ToString();
            }

            impData.JsonRepresentation = json;

            return(impData);
        }
    public void HandleImpression(object sender, ImpressionData impressionData)
    {
        var data = impressionData == null ? "null" : impressionData.rawData;

        MonoBehaviour.print("HandleImpression event received with data: " + data);
    }
Exemplo n.º 9
0
 public void OnShowFailure(string placementId, ImpressionData impressionData)
 {
     // Called when an error arises when showing a rewarded ad from placement 'placementId'
     adClient.OnRewardedDisplayedEvent(placementId, false);
 }
Exemplo n.º 10
0
 public void OnShow(string placementId, ImpressionData impressionData)
 {
     // Called when a rewarded ad from placementId shows up. In case the ad is a video, audio play will start here.
     // On Android, this callback might be called only once the ad is closed.
     adClient.OnRewardedDisplayedEvent(placementId, true);
 }
Exemplo n.º 11
0
 public void OnShowFailure(string placementId, ImpressionData impressionData)
 {
     adClient.OnInterstitialDisplayedEvent(placementId, false);
 }
Exemplo n.º 12
0
 public void OnShow(string placementId, ImpressionData impressionData)
 {
     adClient.OnBannerDisplayedEvent(placementId, impressionData);
 }