Skip to content

Instantly share code, notes, and snippets.

public static void onCreate( Bundle savedInstanceState )
public static void onActivityResult( int request, int response, Intent data )
public static void onNewIntent( Intent intent )
public static void onStart()
public static void onStop()
@seaders
seaders / git_whitespace.py
Last active August 29, 2015 14:23
If you've a big dirty git workspace, with loads of documents with whitespace (which you know you can safely commit), you can use python's sh library (https://github.com/amoffat/sh) and the script below to safely stage all files with only whitespace changes
#!/usr/bin/python
import sh
git = sh.git.bake('--no-pager', # @UndefinedVariable
_cwd='/Developer/repos/git/example')
for fname in git.diff('--name-only', '--full-index', 'HEAD').splitlines():
if '' == git.diff('-w', fname):
print 'adding', fname
git.add(fname)
diff -r 983242b3e120 -r be189741ef87 PlatformDependent/iPhonePlayer/iPhone-Trampoline/Classes/Unity/WWWConnection.h
--- a/PlatformDependent/iPhonePlayer/iPhone-Trampoline/Classes/Unity/WWWConnection.h Thu May 14 11:57:01 2015 +0100
+++ b/PlatformDependent/iPhonePlayer/iPhone-Trampoline/Classes/Unity/WWWConnection.h Wed May 27 12:14:52 2015 +0300
@@ -22,6 +22,7 @@
@property (readonly, nonatomic) void* udata;
@property (nonatomic) BOOL shouldAbort;
+@property (atomic) BOOL done;
@end
@seaders
seaders / tokenPatch.patch
Last active August 29, 2015 14:26
Patch file to update 0.9.21 of `play-games-plugin-for-unity` to enable getting of a user's access token.
diff --git a/Assets/GooglePlayGames/BasicApi/DummyClient.cs b/Assets/GooglePlayGames/BasicApi/DummyClient.cs
index 337469f..cc7f754 100644
--- a/Assets/GooglePlayGames/BasicApi/DummyClient.cs
+++ b/Assets/GooglePlayGames/BasicApi/DummyClient.cs
@@ -43,6 +43,18 @@ public class DummyClient : IPlayGamesClient
LogUsage();
}
+ public string GetAccessToken()
+ {
package com.sixminute.freeracing;
import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import org.apache.http.HttpResponse;
void LocalNotification(NSString* body, int seconds, NSString* action)
{
UILocalNotification *localNotification = [ [UILocalNotification alloc] init ];
if(localNotification == nil)
{
return;
}
// Set the fire date/time
[ localNotification setFireDate: [ [NSDate date] dateByAddingTimeInterval: seconds ] ];
private IEnumerator _doFlash(bool first)
{
_mesh.colors32 = _darkColours[_colourIndex];
MainScript.log( "flashing to", this, MainScript.joinL(_mesh.colors32) );
yield return new WaitForSeconds(0.3f);
_mesh.colors32 = _colours[_colourIndex];
MainScript.log("flashing back to", this, MainScript.joinL(_mesh.colors32) );
yield return new WaitForSeconds(0.3f);
}
diff --git a/Assets/bolt/scripts/udpkit/Native/NativePInvoke.cs b/Assets/bolt/scripts/udpkit/Native/NativePInvoke.cs
index e3af984..ccf16c0 100644
--- a/Assets/bolt/scripts/udpkit/Native/NativePInvoke.cs
+++ b/Assets/bolt/scripts/udpkit/Native/NativePInvoke.cs
@@ -38,11 +38,11 @@ public static class NativePInvoke {
[DllImport(DLL_NAME)]
[SuppressUnmanagedCodeSecurity]
- public static extern Int32 SendTo(IntPtr socket, [Out] byte[] buffer, int size, UdpEndPoint.Native addr);
+ public static extern Int32 SendTo(IntPtr socket, byte[] buffer, int size, UdpEndPoint.Native addr);
using UnityEngine;
using System.Collections;
public class InputScript : MonoBehaviour
{
float _lastLR;
void Start ()
{
UnityEngine.Apple.TV.Remote.reportAbsoluteDpadValues = true;
using UnityEngine;
using System.Collections;
public class TestScript : MonoBehaviour
{
void Start()
{
StartCoroutine( waitForASec() );
}