-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System.IO; | ||
using UnityEditor.Android; | ||
using UnityEngine; | ||
|
||
public class EditorBuildTool : IPostGenerateGradleAndroidProject | ||
{ | ||
public void OnPostGenerateGradleAndroidProject(string path) | ||
{ | ||
Debug.Log("Bulid path : " + path); | ||
string gradlePropertiesFile = path + "/gradle.properties"; | ||
if (File.Exists(gradlePropertiesFile)) | ||
{ | ||
File.Delete(gradlePropertiesFile); | ||
} | ||
StreamWriter writer = File.CreateText(gradlePropertiesFile); | ||
writer.WriteLine("org.gradle.jvmargs=-Xmx4096M"); | ||
writer.WriteLine("android.useAndroidX=true"); | ||
writer.WriteLine("android.enableJetifier=true"); | ||
writer.Flush(); | ||
writer.Close(); | ||
} | ||
|
||
public int callbackOrder { get; private set; } | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
public class Ads : MonoBehaviour { | ||
|
||
public Text adstate; | ||
#if GAME_OF_WHALES | ||
// Use this for initialization | ||
void Start () { | ||
GameOfWhales.OnAdClosed += OnAdClosed; | ||
GameOfWhales.OnAdLoadFailed += OnAdLoadFailed; | ||
GameOfWhales.OnAdLoaded += OnAdLoaded; | ||
|
||
adstate.text = "hello"; | ||
} | ||
|
||
// Update is called once per frame | ||
void Update () { | ||
|
||
} | ||
|
||
public void LoadAd() | ||
{ | ||
adstate.text = "ad loading"; | ||
GameOfWhales.LoadAd(); | ||
} | ||
|
||
|
||
public void ShowAd() | ||
{ | ||
adstate.text = "ad showing"; | ||
if (GameOfWhales.IsAdLoaded()) | ||
{ | ||
GameOfWhales.ShowAd(); | ||
} | ||
else | ||
{ | ||
adstate.text = "nothing to show, loading"; | ||
GameOfWhales.LoadAd(); | ||
} | ||
} | ||
|
||
private void OnAdLoadFailed() | ||
{ | ||
adstate.text = "ad load failed"; | ||
} | ||
|
||
private void OnAdClosed() | ||
{ | ||
adstate.text = "ad closed"; | ||
} | ||
|
||
private void OnAdLoaded() | ||
{ | ||
adstate.text = "ad loaded"; | ||
} | ||
#endif | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class BroadcastView : MonoBehaviour | ||
{ | ||
|
||
|
||
private static AndroidJavaObject gameofwhales = null; | ||
|
||
void Start() | ||
{ | ||
#if UNITY_ANDROID && !UNITY_EDITOR | ||
using(var pluginClass = new AndroidJavaClass("com.gameofwhales.unityplugin.GameOfWhalesProxy")) | ||
{ | ||
gameofwhales = pluginClass.CallStatic<AndroidJavaObject>("instance"); | ||
} | ||
#endif | ||
} | ||
|
||
// Update is called once per frame | ||
void Update() | ||
{ | ||
|
||
} | ||
|
||
public void OnInitRequestClicked() | ||
{ | ||
gameofwhales.Call("test_BroadcastInitRequest"); | ||
} | ||
|
||
public void OnUserRequestClicked() | ||
{ | ||
gameofwhales.Call("test_BroadcastUserStatusRequest"); | ||
} | ||
|
||
|
||
public void OnAdShowRequestClicked() | ||
{ | ||
gameofwhales.Call("test_BroadcastShowAdRequest"); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
|
||
public class Dialog : MonoBehaviour { | ||
|
||
|
||
public Text title; | ||
public Text message; | ||
public Text camp; | ||
|
||
string campID = ""; | ||
// Use this for initialization | ||
void Start () { | ||
|
||
} | ||
|
||
// Update is called once per frame | ||
void Update () { | ||
|
||
} | ||
|
||
public void Show(string title, string message, string camp) | ||
{ | ||
gameObject.SetActive(true); | ||
this.title.text = "Title: " + title; | ||
this.message.text = "Message: " + message; | ||
this.camp.text = "Campaign ID: " + camp; | ||
campID = camp; | ||
} | ||
|
||
public void Hide() | ||
{ | ||
gameObject.SetActive(false); | ||
} | ||
|
||
#if GAME_OF_WHALES | ||
public void OnClickOK() | ||
{ | ||
GameOfWhales.PushReacted(campID); | ||
campID = ""; | ||
Hide(); | ||
} | ||
#endif | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
using System; | ||
using System.Net.Mime; | ||
|
||
public class Errors : MonoBehaviour { | ||
|
||
Text sometext; | ||
public Text futureOffers; | ||
public Text properties; | ||
|
||
public static string foOffersList; | ||
// Use this for initialization | ||
void Awake () { | ||
GowPageView.OnPageChangedEvent += OnPageChanged; | ||
|
||
} | ||
|
||
// Update is called once per frame | ||
void Update () | ||
{ | ||
futureOffers.text = foOffersList; | ||
} | ||
|
||
public void ErrorMessage() | ||
{ | ||
Debug.LogError("This is test error message"); | ||
} | ||
|
||
public void NullPointerError() | ||
{ | ||
sometext.text = "Error"; | ||
} | ||
|
||
public void ZeroDevide() | ||
{ | ||
int x = 0; | ||
int y = 5; | ||
x = y / x; | ||
} | ||
|
||
void OnPageChanged() | ||
{ | ||
var props = GameOfWhales.GetProperties(); | ||
properties.text = GameOfWhalesJson.MiniJSON.Serialize(props); | ||
} | ||
|
||
void OnFutureSpecialOfferAppeared(SpecialOffer offer) | ||
{ | ||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.