This file contains hidden or 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
while (!targetUnit.IsDead()) { | |
actor.animation.Play("run"); | |
while (Vector3.Distance(actor.transform.position, target.transform.position) > actorUnit.attackRange) { | |
actorUnit.MoveTo(target.transform.position); | |
yield return null; | |
} | |
while (Vector3.Angle(actor.transform.forward, target.transform.position - actor.transform.position) > 10) { |
This file contains hidden or 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.Collections.Generic; | |
// JobManager is just a proxy object so we have a launcher for the coroutines | |
public class JobManager : Singleton<JobManager> {} | |
public class Job | |
{ | |
public event System.Action<bool> jobComplete; |
This file contains hidden or 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
--------------------------------------------------------------------- | |
| The CASC (Content Addressable Storage Container) Filesystem | | |
| Warlords of Draenor Alpha, Build 6.0.1.18125 | | |
| Written April 14th, 2014 by Caali | | |
| Version 1.2 | | |
--------------------------------------------------------------------- | |
Distribution and reproduction of this specification are allowed without | |
limitation, as long as it is not altered. Quotation in other works is | |
freely allowed, as long as the source and author of the quote are stated. |
This file contains hidden or 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
原文 GG 了請參考 archive | |
https://web.archive.org/web/20090221093708/http://d.hatena.ne.jp/yuki_neko_nyan/20090217/1234850409 | |
以下備份 | |
2009-02-17 | |
■ループが書けなくなる(或いは再帰依存症)レベル10 15:00 ループが書けなくなる(或いは再帰依存症)レベル10 - 猫的怠惰Days | |
level 0 |
This file contains hidden or 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
var upm = 1000; | |
function Point(x, y, on, interpolated){ | |
this.xori = x; | |
this.yori = y; | |
this.xtouch = x; | |
this.ytouch = y; | |
this.touched = false; | |
this.donttouch = false; | |
this.on = on; |
This file contains hidden or 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
// Safari, in Private Browsing Mode, looks like it supports localStorage but all calls to setItem | |
// throw QuotaExceededError. We're going to detect this and just silently drop any calls to setItem | |
// to avoid the entire page breaking, without having to do a check at each usage of Storage. | |
if (typeof localStorage === 'object') { | |
try { | |
localStorage.setItem('localStorage', 1); | |
localStorage.removeItem('localStorage'); | |
} catch (e) { | |
Storage.prototype._setItem = Storage.prototype.setItem; | |
Storage.prototype.setItem = function() {}; |
This file contains hidden or 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
function initShaders( gl, vertexShaderId, fragmentShaderId ) | |
{ | |
var vertShdr; | |
var fragShdr; | |
var vertElem = document.getElementById( vertexShaderId ); | |
if ( !vertElem ) { | |
alert( "Unable to load vertex shader " + vertexShaderId ); | |
return -1; | |
} |
This file contains hidden or 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
// Simple wrapper to use bootstrap's grid system to position elements side-by-side | |
var VerticalFieldsElement = React.createClass({ | |
render: function() { | |
return dom.div( | |
{ className: 'clearfix' }, | |
React.Children.map(this.props.children, function(child) { | |
if(!child) { | |
return child; | |
} |
This file contains hidden or 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
// 可能可以改寫成這樣: | |
LocationsFetcher.fetchLastResult = null; | |
LocationsFetcher.fetch = () => | |
if (LocationsFetcher.fetchLastResult) { | |
return Promise.reject(new AlreadyCalledError()); | |
} else { | |
return LocationsFetcher.fetchLastResult = doFetchInternal(); | |
} | |
}; |
This file contains hidden or 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
import { graphql, GraphQLString, GraphQLInt } from 'graphql'; | |
import { objectType, enumType, schemaFrom, listOf } from 'graphql-schema'; | |
import request from 'promisingagent'; | |
const repositorySortEnum = enumType('RepositorySort') | |
.value('CREATED', 'created') | |
.value('UPDATED', 'updated') | |
.value('PUSHED', 'pushed') | |
.value('FULL_NAME', 'full_name') | |
.end(); |