Skip to content

Instantly share code, notes, and snippets.

using OpenTK;
using OpenTK.Graphics.OpenGL;
using System;
namespace WEditor.Rendering
{
public class Mesh
{
public Vector3[] Vertices
{
public class EntrySubOption : INotifyPropertyChanged
{
/* Actual Layout of Struct on Disk: */
// 0x2C/44 bytes long
// 0x00 - string Name
// 0x21 - string MapName
// 0x29 - byte RoomNumber
// 0x2A - byte SpawnPointId
// 0x2B byte LoadedLayerId
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Newtonsoft.Json;
public enum TileSides
{
None = 0,
BottomLeft,
BottomRight,
{ "height":32,
"layers":[
{
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 2, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1
private bool CheckForLedgeHangStart()
{
if (m_controller.CollisionState.HasLedge())
{
// Ensure we can't grab a ledge within a 20th of a second after the last time we let go of one,
// so we don't end up sticking to the same ledge.
if (m_velocity.y < 0f && Time.time - m_lastLedgeGrabEndTime > 0.2f)
{
// Ensure that we're close enough to the top of the ledge.
int wholeBlock = Mathf.RoundToInt(transform.position.y);
using UnityEngine;
using System.Collections;
using DG.Tweening;
public class ArrowProjectile : AmmoPickup, IStatusAfflictionReciever
{
[SerializeField] private ParticleSystem m_fireTrailParticle;
[SerializeField] private int m_damageAmount = 2;
[SerializeField] private float m_antiGravDuration = 0.15f;
@LordNed
LordNed / SpriteFlash.cs
Created May 24, 2015 20:01
Example of how to use Renderer::Material vs Renderer::SharedMaterial
using UnityEngine;
using System.Collections;
public class SpriteFlash : MonoBehaviour
{
/// <summary> Renderer who's material we want to cause to flash. Material must have a "_FlashAmount" float property ([0-1]) to tween. </summary>
[SerializeField] private Renderer m_sprite;
/// <summary> Rate at which the sprite will flash - specifies duration of one half of the interval, ie: "0.1" will spend 0.1 seconds on, then 0.1s off. </summary>
public float FlashRate = 0.1f;
using UnityEngine;
using System;
using System.Collections.Generic;
public abstract class BaseDirectionalWeapon : BaseWeapon
{
protected FireDirections m_weaponDirection;
[Flags]
protected enum FireDirections
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystem;
[RequireComponent(typeof(Button))]
public class ButtonClickOnHold : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
public float HoldDurationThreshold = 0.5f;
using UnityEngine;
using System.Collections;
using Newtonsoft.Json;
public class GlobalState : MonoBehaviour
{
public static GameSettings Settings;
/// <summary>
/// This is as close to as we can come in Unity to a entry point to the program. The GlobalState