Skip to content

Commit

Permalink
switched to untitled for pop ups
Browse files Browse the repository at this point in the history
  • Loading branch information
bradgearon committed Dec 18, 2016
1 parent 874ad86 commit 3680470
Show file tree
Hide file tree
Showing 19 changed files with 87 additions and 82 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ UnityEditor.xml
UnityEngine.UI.xml
UnityEngine.xml
/*.apk
/Assets/Editor/PreloadSigningAlias.cs
/Assets/Editor/PreloadSigningAlias.cs.meta
Binary file modified Assets/Packages/I2/Resources/I2Languages.prefab
Binary file not shown.
5 changes: 3 additions & 2 deletions Assets/Plugins/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" android:installLocation="preferExternal" android:versionCode="1" android:versionName="1.0">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<application android:theme="@style/UnityThemeSelector" android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="true">
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name">
<application android:name="org.qtproject.qt5.android.bindings.QtApplication" android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="true">
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:theme="@style/UnityThemeSelector"
android:launchMode="singleInstance">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
9 changes: 9 additions & 0 deletions Assets/Plugins/Android/I2Localization/res/values-ms.meta

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,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="t">t</string>
</resources>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed Assets/Plugins/Android/UnityAds.aar
Binary file not shown.
18 changes: 0 additions & 18 deletions Assets/Plugins/Android/UnityAds.aar.meta

This file was deleted.

Binary file modified Assets/Prefabs/title/UI.prefab
Binary file not shown.
Binary file modified Assets/Resources/GameManager.prefab
Binary file not shown.
Binary file modified Assets/Scenes/title.unity
Binary file not shown.
53 changes: 0 additions & 53 deletions Assets/Scripts/AdLauncher.cs

This file was deleted.

18 changes: 12 additions & 6 deletions Assets/Scripts/GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using DG.Tweening;
using DG.Tweening.Core;
using Facebook.Unity;
using I2.Loc;

public class GameManager : MonoBehaviour
{
Expand Down Expand Up @@ -37,8 +38,13 @@ public class GameManager : MonoBehaviour
public Level[] Levels = new Level[12];
public int LevelIndex = 0;



void Awake()
{

Debug.Log("on awake:" + Application.systemLanguage);
Debug.Log("current I2 Language: " + LocalizationManager.CurrentLanguage);
Instance = this;
_screenFader = GetComponent<ScreenFader>();

Expand All @@ -53,6 +59,11 @@ void Awake()
}
}


#if !UNITY_EDITOR
UntitledLauncher.Init();
#endif

if (FB.IsInitialized)
{
FB.ActivateApp();
Expand All @@ -61,6 +72,7 @@ void Awake()
{
FB.Init(FB.ActivateApp);
}

}

void Start()
Expand Down Expand Up @@ -193,10 +205,4 @@ public void OnTrackAppNext()
var tracking = GetComponent<AppNextTracking>();
tracking.Track();
}

public void ShowAd()
{
var ads = GetComponent<AdLauncher>();
ads.ShowAdPlacement();
}
}
2 changes: 1 addition & 1 deletion Assets/Scripts/GameOverManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ IEnumerator ShowResults(Transform starTransform, Level level)

if (Random.Range(0f, 1f) < .77f)
{
GameManager.Instance.ShowAd();
UntitledLauncher.Show();
}

nextButton.gameObject.SetActive(didWin);
Expand Down
46 changes: 46 additions & 0 deletions Assets/Scripts/UntitledLauncher.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
using UnityEngine.Advertisements;

public class UntitledLauncher {

private AndroidJavaClass activityClass;
private AndroidJavaObject activity;
private AndroidJavaClass untitledNative;
private static UntitledLauncher instance;

public static void Init()
{
if (instance != null)
{
return;
}

instance = new UntitledLauncher();
Debug.Log("untitled launcher is not inited");
instance.StartPackage();
}

public static void Show()
{
UntitledLauncher.instance.BringToFront();
}


private void BringToFront()
{
untitledNative.CallStatic("bringToFront", activity);
}

private void StartPackage()
{
Debug.Log("calling start package");
activityClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
activity = activityClass.GetStatic<AndroidJavaObject>("currentActivity");

untitledNative = new AndroidJavaClass("com.wds.untitled.UntitledNative");
untitledNative.CallStatic("init", activity);
}

}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Library/CurrentLayout.dwlt
Binary file not shown.
Binary file modified Library/ProjectSettings.asset
Binary file not shown.
Binary file modified ProjectSettings/ProjectSettings.asset
Binary file not shown.

0 comments on commit 3680470

Please sign in to comment.