Skip to content

Instantly share code, notes, and snippets.

@adamtuliper
adamtuliper / EnemyController.cs
Created April 9, 2021 17:29
Enemy moving away from the player but looking at them
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemyController : MonoBehaviour
{
private Rigidbody rb;
private Transform playerTransform;
// Start is called before the first frame update
void Start()
@adamtuliper
adamtuliper / PlayerControllerWithPhysics.cs
Last active April 9, 2021 17:30
Ground detection, mouse look, and jump
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerControllerWithPhysics : MonoBehaviour
{
private Rigidbody rb;
private float horizontal;
private float vertical;
public float Speed = 5;
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
using System;
using UnityEngine;
using System.Collections;
using UnityEditor;
using UnityEngine.Rendering;
//Dumps the default Graphics Api selection for a particular platform in Unity
public class DumpGraphicsApi : MonoBehaviour
{
// Use this for initialization
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Folder\shell\Unity5]
@=""
"Icon"="%ProgramFiles%\\Unity\\Editor\\Unity.exe"
"MUIVerb"="Open as Unity Project"
[HKEY_CLASSES_ROOT\Folder\shell\Unity5\Command]
@="cmd /c start /D\"c:\\Program Files\\Unity\\Editor\\\" Unity.exe -projectPath \"%1\""
using UnityEngine;
using System.Collections;
public class ButtonCodeThatsBeenDroppedOntoButton : MonoBehaviour
{
public void IveBeenClicked()
{
//The scene you are loading should be included in the build settings
//Example, note without the .unity on the end of the scene name
Application.LoadLevel("Level1");
@adamtuliper
adamtuliper / migration.sql
Created November 15, 2012 06:20 — forked from jculverwell/migration.sql
Migration from ASP.NET Membership to SimpleMembership
--This script attempts to migrate the users
--from the old ASP.Net Membership tables
--into the new SimpleMemberShip tables
--The SimpleMembsership uses more secure password hashing, as such the old password hashes won't
--work with the SimpleMembership tables.
--As far as I can tell you have two options
--1) Get your users to reset their passwords
--2) Update your web.config to force SimpleMembership to use the old SHA1 format. See more details
--here http://stackoverflow.com/questions/12236533/migrating-from-asp-net-membership-to-simplemembership-in-mvc4-rtm
@adamtuliper
adamtuliper / gist:3719567
Created September 14, 2012 03:06
Strongly typed caching
public void Test_Add_And_Remove_Item_From_Cache_Pass()
{
Customer customer = new Customer
{
CustomerId = new Random(DateTime.Now.Millisecond).Next(),
FirstName = "Mary",
LastName = "Doe",
Address = "555 Main St.",
City = "Austin",
State = "TX",