Skip to content

Instantly share code, notes, and snippets.

View dimmduh's full-sized avatar
🎮
Learning Unity

Dmitrii Dukhnich dimmduh

🎮
Learning Unity
View GitHub Profile
@yasuyuki-kamata
yasuyuki-kamata / AdMobMediationTest.cs
Created April 13, 2016 05:39
[Sample] UnityAds with AdMobMediation for Unity C#
using UnityEngine;
using System.Collections;
using GoogleMobileAds.Api;
using UnityEngine.Events;
public class AdMobMediationTest : MonoBehaviour
{
[SerializeField]
string adUnitId_Android = "ca-app-pub-3504169427024836/4346441108";
[SerializeField]
Shader "Name" {
Properties {
name ("display name", Range (min, max)) = number
name ("display name", Float) = number
name ("display name", Int) = number
name ("display name", Color) = (number,number,number,number)
name ("display name", Vector) = (number,number,number,number)
@phucnh
phucnh / android_pkg_name_validate.js
Created October 30, 2015 08:21 — forked from rishabhmhjn/android_pkg_name_validate.js
Regex to validate Android Package Name
var pattern = /^[a-z][a-z0-9_]*(\.[a-z0-9_]+)+[0-9a-z_]$/i;
[
"me.unfollowers.droid",
"me_.unfollowers.droid",
"me._unfollowers.droid",
"me.unfo11llowers.droid",
"me11.unfollowers.droid",
"m11e.unfollowers.droid",
"1me.unfollowers.droid",
@Krumelur
Krumelur / GameHelper.cs
Created October 23, 2015 13:51
GameHelper for Android Google Play Game Services with new ApiClient
using System;
using Android.Gms.Common;
using Android.Gms.Common.Apis;
using Android.Gms.Games.Achievement;
using Android.Gms.Games.LeaderBoard;
using Android.Gms.Games;
using Android.App;
using Android.Content;
using Android.Views;
using Java.Interop;
@Sebring
Sebring / HtmlTextView.java
Created September 4, 2015 09:12
HtmlTextView - Android TextView to in databinding where content is HTML
import android.content.Context;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.util.AttributeSet;
import android.widget.TextView;
public class HtmlTextView extends TextView {
public HtmlTextView(Context context) {
super(context);
@kibotu
kibotu / build.gradle
Created June 26, 2015 16:40
android install obb
task installObb() << {
description = "Install all OBB packages"
def stdout = new ByteArrayOutputStream()
def obbFile = "main." + getVersionCode() + "." + getApplicationId() + ".obb"
def source = "../" + obbFile + ".zip"
def destination = "/sdcard/Android/obb/" + getApplicationId() + "/" + obbFile
println("adb push " + source + " " + destination)
@nicloay
nicloay / AtlasTexturePreprocessor.cs
Last active April 27, 2019 05:10
Unity3d Automatically fix texture size on import (very useful if you have big textures which has bigger size than default 1024 or 2048 value)
// reflexion method posted by numberkruncher
// here http://forum.unity3d.com/threads/getting-original-size-of-texture-asset-in-pixels.165295/
public class AtlasTexturePostprocessor : AssetPostprocessor {
public const int PixelsPerUnit = 100;
void OnPreprocessTexture(){
Texture2D tex = AssetDatabase.LoadAssetAtPath(assetPath, typeof(Texture2D )) as Texture2D;
TextureImporter importer = assetImporter as TextureImporter;
int textureHeight;
@phynet
phynet / Generate and Install IPA's file in device through Command Line.md
Last active December 22, 2022 16:15
Generate and Install IPA's file in device through Command Line

##Generate and Install IPA's file in device through Command Line

###Thanks to Mattt and phonegap's scripts

Take a note: all this steps can be automatized in a single script, if you know how to write it. (Bash or Ruby will be fine)

1.- Install your Provisioning Profile and Developer Certificate

2.- Install Shenzhen and ios-deploy: the firstone will generate the IPA file and the secondone will install it onto your device

@vgaidarji
vgaidarji / Android XML decompressor
Created March 11, 2014 14:42
Decompile application and parse AndroidManifest.xml to string
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
class AndroidXMLDecompress {
// decompressXML -- Parse the 'compressed' binary form of Android XML docs
// such as for AndroidManifest.xml in .apk files
@meng-hui
meng-hui / PerformBuild.cs
Last active June 13, 2024 15:16
Automated Unity Build from git repository to apk, xcode projects for use in conjunction with Jenkins. Contains Unity Editor script to collect the scenes, set the build settings, set the build location and an ant script to build the Unity project on the command line.
using UnityEditor;
using System.IO;
using System.Collections;
using UnityEngine;
using System.Collections.Generic;
class PerformBuild
{
private static string BUILD_LOCATION = "+buildlocation";