This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class DontDestroy : MonoBehaviour { | |
// Use this for initialization | |
void Awake () { | |
DontDestroyOnLoad(gameObject); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using UnityEngine.Advertisements; | |
public class SimpleAds : MonoBehaviour | |
{ | |
//Change to your gameID code in | |
//unityads.unity3d.com | |
string gameID = "33675"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using UnityEngine.Advertisements; | |
public class AdManager : MonoBehaviour | |
{ | |
//Important: Change the gameID to your game's | |
//id in the unityads.unity3d.com dashboard | |
[SerializeField] string gameID = "33675"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class LoadAdditive : MonoBehaviour { | |
public void LoadAddOnClick(int level) | |
{ | |
Application.LoadLevelAdditive(level); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//From: http://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/creating-a-scene-menu | |
using UnityEngine; | |
using System.Collections; | |
using UnityEngine.UI; | |
public class ClickToLoadAsync : MonoBehaviour { | |
//The slider that is going to be affected | |
public Slider loadingBar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class LoadScene : MonoBehaviour { | |
public GameObject loadingImage; | |
public void LoadScene(int level) | |
{ | |
loadingImage.SetActive(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class PinchZoom : MonoBehaviour | |
{ | |
public float perspectiveZoomSpeed = 0.5f; // The rate of change of the field of view in perspective mode. | |
public float orthoZoomSpeed = 0.5f; // The rate of change of the orthographic size in orthographic mode. | |
void Update() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void notifyStatusBar(String title, String text){ | |
NotificationManager notificationManager = (NotificationManager) | |
getSystemService(NOTIFICATION_SERVICE); | |
Intent intent = new Intent(this, MainActivity.class); | |
PendingIntent pIntent = PendingIntent.getActivity(this, (int) System.currentTimeMillis(), intent, 0); | |
Notification n = new NotificationCompat.Builder(this) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.config(['$httpProvider', function ($httpProvider) { | |
// Intercept POST requests, convert to standard form encoding | |
$httpProvider.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded"; | |
$httpProvider.defaults.transformRequest.unshift(function (data, headersGetter) { | |
var key, result = []; | |
if (typeof data === "string") | |
return data; | |
for (key in data) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.factory('socket', function ($rootScope) { | |
var socket = io.connect(); | |
return { | |
on: function (eventName, callback) { | |
socket.on(eventName, function () { | |
var args = arguments; | |
$rootScope.$apply(function () { | |
callback.apply(socket, args); | |
}); | |
}); |
OlderNewer