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) | |
{ |
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.Runtime.InteropServices; | |
using System; | |
public class DisplayManagerJNI : MonoBehaviour { | |
private IntPtr JavaClass; | |
private string getResolution; | |
void Start () | |
{ |
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
1) private не надо ставить, существует дефолтный модификатор видимости) | |
2) использу google translate если не уверен как по-английски что-то пишется. или спроси меня. и попробуй http://lingualeo.ru/ | |
3) все типы умеют инициализироваться по умолчанию, не нужно писать Object o = null; Только если ты явно хочешь обнулить значение; | |
4) если ты не добавляешь какого либо функционала в get'еры/set'еры не испульзуй проперти, оставь поле, и если будет необходимо изменить поведение ебанешь проперти | |
5) любая конструкция if/else даже если состоит из 1 оператора должна быть написана со скобками if(){}else{} никаких if();else; аналогично для for/foreach | |
6) правильно название подбирай: UseAbility возвращает bool что вприницпе хуево и непонятно переименуй во что-то что из названия подсказывает что вернет bool например TryUseAbility() | |
7) (delegate(AbilityBase item) { return item.myType == abilityType; }); в контексте Comparer'oв вместо явных делегатов используй лямбды и анонимные функции читать легче | |
8) толково растаскивай код, |
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
Testing Mesh Skinning with different shaders today; | |
Timings: | |
Diffuse-Specular | |
Editor: ~1.5ms | |
IPOD5: ~2.3ms | |
Diffuse: | |
Editor: ~0.2ms-1.5ms | |
IPOD5: ~2ms | |
Unlit: | |
Editor: ~0.2ms-1.5ms |
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; | |
public class CreateEmptyChild : MonoBehaviour { | |
[MenuItem("GameObject/Create Empty Child &#n")] | |
static void EmptyChild(){ | |
GameObject go = new GameObject("Empty"); | |
go.transform.parent = Selection.activeTransform; | |
go.transform.localPosition = Vector3.zero; | |
go.transform.localRotation = Quaternion.identity; |
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() { |
OlderNewer