Skip to content

Instantly share code, notes, and snippets.

Nipun David nipundavid

Block or report user

Report or block nipundavid

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nipundavid
nipundavid / marvel.json
Created May 19, 2018
Sample json file to test basic CURD operations
View marvel.json
{
"marvel": [
{
"id": 1,
"superhero_name": "Deadpool",
"real_name": "Wade Wilson",
"powers": "Deadpool possesses a superhuman healing factor derived from that of the mutant Wolverine that allows him to regenerate damaged or destroyed areas of his cellular structure"
},
{
"id": 2,
View Scale.cs
using HoloToolkit.Unity.InputModule;
using UnityEngine;
using IInputHandler = HoloToolkit.Unity.InputModule.IInputHandler;
using IManipulationHandler = HoloToolkit.Unity.InputModule.IManipulationHandler;
public class Scale : MonoBehaviour, IInputHandler, IManipulationHandler
{
private IInputSource currentInputSource = null;
private uint currentInputSourceId;
private Vector3 currentScale;
View Rotate.cs
using HoloToolkit.Unity.InputModule;
using UnityEngine;
using IInputHandler = HoloToolkit.Unity.InputModule.IInputHandler;
using IManipulationHandler = HoloToolkit.Unity.InputModule.IManipulationHandler;
public class Rotate : MonoBehaviour, IInputHandler, IManipulationHandler
{
private IInputSource currentInputSource = null;
private uint currentInputSourceId;
View AndroidCallBacks.cs
using UnityEngine;
public class AndroidCallBacks : MonoBehaviour {
private string yes = "0";
private string no = "1";
// Use this for initialization
void Start () {
View Controller.cs
using UnityEngine;
using UnityEngine.UI;
public class Controller : MonoBehaviour {
// To display output of the alert box
public Text reply;
// To store context of the main activity that Unity3D is running
private AndroidJavaObject activityContext = null;
View ShowNativeDialogBox.java
package com.plugin.android.dialogboxmodule;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.view.ContextThemeWrapper;
import com.unity3d.player.UnityPlayer;
View CallToast.cs
using UnityEngine;
public class CallToast : MonoBehaviour {
// To store context of the main activity that Unity3D is running
private AndroidJavaObject activityContext = null;
// To store the instance of the class
private AndroidJavaObject toastExample = null;
View Rays2.shader
Shader "UnityCoder/Rays2"
{
Properties
{
tDiffuse ("Base (RGB)", 2D) = "white" {}
fX ("fX", Float) = 0.5 // you can feed mouse xpos here with script: var mpos:Vector3 = Camera.main.ScreenToViewportPoint(Input.mousePosition); renderer.material.SetFloat( "fX", mpos.x);
fY ("fY", Float) = 0.5 // mouse ypos
fExposure ("fExposure", Float) = 0.6
fDecay ("fDecay", Float) = 0.93
fDensity ("fDensity", Float) = 0.96
View QualitySettingManager.cs
using UnityEngine;
using System.Collections;
/// <summary>
/// Quality setting manager.
/// To change the quality of graphics at runtime which will
/// increase quality and power consumption and may decrease framerate vice versa
/// </summary>
public class QualitySettingManager : MonoBehaviour {
@nipundavid
nipundavid / Matte Shadow.shader
Created Nov 30, 2016
Shader to show the shadow on transparent gameobject, very usefull in Augmented Reality (Vuforia)
View Matte Shadow.shader
Shader "FX/Matte Shadow" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
}
SubShader {
Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"}
LOD 200
Blend Zero SrcColor
You can’t perform that action at this time.