View LightweightPipelineTemplateShader.shader
// When creating shaders for Lightweight Pipeline you can you the ShaderGraph which is super AWESOME!
// However, if you want to author shaders in shading language you can use this simplified version as a base.
// Please not this should be only use for reference only.
// It doesn't match neither performance not feature completeness of Lightweight Pipeline Standard shader.
Shader "LightweightPipeline/Physically Based Example"
{
Properties
{
// Specular vs Metallic workflow
[HideInInspector] _WorkflowMode("WorkflowMode", Float) = 1.0
View PasteSerialized.cs
// https://www.reddit.com/r/Unity3D/comments/94rpgc/i_wrote_a_piece_of_code_that_allows_for/
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
public static class ComponentUtil
{
static SerializedObject source;
[MenuItem("CONTEXT/Component/Copy Serialized")]
public static void CopySerialized(MenuCommand command)
View beatsabre.json
{
"_leaderboardsData": [
{
"_leaderboardId": "Level1_Expert_PartyStandard",
"_scores": [
{
"_fullCombo": false,
"_playerName": "ANDYB",
"_score": 116590,
"_timestamp": 1528234428
View latzko.shader
Shader "Custom/Latsko"{
Properties {
_Color ("Diffuse Material Color", Color) = (1,1,1,1)
}
SubShader {
Pass {
Tags { "LightMode" = "ForwardBase" } // pass for
// 4 vertex lights, ambient light & first pixel light
CGPROGRAM
View ShadeVertexLightsAtten.cginc
float3 ShadeVertexLightsAtten (
float4 lightPosX, float4 lightPosY, float4 lightPosZ,
float3 lightColor0, float3 lightColor1, float3 lightColor2, float3 lightColor3,
float4 lightAttenSq,
float3 pos)
{
// to light vectors
float4 toLightX = lightPosX - pos.x;
float4 toLightY = lightPosY - pos.y;
float4 toLightZ = lightPosZ - pos.z;
View TriplanarWorld.shader
Shader "Tri-Planar World" {
Properties {
_Side("Side", 2D) = "white" {}
_Top("Top", 2D) = "white" {}
_Bottom("Bottom", 2D) = "white" {}
_SideScale("Side Scale", Float) = 2
_TopScale("Top Scale", Float) = 2
_BottomScale ("Bottom Scale", Float) = 2
}
View _Instructions.md
  1. Look on https://github.com/UnityAssetPackages to see if we've added the repo you want to use.
  2. Check if it's been updated reasonably recently. If not nag us to pull the upstream changes.
  3. If it doesn't have a fork on UnityAssetPackages then you can sumbit an issue and we'll add it, you can volunteer to join our org and do it yourself - or if you're in a hurry just fork it to your own Github (or Gitlab or whatever) account.
  4. Make a note of the url used to clone the repo.
  5. Run example.sh= in the root directory of your main project to add the submodule to your repo.
  6. Use the https form of each git url if you want people who don't have commit rights to be able to use your main repo
  7. Add a package.json to the external repo in the first directory you wish to include in your project (i.e. either Assets or a subdirectory of Assets) The example below shows you what to put in that file. The only really critical bit is the name - it needs to be unique to the project and match what you put in manifest.json
View addpackage.sh
# Usage
# addpackage [repo url] [package directory name] [Assets dirs to include]
# Example: ./addpackage.sh https://github.com/georgejecook/UnityTimelineEvents.git UnityTimelineEvents "TimelineEvents/*"
git clone --depth=1 --no-checkout $1 Packages/$2/repo
git submodule add $1 Packages/$2/repo
git -C Packages/$2/repo/ config core.sparseCheckout true
git submodule absorbgitdirs
echo Assets/$3 >> .git/modules/Packages/$2/repo/info/sparse-checkout
git submodule update --init --force --checkout Packages/$2/repo
View runAndroid.sh
#!/bin/sh
# Script to install, run, and open logcat for a Unity Android App.
# I needed this as one of my libraries has a critical post-build script so I can't use "Build and Run" anymore - this is the "and Run" part.
# Be sure to update these variables to match your app's publishing/build settings:
APK_PATH='builds/android/basecode.apk'
BUNDLE_ID='com.eliotlash.basecode'
alias unilogcat='adb logcat|egrep "Unity"'
adb install -r "${APK_PATH}" && adb logcat -c && adb shell am start -n "${BUNDLE_ID}/com.unity3d.player.UnityPlayerNativeActivity" && echo 'DONE, LOG:' && unilogcat
View BuildPlayer.cs
// From https://forum.unity.com/threads/push-and-run-apk.225611/
using System;
using System.IO;
using UnityEditor;
using UnityEngine;
using System.Diagnostics;
using Debug = UnityEngine.Debug;
public class BuildPlayer : MonoBehaviour