예제 #1
0
 void Awake()
 {
     DontDestroyOnLoad(this.gameObject);
     if (RuntimePlatform.Android == Application.platform)
     {
         GGAdConfig adConfig = new GGAdConfig();
         adConfig.setListener(new GreedyAgentListener());
         adConfig.enableAdmobMediation(AdmobMediation);
         adConfig.addUnitList(unitList);
         GreedyGameAgent.Instance.init(adConfig);
     }
     else
     {
         moveToNextScene();
     }
 }
예제 #2
0
 private void OnGUI()
 {
     if (GUI.Button(new Rect(10, 10, 200, 100), "Init"))
     {
         if (RuntimePlatform.Android == Application.platform || RuntimePlatform.IPhonePlayer == Application.platform)
         {
             GGAdConfig adConfig = new GGAdConfig();
             adConfig.setListener(new GreedyAgentListener());
             adConfig.setGameId(gameId);
             adConfig.enableAdmobMediation(AdmobMediation);
             adConfig.enableFacebookMediation(FacebookMediation);
             adConfig.enableMopubMediation(MopubMediation);
             adConfig.disableReflection(false);
             adConfig.addUnitList(unitList);
             GreedyGameAgent.Instance.init(adConfig);
             //Task.Delay(1000).ContinueWith(t => GreedyGameAgent.Instance.startEventRefresh());
         }
     }
 }
예제 #3
0
 void Awake()
 {
     DontDestroyOnLoad(this.gameObject);
     if (RuntimePlatform.Android == Application.platform || RuntimePlatform.IPhonePlayer == Application.platform)
     {
         GGAdConfig adConfig = new GGAdConfig();
         adConfig.setListener(new GreedyAgentListener());
         adConfig.setGameId(gameId);
         adConfig.enableAdmobMediation(AdmobMediation);
         adConfig.enableFacebookMediation(FacebookMediation);
         adConfig.enableMopubMediation(MopubMediation);
         adConfig.disableReflection(false);
         adConfig.addUnitList(unitList);
         GreedyGameAgent.Instance.init(adConfig);
         //Task.Delay(1000).ContinueWith(t => GreedyGameAgent.Instance.startEventRefresh());
     }
     else
     {
         moveToNextScene();
     }
 }
예제 #4
0
    void OnGUI()
    {
        if (GUI.Button(new Rect(100, 100, 150, 50), "INIT"))
        {
            Debug.Log("GG[ButtonCarScene] INIT called ");
            GGAdConfig adConfig = new GGAdConfig();
            adConfig.setListener(new GreedyAgentListener());
            GreedyGameAgent.Instance.init(adConfig);
        }

        if (GUI.Button(new Rect(300, 100, 150, 50), "SHOWFLOAT"))
        {
            Debug.Log("GG[ButtonCarScene] SHOWFLOAT called with id float-3160 ");
            GreedyGameAgent.Instance.fetchFloatUnit("float-3804");
        }

        if (GUI.Button(new Rect(500, 100, 150, 50), "REMOVEFLOAT"))
        {
            Debug.Log("GG[ButtonCarScene] REMOVEFLOAT called with id float-1877 ");
            GreedyGameAgent.Instance.removeFloatUnit("float-3804");
        }

        if (GUI.Button(new Rect(100, 170, 150, 50), "REMOVEALL"))
        {
            Debug.Log("GG[ButtonCarScene] fetching 3160 and after calling REMOVEALLFLOATS ");
            //GreedyGameAgent.Instance.fetchFloatUnit("float-3804");
            GreedyGameAgent.Instance.removeAllFloatUnits();
        }

        if (GUI.Button(new Rect(300, 170, 150, 50), "SHOWUII"))
        {
            Debug.Log("GG[ButtonCarScene] calling SHOWENGAGEMENTWINDOW with id : 3804 ");
            GreedyGameAgent.Instance.showEngagementWindow("float-3349");
        }

        if (GUI.Button(new Rect(500, 170, 150, 50), "GETNATIVETEXTURE"))
        {
            Debug.Log("GG[ButtonCarScene] calling GETNATIVETEXTURE with id : 2334 ");
            GreedyGameAgent.Instance.getNativeUnitTexture("unit-3804", delegate(string unitID, Texture2D texture)
            {
                if (unitID.Equals("unit-3952"))
                {
                    Debug.Log("GG[ButtonCarScene] callback to delegate after getNativeTexture success for unit-2334");
                    NativeIdentifier[] nativeIdentifier = FindObjectsOfType(typeof(NativeIdentifier)) as NativeIdentifier[];
                    foreach (NativeIdentifier nativeUnit in nativeIdentifier)
                    {
                        Debug.Log("GG[ButtonCarScene] update texture inside loop ");
                        nativeUnit.updateTexture(texture);
                    }
                }
            });
        }

        if (GUI.Button(new Rect(100, 240, 150, 50), "GETFLOATTEXTURE"))
        {
            Debug.Log("GG[ButtonCarScene] calling GETFLOATTEXTURE with id : 3160 ");
            GreedyGameAgent.Instance.getFloatUnitTexture("float-3804", delegate(string unitID, Texture2D texture)
            {
                if (unitID.Equals("unit-3952"))
                {
                    Debug.Log("GG[ButtonCarScene] callback to delegate after getNativeTexture success for float 3160");
                    FloatIdentifier[] floatIdentifier = FindObjectsOfType(typeof(FloatIdentifier)) as FloatIdentifier[];
                    foreach (FloatIdentifier floatUnit in floatIdentifier)
                    {
                        Debug.Log("GG[ButtonCarScene] update texture inside loop ");
                        floatUnit.updateTexture(texture);
                    }
                }
            });
        }

        if (GUI.Button(new Rect(300, 240, 150, 50), "REFRESH"))
        {
            Debug.Log("GG[ButtonCarScene] calling REFRESH ");
            GreedyGameAgent.Instance.startEventRefresh();
        }

        if (GUI.Button(new Rect(300, 320, 150, 50), "LEVEL 1"))
        {
            Debug.Log("GG[ButtonCarScene] calling REFRESH ");
            SceneManager.LoadScene(1);
        }

        if (GUI.Button(new Rect(500, 320, 150, 50), "LEVEL 2"))
        {
            Debug.Log("GG[ButtonCarScene] calling REFRESH ");
            SceneManager.LoadScene(2);
        }

        if (GUI.Button(new Rect(500, 240, 150, 50), "CRASH"))
        {
            try
            {
                Debug.Log("GG[ButtonCarScene] calling REFRESH ");
                NullReferenceException exception = new NullReferenceException("GG CUSTOM CRASH FOR TESTING");
                throw exception;
            } catch (NullReferenceException ex)
            {
                GreedyGameAgent.Instance.sendCrashReport(ex.Message + ex.StackTrace, false);
                Debug.Log("GG[CRASH] Message : " + ex.Message);
                Debug.Log("GG[CRASH] stacktrace : " + ex.StackTrace);
            }
        }
    }