Skip to content

Instantly share code, notes, and snippets.

public class EnemyUnit
{
public bool Enabled; // Is the object active within the environment?
public bool IsAlive; // Has the object been killed yet?
public bool CanBeHit; // Can the enemy be hit or is it currently invulnerable or dead?
public void OnHit()
{
if(Enabled)
{
public class EnemyUnit
{
public bool Enabled; // Is the object active within the environment?
public bool IsAlive; // Has the object been killed yet?
public bool CanBeHit; // Can the enemy be hit or is it currently invulnerable or dead?
public void OnHit()
{
if(Enabled)
{
public enum States
{
Idle,
Walking,
Running
}
public float speed = 0.0f;
public void SetState(States newState)
class Solution:
def maxSubArray(self, nums: List[int]) -> int:
solutions = []
bestSolution = -sys.maxsize - 1
for i in range(0, len(nums)):
num = nums[i]
prevSolution = 0
if(i > 0):
prevSolution = solutions[i - 1]
@robotron2084
robotron2084 / OrientParticles.cs
Last active September 15, 2018 15:23
Orient Particles in Unity3d
using UnityEngine;
using System;
using System.Collections.Generic;
using System.Collections;
/**
* A simple copy of example code from the manual, modified to orient particles
* based on the center of the system.
*/
@robotron2084
robotron2084 / new-vid-controller.js
Created July 7, 2016 02:41
Cloudinary Form Data Issue
(function()
{
'use strict';
angular
.module('vid.vids.controllers')
.controller('NewVidController', NewVidController)
NewVidController.$inject = ['$rootScope', '$scope', 'Authentication', 'Snackbar', 'Vids', 'cloudinary'];
using UnityEngine;
using System;
using System.Collections.Generic;
using System.Collections;
public class CollectionsExample : MonoBehaviour
{
void Start()
{
@robotron2084
robotron2084 / ReallyBreakPrefabInstance.cs
Last active October 24, 2018 11:31
REALLY breaks it! Really good.
using UnityEngine;
using UnityEditor;
public class ReallyBreakPrefabInstance
{
[MenuItem ("GameObject/REALLY Break Prefab Instance")]
public static void BreakIt()
{
Transform xForm = Selection.activeTransform;
if(xForm != null)
@robotron2084
robotron2084 / SerializedPropertyViewer.cs
Created March 29, 2016 17:00
Serialized Property Viewer
using UnityEngine;
using UnityEditor;
using System.Text;
using System.Collections;
using System.Collections.Generic;
public class SerializedPropertyViewer : EditorWindow
{
public class SPData
@robotron2084
robotron2084 / ProjectMenuUtil.cs
Created March 1, 2016 22:13
Texture Import Settings
using UnityEngine;
using UnityEditor;
public static class ProjectMenuUtil
{
[MenuItem ("Assets/Import For PixelWave")]
public static void ImportForWave()
{
foreach(Object o in Selection.objects)
{