Skip to content

Instantly share code, notes, and snippets.

View wcoastsands's full-sized avatar
😎
Godot? Don't mind if I g'do!

wcoastsands

😎
Godot? Don't mind if I g'do!
  • 10:45 (UTC -07:00)
View GitHub Profile
@wcoastsands
wcoastsands / .gitignore
Last active May 21, 2021 15:36
.gitignore file for Unity projects
# .gitignore file for Unity project directories
# by Nikkolai Davenport, http://github.com/wcoastsands
#
# See the following article for instructions on how to use Git for Unity source control:
# http://fixbyproximity.com/2013/01/21/git-unity-3d-source-control/
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uilds/
@wcoastsands
wcoastsands / callback.php
Last active July 28, 2023 22:54
Unity Ads S2S Redeem Callback Example
<?php # callback.php (PHP 5) - Evaluates the Unity Ads S2S Redeem Callback.
//-----------------------------------------------------------------------------
// Each callback should contain the following parameters in the query string:
// pid -- product/game ID specified as part of the base callback URL
// sid -- user ID set through the Unity Ads SDK
// oid -- offer ID unique to each callback
// hmac -- HDMAC-MD5 hash of the query string
//-----------------------------------------------------------------------------
@wcoastsands
wcoastsands / GettingStarted.md
Last active May 8, 2021 20:37
Getting Started with Unity Ads in Unity 5.2 or Later

Getting Started with Unity Ads in Unity 5.2 or Later

Step 1: Set the Platform to either iOS or Android.

  1. Select File > Build Settings... from the Unity menu.
  2. Select iOS or Android from the Platform list.
  3. Select Switch Platform.

Step 2: Enable Unity Ads through the Services window.

@wcoastsands
wcoastsands / logcat.sh
Last active May 21, 2021 17:45
A logcat script for Unity builds
#!/bin/bash
clear;
adb logcat -c;
adb logcat -sv color time Unity UnityAds;
@wcoastsands
wcoastsands / 81-C# Script-NewBehaviourScript.cs.txt
Last active July 13, 2016 07:07
Customizing Script Templates in Unity
using UnityEngine;
using System.Collections;
namespace #COMPANYNAMESPACE#.#PRODUCTNAMESPACE#
{
public class #SCRIPTNAME# : MonoBehaviour
{
}
}
@wcoastsands
wcoastsands / Extensions.cs
Last active March 16, 2018 19:24
My Unity Extensions
using UnityEngine;
using System.Collections;
namespace com.wcoastsands
{
public static class Extensions
{
#region Object Extensions
public static T FindObjectOfType <T> (this Object unityObject) where T : Object
@wcoastsands
wcoastsands / CursorManager.cs
Created July 13, 2016 06:52
CursorManager for Unity Standard Assets FirstPersonController
using UnityEngine;
using FirstPersonController = UnityStandardAssets.Characters.FirstPerson.FirstPersonController;
public class CursorManager : MonoBehaviour
{
public FirstPersonController fpsController;
public bool locked { get; private set; }
void OnEnable ()
@wcoastsands
wcoastsands / SingletonBehaviour.cs
Last active April 17, 2018 21:45
A generic singleton class for use in creating single-instance managers in Unity.
using UnityEngine;
namespace Nikkolai
{
public abstract class SingletonBehaviour<T> : MonoBehaviour where T : MonoBehaviour
{
public static T instance { get { return GetInstance(); } }
[SerializeField, Tooltip("Determines whether the GameObject should be destroyed on scene loads.")]
protected bool m_DestroyOnLoad;
@wcoastsands
wcoastsands / BuildManifestObject.cs
Last active December 3, 2022 00:42
BuildManifestObject stub for use with pre-export methods in Unity Cloud Build
#if !UNITY_CLOUD_BUILD
using System.Collections.Generic;
namespace UnityEngine.CloudBuild
{
/// <summary>
/// A stub of the <see cref="T:UnityEngine.CloudBuild.BuildManifestObject"/> class,
/// available only on Unity Cloud Build servers.
/// <para>Pre export methods must take a single parameter of this type in order for the
/// method to be called prior to building a project in Unity Cloud Build.
@wcoastsands
wcoastsands / CursorController.cs
Created February 10, 2017 17:36
CursorController for MouseLook
using UnityEngine;
[RequireComponent(typeof(MouseLook))]
public class CursorController : MonoBehaviour
{
MouseLook m_MouseLook;
public bool locked { get; private set; }
void OnEnable ()