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 explody_pf :Transform; | |
function explody (){ | |
var instancedbullet =Instantiate( explody_pf ,transform.position,Quaternion.identity); | |
//instancedbullet.rigidbody.AddForce(transform.forward * shootForce); | |
} |
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
/* | |
This camera smoothes out rotation around the y-axis and height. | |
Horizontal Distance to the target is always fixed. | |
There are many different ways to smooth the rotation but doing it this way gives you a lot of control over how the camera behaves. | |
For every of those smoothed values we calculate the wanted value and the current value. | |
Then we smooth it using the Lerp function. | |
Then we apply the smoothed values to the transform's 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
var target : Transform; | |
var damping = 6.0; | |
var smooth = true; | |
@script AddComponentMenu("Camera-Control/Smooth Look At") | |
function LateUpdate () { | |
if (target) { | |
if (smooth) | |
{ |
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 OnCollisionEnter (collisionInfo : Collision) { | |
// print (collisionInfo.gameObject.tag) ; //??? HTH DO I TAG? | |
// print (collisionInfo.gameObject.transform.position) ; | |
// if (collisionInfo.gameObject.tag=="sphere"){ |
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 waypoint: Transform; | |
var speed: float = 15; | |
function Update () { | |
var target:Vector3 = waypoint.position; | |
var moveDirection: Vector3 = target -transform.position; | |
var velocity = rigidbody.velocity; | |
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 target : Transform; | |
function Update(){ | |
//the direction vector to target | |
var dir = (target.position - transform.position).normalized; | |
var hit :RaycastHit; | |
if (Physics.Raycast(transform.position,transform.forward,hit ,20)){ | |
//no self collision | |
if(hit.transform !=transform) |
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
# protect the htaccess file | |
<files .htaccess> | |
order allow,deny | |
deny from all | |
</files> | |
# disable the server signature | |
ServerSignature Off | |
# limit file uploads to 10mb |
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 flash.ui.Multitouch; | |
import flash.ui.MultitouchInputMode; | |
Multitouch.inputMode = MultitouchInputMode.GESTURE; | |
square_mc.addEventListener(TransformGestureEvent.GESTURE_SWIPE , onSwipe); | |
function onSwipe (e:TransformGestureEvent):void{ | |
if (e.offsetX == 1) { | |
//User swiped towards right | |
square_mc.x += 100; |
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
$data = array("a" => $a); | |
$ch = curl_init($this->_serviceUrl . $id); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); | |
curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($data)); | |
$response = curl_exec($ch); | |
if(!$response) { |
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
bool inputPlayer1Kick = Input.GetButtonUp("Player1Kick"); | |
bool inputPlayer2Kick = Input.GetButtonUp("Player2Kick"); | |
if(true == inputPlayer1Kick) | |
{ | |
// player 1 kicked | |
} | |
if(true == inputPlayer2Kick) | |
{ | |
//player 2 kicked |