This file contains 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
/* Written by Cassius Adams for the Super Space Trooper video game. http://www.SuperSpaceTrooper.com */ | |
// Find the distance between weapon and Player so we can anticipate where Player will be | |
distance = Vector3.Distance(player.transform.position, transform.position); | |
// Divide distance by weaponSpeed to see how long it will take to get from Enemy to Player | |
var travelTime = distance / (Mathf.Abs(weaponSpeed) + playerSpeed); | |
// Multiply the amount of time by the speed the Player moves at | |
var futurePosition = travelTime * playerSpeed; | |
This file contains 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
/* | |
* Setup: | |
* Create an empty GameObject and add the EventManager script to it. | |
* Create custom event classes that extend the CustomEvent. | |
* | |
* Restrictions & Tips: | |
* DO NOT add event listeners in the Awake() method! | |
* This is used by the EventManager to initialize. | |
* Change this class' Execution Order to before default time if you need to work around this. | |
* Use the Start() method to setup your events. |
This file contains 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
// This work is licensed under a Creative Commons Attribution 3.0 Unported License. | |
// http://creativecommons.org/licenses/by/3.0/deed.en_GB | |
// | |
// You are free: | |
// | |
// to copy, distribute, display, and perform the work | |
// to make derivative works | |
// to make commercial use of the work | |
This file contains 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
// Real-time Realistic Ocean Lighting using Seamless Transitions from Geometry to BRDF | |
// Copyright (c) 2009 INRIA | |
// All rights reserved. | |
// | |
// Redistribution and use in source and binary forms, with or without | |
// modification, are permitted provided that the following conditions | |
// are met: | |
// 1. Redistributions of source code must retain the above copyright | |
// notice, this list of conditions and the following disclaimer. |
This file contains 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 System.Collections; | |
public class MoveTransform : IActivated { | |
public Transform objectMoved; | |
public Movements activatedPos, deactivatedPos; | |
[System.Serializable] | |
public class Movements { |
This file contains 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; | |
[CustomEditor (typeof(Trigger))] | |
[CanEditMultipleObjects()] | |
public class TriggerEditor : Editor | |
{ | |
private SerializedObject obj; | |
private SerializedProperty radius; |
This file contains 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
// C# built-in event system used in Unity3D | |
// | |
// Author: Bartek Drozdz | |
// Reference: http://www.everyday3d.com/blog/index.php/2010/10/04/c-events-and-unity3d/ | |
using UnityEngine; | |
public class EventDispatcher : MonoBehaviour | |
{ | |
public delegate void EventHandler(GameObject e); |
This file contains 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
Shader "Hidden/Vignetting" { | |
Properties { | |
_MainTex ("Base", 2D) = "white" {} | |
_VignetteTex ("Vignette", 2D) = "white" {} | |
_GlitchTex ("Glitch", 2D) = "white" {} | |
} | |
CGINCLUDE | |
#pragma target 3.0 |
This file contains 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
Shader "Base_Artifact" | |
{ | |
Properties | |
{ | |
_DataTex ( "Data Artifact", 2D ) = "black" {} | |
_Rate ( "Artifact Rate", float ) = 2.0 | |
_Screeny_rate ( "Screen Rate", float ) = 6.0 | |
_WarpScale ( "Warp Scale", range( -2, 2 ) ) = 0.5 | |
_WarpOffset ( "Warp Offset", range( 0, 0.5 ) ) = 0.5 | |
This file contains 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
Shader "Base_Texture" | |
{ | |
Properties | |
{ | |
_DiffuseAmount ( "Diffuse Amount", Range( 0.0, 1.0 ) ) = 0.25 | |
_TexAmount ( "Texture Amount", Range( 0.0, 1.0 ) ) = 0.25 | |
_SpecAmount ( "Specular Amount", Range( 0.0, 16.0 ) ) = 1.0 | |
_SpecTexAmount ( "Spec Texture Amount", Range( 0.0, 1.0 ) ) = 0.25 | |
_Diffusemap ( "Diffusemap", 2D ) = "diffuse" {} |