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; | |
using System.Collections.Generic; | |
using BehaviorDesigner.Runtime; | |
public class PlayerInputMonitor : MonoBehaviour { | |
// Behavior variables | |
Behavior behavior; | |
Dictionary<string, SharedBool> behaviorBools; | |
Dictionary<string, SharedFloat> behaviorFloats; |
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 Platform : MonoBehaviour { | |
SpriteRenderer playerGraphic; | |
Rigidbody2D playerBody; | |
BoxCollider2D playerBox; | |
CircleCollider2D playerCircle; | |
float padTop = -0.2f; // Padding applied to the top of feet platform checks (prevents player from barely standing on platform) |
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 System; | |
using System.Linq; | |
namespace BehaviorDesigner.Runtime.Tasks | |
{ | |
[HelpURL ("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=53"), TaskDescription ("Behavior Reference allows you to run another behavior tree within the current behavior tree."), TaskIcon ("BehaviorTreeReferenceIcon.png")] | |
public abstract class BehaviorReference : Action | |
{ | |
[Tooltip ("Should the shared variables automatically be inherited from the parent tree?")] | |
public bool autoInheritVariables = true; | |
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.Generic; | |
namespace PixelCrushers.DialogueSystem.Adnc { | |
public class DialogueDbManager : MonoBehaviour { | |
[Tooltip("Allows you to add multiple databases to the current Dialogue System. @IMPORTANT Make sure to run the ID assigner to prevent overwriting.")] | |
[SerializeField] List<DialogueDatabase> db; | |
// Use this for initialization | |
void Awake () { |
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
<iframe width="600" height="450" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/search?q=https://www.google.com/maps/embed/v1/search?q=360%203rd%20Street%2C%20San%20Francisco%2C%20CA%2C%20United%20States&key=AIzaSyA9R4ONwGZtWSfenQvFXaaLwkCyHMq5o7k"></iframe> |
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
# | |
# Offer Drawer Module | |
# | |
# @author | |
# | |
(($, window, document) -> | |
class offerDrawerModule | |
_data: undefined | |
_defaultId: '#offer-drawer' |
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
DRAWER_CONTAINER = 'offer-drawer' | |
# Remove the drawer if the CSS class changes | |
_isMobileClass = false | |
$(window).resize(-> | |
mobileOn = $HTML.hasClass('mobile') | |
# Change detected, clear the existing class | |
if mobileOn != _isMobileClass | |
_isMobileClass = mobileOn |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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; | |
// @NOTE the attached sprite's position should be "top left" or the children will not align properly | |
// Strech out the image as you need in the sprite render, the following script will auto-correct it | |
[RequireComponent (typeof (SpriteRenderer))] | |
// Generates a nice set of repeated sprites inside a streched sprite renderer | |
// @NOTE Vertical only, you can easily expand this to horizontal with a little tweaking | |
public class RepeatSpriteBoundary : MonoBehaviour { |
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; | |
// For usage apply the script directly to the element you wish to apply parallaxing | |
// Based on Brackeys 2D parallaxing script http://brackeys.com/ | |
public class Parallax : MonoBehaviour { | |
Transform cam; // Camera reference (of its transform) | |
Vector3 previousCamPos; | |
public float distanceX = 0f; // Distance of the item (z-index based) |