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
startup, version: 3114 osx x64 channel: stable | |
executable: /Applications/Sublime Text.app/Contents/MacOS/Sublime Text | |
working dir: / | |
packages path: /Users/xdegtyarev/Library/Application Support/Sublime Text 3/Packages | |
state path: /Users/xdegtyarev/Library/Application Support/Sublime Text 3/Local | |
zip path: /Applications/Sublime Text.app/Contents/MacOS/Packages | |
zip path: /Users/xdegtyarev/Library/Application Support/Sublime Text 3/Installed Packages | |
ignored_packages: ["Vintage"] | |
pre session restore time: 0.421281 | |
startup time: 0.471657 |
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
#!/bin/sh | |
id=? | |
start=100000000 | |
end=999999999 | |
for (( n=$start; n<$end; n++ )); do | |
if (curl -s https://vk.com/doc"$id"_"$n" | grep -q "msg_back_button"); | |
then | |
echo "$n" | tee grabber.out | |
else |
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
-> murder_scene | |
// | |
// System: items can have various states | |
// Some are general, some specific to particular items | |
// | |
LIST OffOn = off, on | |
LIST SeenUnseen = unseen, seen |
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 WeightedSettings{ | |
public string key; | |
public float weight; | |
public float reward; | |
} | |
public static string WeightedRandom(this List<WeightedSettings> list){ | |
var totalChance = 0f; | |
foreach(var o in list){ | |
totalChance += o.weight; |
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
const functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
admin.initializeApp(functions.config().firebase); | |
const tournamentOffsetInDays = 172800000; | |
exports.updateTournamentDate = functions.https.onRequest((request, response) => { | |
var tournamentRef = admin.database().ref("currentTournament"); | |
var prevtournamentRef = admin.database().ref("prevTournament"); | |
var fakeusersRef = admin.database().ref("fake_users"); |
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
tell application "System Events" | |
tell process "Finder" | |
repeat 100 times | |
tell application "Finder" to open trash | |
tell application "Finder" to activate | |
key code 126 | |
key down command | |
key code 51 | |
key up command | |
delay 0.2 -- adjust delay as needed |