Skip to content

Instantly share code, notes, and snippets.

@DB-009
DB-009 / Portals.cs
Created November 12, 2015 00:53
Portals script for Unity 25D platformer mini tutorial 1B (portals)
using UnityEngine;
using System.Collections;
public class Portals : MonoBehaviour {
//in our code portals are just position aka transforms
public Transform disPortal;//the current portal
public Transform targetPortal;//the target portal
// Use this for initialization
@DB-009
DB-009 / CameraTracking.cs
Created November 12, 2015 00:50
Updated Camera controls for mini tutorial (2.5D platformer) 1A
using UnityEngine;
using System.Collections;
public class CameraTracking : MonoBehaviour {
public Transform myTarget;//what object are you targetting
public Vector3 camReposition;//the position camera is getting repositioned to when tracking an object
public float disTarget;//how far to set camera from payer - Z displacement to control distance usally negatives is what youre looking for
@DB-009
DB-009 / CameraTracking.cs
Last active November 6, 2015 23:18
Updated Camera tracking for part 6 of 2.5D platformer series includes locations animations instead of linear
using UnityEngine;
using System.Collections;
public class CameraTracking : MonoBehaviour {
public Transform myTarget;//what object are you targetting
public Vector3 camReposition;//the position camera is getting repositioned to when tracking an object
public bool isAnim;//has the object started animating mainly to get a start position for reseting animation)
public Vector3 animStartPos;//star position of animation
@DB-009
DB-009 / Helloworld.cs
Created November 4, 2015 05:23
Source Code for Intro to Programming 3 Class Ref. and Function w/ parameters (updated HelloWorld.cs from tut 1)
using UnityEngine;
using System.Collections;
public class Helloworld : MonoBehaviour {
public float helloVar;
void Start ()
{
helloVar = 0;
@DB-009
DB-009 / Arrays.cs
Last active November 4, 2015 05:32
Arrays source code for intro to programming tutorial 4
using UnityEngine;
using System.Collections;
public class Arrays : MonoBehaviour {
public string[] myString;//[] after the type make sit an array in this case we made an array [] of type string, names myString
void Start ()
{
@DB-009
DB-009 / FixedControls.cs
Last active November 4, 2015 06:23
Files for Unity Prototyping 2.0 Series - Part 2 - Tile Gen, And Controls
using UnityEngine;
using System.Collections;
public class FixedControls : MonoBehaviour {
public float zSpd, xSpd,ySpd;//Speed of ship on X,Y,Z axis's
public bool yAccel,zAccel,xAccel;//boolean to know if the player is actually accelerating on any axis used for slow down funtion
@DB-009
DB-009 / Enemy.cs
Last active November 6, 2015 18:56
files for part5 of 2.5 D tutorial
using UnityEngine;
using System.Collections;
public class Enemy : MonoBehaviour {
public int eneID;
public Player target;
@DB-009
DB-009 / CameraTracking.cs
Last active November 6, 2015 06:23
Platform controls, Enemy, Camera tracking scripts with aniamtion for part 4 of 2.5D tutorial
using UnityEngine;
using System.Collections;
public class CameraTracking : MonoBehaviour {
public Transform myTarget;
public Vector3 camReposition;
@DB-009
DB-009 / CameraTracking.cs
Last active November 6, 2015 04:46
Camera tracking and Enemy class script for part3 of 2.5D tutorial
using UnityEngine;
using System.Collections;
public class CameraTracking : MonoBehaviour {
public Transform myTarget;
public Vector3 camReposition;
@DB-009
DB-009 / PlatformControls.cs
Last active November 6, 2015 23:00
Updated Platform Controls for part2 of 2.5D tutorial
using UnityEngine;
using System.Collections;
public class PlatformControls : MonoBehaviour {
//Boolean variables can be true or false you'd use this to see wheather something is happening or a variable is set.
public bool isGrounded;//is my player colliding with the floor?