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
using UnityEngine; | |
using UnityEditor.ShaderGraph; | |
using System.Reflection; | |
// IMPORTANT: | |
// - tested with LWRP and Shader Graph 4.6.0-preview ONLY | |
// - likely to break in SG 5.x and beyond | |
// - for HDRP, add your own keyword to detect environment | |
[Title("Custom", "Main Light Data")] |
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
// Put this in an editor folder | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEditor; | |
using UnityEngine; | |
using UnityEngine.Experimental.LowLevel; | |
using UnityEngine.Profiling; |
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
/* | |
To report an achievement status use this function. | |
for success, achievement must be reported to 100.0 | |
if you want to track some certain tasks, like blasted ball count. | |
you can calculate a percentage and when user blasted a ball, | |
you can report this percentage instead of 100.0 | |
*/ | |
Social.ReportProgress ("achievementID", 100.0, function(result) { | |
if (result){ | |
Debug.Log ("Successfully reported achievement progress"); |
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
#pragma strict | |
import UnityEngine.SocialPlatforms; | |
import UnityEngine.SocialPlatforms.GameCenter; | |
function Start () { | |
DontDestroyOnLoad(gameObject); | |
// Authenticate and register a ProcessAuthentication callback | |
// This call needs to be made before we can proceed to other calls in the Social API | |
Social.localUser.Authenticate (ProcessAuthentication); | |
GameCenterPlatform.ShowDefaultAchievementCompletionBanner(true); |
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
// Unity C# Cheat Sheet | |
// I made these examples for students with prior exerience working with C# and Unity. | |
// Too much? Try Unity's very good tutorials to get up to speed: https://unity3d.com/learn/tutorials/topics/scripting |