Shader "MaterialPropertyDrawer"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
[HideInInspector] _MainTex2("Hide Texture", 2D) = "white" {}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Martin Roberts' R2 sequence in HLSL | |
// http://extremelearning.com.au/unreasonable-effectiveness-of-quasirandom-sequences/ | |
namespace MRR2 { | |
float triangularWave(float x) { | |
return abs(0.5f - x) * -2.0f + 1.0f; | |
} | |
static const float a1 = (0.6180339887498948); | |
static const float2 a2 = float2(0.7548776662466927, 0.5698402909980532); | |
static const float3 a3 = float3(0.8191725133961644, 0.671043606703789, 0.5497004779019701); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef MAINLIGHT_INCLUDED | |
#define MAINLIGHT_INCLUDED | |
void GetMainLightData_float(out half3 direction, out half3 color, out half distanceAttenuation, out half shadowAttenuation) | |
{ | |
#ifdef SHADERGRAPH_PREVIEW | |
// In Shader Graph Preview we will assume a default light direction and white color | |
direction = half3(-0.3, -0.8, 0.6); | |
color = half3(1, 1, 1); | |
distanceAttenuation = 1.0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void OpenApp() { | |
string bundleId = "<App Package Name>"; // your target bundle id | |
AndroidJavaClass up = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); | |
AndroidJavaObject ca = up.GetStatic<AndroidJavaObject>("currentActivity"); | |
AndroidJavaObject packageManager = ca.Call<AndroidJavaObject>("getPackageManager"); | |
//if the app is installed, no errors. Else, doesn't get past next line | |
AndroidJavaObject launchIntent = packageManager.Call<AndroidJavaObject>("getLaunchIntentForPackage",bundleId); | |
ca.Call("startActivity",launchIntent); |