Skip to content

Instantly share code, notes, and snippets.

View nndwn's full-sized avatar
🍀

nandawan libya nndwn

🍀
View GitHub Profile
public class CheckConnection : MonoBehaviour
{
private void Start()
{
StartCoroutine(IsConnected(connected =>
{
if (connected)
{
Debug.Log("connented in internet")
}else
@nndwn
nndwn / VibratorWithDuration.cs
Created April 18, 2024 14:31
vibrator with duration Unity For Android
using UnityEngine;
public static class Vibre
{
#if UNITY_ANDROID
public static void Vibrator(long milliseconds )
{
if (Application.isEditor ) Handheld.Vibrate();
if (Application.platform == RuntimePlatform.Android)
{
@nndwn
nndwn / TextJitter.cs
Last active May 6, 2024 00:22
Jitter TextMeshPro
using System.Collections;
using TMPro;
using UnityEngine;
using Object = UnityEngine.Object;
using Random = UnityEngine.Random;
public class VertexJitter : MonoBehaviour
{
private const float AngleMultiplier = 0.5f;
private const float CurveScale = 0f;
@nndwn
nndwn / invertColorArea
Created July 12, 2023 07:36
Invert Color Shader Unity
Shader "Unlit/invertColorArea"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Threshold ("Threshold", Range(0., 1.)) = 0
_ThresholdDiscard ("ThresholdDiscard", Range(0., 1.)) = 0
}
SubShader
@nndwn
nndwn / WaveGenerator.cs
Created July 8, 2023 02:09 — forked from SvDvorak/WaveGenerator.cs
Unity sound wave using line renderers
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
/// Creates a wave form based on an audiosource
/// Modified version of http://forum.unity3d.com/threads/making-sense-of-spectrum-data.90262
/// Make sure to plug in the _topLine and _bottomLine line renderers
public class WaveGenerator : MonoBehaviour
{