Skip to content

Instantly share code, notes, and snippets.

Avatar
🌍
https://ninevastudios.com/

Taras Leskiv TarasOsiris

🌍
https://ninevastudios.com/
View GitHub Profile
@TarasOsiris
TarasOsiris / CheckForUpdates.cs
Last active May 25, 2016
Check for upates on GitHub form Unity Editor
View CheckForUpdates.cs
private const string LatestReleaseApiURL = "https://api.github.com/repos/getsocial-im/getsocial-unity-sdk/releases/latest";
private const string LatestReleaseURL = "https://github.com/getsocial-im/getsocial-unity-sdk/releases/latest";
[MenuItem(GetSocialMenuParent + "GetSocial/Check for Updates...", false, priority: 2000)]
public static void CheckForUpdates()
{
CheckForUpdatesOnReleaseRepo();
}
private static void CheckForUpdatesOnReleaseRepo()
View ShowToastUnityAndroid.cs
public static void ShowToast(string text)
{
if (Application.platform == RuntimePlatform.Android)
{
AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
activity.Call("runOnUiThread", new AndroidJavaRunnable(
()=>
{
@TarasOsiris
TarasOsiris / Driver.cs
Last active Apr 15, 2016
Class for frame-by-frame Animation in Editor. Taken from Fabric Unity SDK
View Driver.cs
namespace Fabric.Internal.Editor.View.Animation
{
using UnityEngine;
using UnityEditor;
using System.Collections;
using System;
public class Driver
{
private uint invocationCount = 0;
@TarasOsiris
TarasOsiris / BetterDefines.cs
Last active May 4, 2016 — forked from PhannGor/BetterDefines.cs
Better Defines for Unity3D
View BetterDefines.cs
using System;
using System.Collections.Generic;
using System.Linq;
using BetterDefines.Editor.Entity;
using UnityEditor;
namespace BetterDefines.Editor
{
public static class BetterDefinesUtils
{
@TarasOsiris
TarasOsiris / GetSocialDeepLinkingActivity.java
Created Mar 4, 2016 — forked from getsocial-im/GetSocialDeepLinkingActivity.java
Code for Android Unity App and the Intent Trouble Article on GetSocial Blog
View GetSocialDeepLinkingActivity.java
package im.getsocial.sdk.core.unity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import im.getsocial.sdk.core.GetSocial;
import im.getsocial.sdk.core.util.Log;
@TarasOsiris
TarasOsiris / GetSocialDeepLinkingActivity.java
Last active Apr 26, 2016
This activity is created because we cannot get Activity.onNewIntent callback in Unity when the app is running in background.
View GetSocialDeepLinkingActivity.java
package im.getsocial.sdk.core.unity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import im.getsocial.sdk.core.GetSocial;
import im.getsocial.sdk.core.util.Log;
@TarasOsiris
TarasOsiris / FlowMap.shader
Last active Jul 4, 2021
Flow Map Shader for Unity3D. Used with Sprites.
View FlowMap.shader
Shader "Custom/Flow Map"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
// Flow
_FlowMap ("Flow Map", 2D) = "white" {}
_FlowSpeed ("Flow Speed", float) = 0.05
View EncryptedXmlSerializer.cs
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using System.Xml.Serialization;
using UnityEngine;
namespace Com.Nravo.FlipTheBoard.PersistantStorage
{
@TarasOsiris
TarasOsiris / NGUI_UpdateLabel.cs
Created Nov 27, 2014
Updates NGUI Label with provided parameters. Playmaker Action
View NGUI_UpdateLabel.cs
using UnityEngine;
using HutongGames.PlayMaker;
[ActionCategory("NGUI")]
[HutongGames.PlayMaker.Tooltip("Updates NGUI Label with provided parameters")]
public class NGUI_UpdateLabel : FsmStateAction
{
[RequiredField]
[CheckForComponent(typeof(UILabel))]
[HutongGames.PlayMaker.Tooltip("Game Object to update.")]
View CameraExtensions.cs
using UnityEngine;
public static class CameraExtensions {
public static void LayerCullingShow(this Camera cam, int layerMask) {
cam.cullingMask |= layerMask;
}
public static void LayerCullingShow(this Camera cam, string layer) {
LayerCullingShow(cam, 1 << LayerMask.NameToLayer(layer));