Skip to content

Instantly share code, notes, and snippets.

Avatar
🌍
https://ninevastudios.com/

Taras Leskiv TarasOsiris

🌍
https://ninevastudios.com/
View GitHub Profile
@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 AlarmClock.cs
using UnityEngine;
public class AlarmClock : MonoBehaviour
{
const string ACTION_SET_ALARM = "android.intent.action.SET_ALARM";
const string EXTRA_HOUR = "android.intent.extra.alarm.HOUR";
const string EXTRA_MINUTES = "android.intent.extra.alarm.MINUTES";
const string EXTRA_MESSAGE = "android.intent.extra.alarm.MESSAGE";
public void OnClick()
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));
@TarasOsiris
TarasOsiris / EncryptedXmlSerializer.cs
Last active Feb 7, 2021
Save encrypted XML Files in Unity3D. Tested on Android, iOS, Windows standalone, Mac.
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
{
View AndroidNativePicker.cs
#if UNITY_ANDROID
using UnityEngine;
using System;
public static class AndroidNativePicker
{
public delegate void OnDatePicked(int year,int month,int day);
public delegate void OnTimePicked(int hourOfDay, int minute);
public static void ShowDatePicker(OnDatePicked callback)
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 / DumpEditorTextures.cs
Last active Jan 3, 2021
Dump all Unity3d Editor GUI skin textures as images
View DumpEditorTextures.cs
using UnityEngine;
using System.IO;
using UnityEditor;
public static class DumpEditorTextures
{
const string AssetsFolder = "Assets";
const string TexturesDestFolderNamePro = "TexturesPro";
const string TexturesDestFolderNameNormal = "TexturesNormal";
static readonly string TexturesDestPathPro = Path.Combine(AssetsFolder, TexturesDestFolderNamePro);
@TarasOsiris
TarasOsiris / MyPluginIsBananas.cs
Last active Nov 26, 2020
Create Toast on Android Unity
View MyPluginIsBananas.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MyPluginIsBananas : MonoBehaviour
{
const string ToastClassName = "android.widget.Toast";
public void OnMyButtonClick()
{
View replace_imports.groovy
allprojects {
def mappings = [
'android.support.annotation': 'androidx.annotation',
'android.arch.lifecycle': 'androidx.lifecycle',
'android.support.v4.app.NotificationCompat': 'androidx.core.app.NotificationCompat',
'android.support.v4.app.ActivityCompat': 'androidx.core.app.ActivityCompat',
'android.support.v4.content.ContextCompat': 'androidx.core.content.ContextCompat',
'android.support.v13.app.FragmentCompat': 'androidx.legacy.app.FragmentCompat',
'android.arch.lifecycle.Lifecycle': 'androidx.lifecycle.Lifecycle',
'android.arch.lifecycle.LifecycleObserver': 'androidx.lifecycle.LifecycleObserver',
@TarasOsiris
TarasOsiris / Release checklist
Created Aug 13, 2020
Unity Asset Store Release checklist
View Release checklist
In Unity Project:
* Check if there are no compile errors or warnings on other platforms (Desktop e.g.)
* Make sure you rebuild the latest library into Unity project (.aar on Android)
* Test all implemented features on all Android versions (oldest and newest), different devices and emulators, on iOS test on all devices
* Test if old features didn't break
* Check if no side plugins are in the project that could be submitted (e.g. Plugins/Editor/Rider)
* Check if no hardcoded API keys are remaining (Google Maps, Place Picker)
* Update documentation
* Check if README.txt release notes in project are up-to-date