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
package { | |
//import necessary classes | |
import flash.display.Sprite; | |
import flash.display.Graphics; | |
public class Circle extends Sprite { | |
private var canvas:Sprite = new Sprite(); | |
private var gr:Graphics = canvas.graphics; |
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 fl.motion.AdjustColor; | |
import flash.filters.ColorMatrixFilter; | |
var colorFilter:AdjustColor = new AdjustColor(); | |
var mColorMatrix:ColorMatrixFilter; | |
var mMatrix:Array = []; | |
var MC:MovieClip = new MovieClip(); | |
function adjustColors():void | |
{ |
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
public static function changeAirAppId():void { | |
var file:File = File.applicationDirectory.resolvePath(APP_CONF_PATH + APP_CONF_FILE); | |
Logger.log(file.url); | |
if (file.exists) { | |
var ObiectXML:XML = readXMLFromFile(file); | |
var ns:Namespace = ObiectXML.namespace(); | |
var time:Date = new Date(); | |
ObiectXML.ns::id[0] = 'Bot' + time.valueOf().toString(); | |
var sourceFile:File = File.applicationStorageDirectory.resolvePath(APP_CONF_FILE); |
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
private function createSpiralSearchPath(max_x:int, max_y:int, start_point:Point = null):Vector.<Point> { | |
var current_cell:Point = new Point(); | |
if (start_point){ | |
current_cell.x = start_point.x; | |
current_cell.y = start_point.y; | |
}else{ | |
current_cell.x = int(max_x * 0.5); | |
current_cell.y = int(max_y * 0.5); | |
} |
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
private Vector2 worldStartPoint; | |
void Update () { | |
// only work with one touch | |
if (Input.touchCount == 1) { | |
Touch currentTouch = Input.GetTouch(0); | |
if (currentTouch.phase == TouchPhase.Began) { | |
this.worldStartPoint = this.getWorldPoint(currentTouch.position); |
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
// http://stackoverflow.com/questions/11497085/move-camera-over-terrain-using-touch-input-in-unity-3d/27836741#27836741 | |
using UnityEngine; | |
using System.Collections; | |
public class ViewDrag : MonoBehaviour { | |
Vector3 hit_position = Vector3.zero; | |
Vector3 current_position = Vector3.zero; | |
Vector3 camera_position = Vector3.zero; | |
float z = 0.0f; |
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
int childs = transform.childCount; | |
for (int i = childs - 1; i > 0; i--) | |
{ | |
GameObject.Destroy(transform.GetChild(i).gameObject); | |
} |
NewerOlder