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
enum State { | |
CHARGING, | |
SEARCH_HUMANS, | |
KILL_ALL_HUMANS | |
} | |
State myState = State.CHARGING; | |
float charge = 0f; | |
void Update() { |
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
public class State { | |
public virtual void Enter( Robot entity ); | |
public virtual void Execute( Robot entity ); | |
public virtual void Exit( Robot entity ); | |
} |
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
public class FSM { | |
public Robot entity; | |
public State currentState; | |
public FSM( Robot entity ) { | |
this.entity = entity; | |
} | |
public void Update() { |
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
public class Charging : State { | |
public override void Execute( Robot entity ) { | |
if ( entity.charge == 100f ) { | |
entity.fsm.ChangeState( SearchHumans.Instance ); | |
} else { | |
entity.DoCharge(); | |
} | |
} | |
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
public class Robot { | |
public FSM fsm; | |
void Start() { | |
fsm = new FSM( this ); | |
} | |
void Update() { | |
fsm.Update(); |
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 "xdegtyarev/InvertedFog" | |
{ | |
Properties | |
{ | |
_FogTexture ("Alpha8", 2D) = "white" {} | |
_FogIntencity("Intencity", Float) = 0.5 | |
} | |
SubShader | |
{ |
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 "xdegtyarev/Alpha8MaxBlended" | |
{ | |
Properties | |
{ | |
_MainTex ("Alpha8", 2D) = "white" {} | |
} | |
SubShader | |
{ | |
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} |
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
// | |
// main.cpp | |
// SublimeRunner | |
// | |
// Created by Alexander Degtyarev on 9/27/12. | |
// Copyright (c) 2012 Alexander Degtyarev. All rights reserved. | |
// | |
#include <iostream> | |
#include <sstream> |
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
Show hidden characters
{ | |
// You probably want to configure this to something of your own. | |
// ${home}, ${env:<variable>}, ${project_path:} and ${folder:} tokens can be used in the completesharp_assemblies option. | |
// | |
// ${home} is replaced with the value of the HOME environment variable. | |
// | |
// ${env:<variable>} is replaced with the "variable" environment variable. | |
// | |
// ${project_path:} tries to find a file with the given name in all the registered project folders and | |
// returns the first file found, or the original file name if none is found. |
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
public string GetCurrencyCodeFromSymbol(string symbol) | |
{ | |
Debug.Log("Retrieving symbol" + symbol); | |
RegionInfo regionalInfo; | |
foreach(CultureInfo o in CultureInfo.GetCultures(CultureTypes.SpecificCultures)) | |
{ | |
regionalInfo = new RegionInfo(o.LCID); | |
Debug.Log("Regional Symbol" + regionalInfo.CurrencySymbol); | |
if(regionalInfo.CurrencySymbol == symbol) | |
{ |
OlderNewer