Thursday, June 30, 2011

Riyadh will build nuclear weapons if Iran gets them, Saudi prince warns

Riyadh will build nuclear weapons if Iran gets them, Saudi prince warns | World news | The Guardian
A senior Saudi Arabian diplomat and member of the ruling royal family has raised the spectre of nuclear conflict in the Middle East if Iran comes close to developing a nuclear weapon.

Prince Turki al-Faisal, a former Saudi intelligence chief and ambassador to Washington, warned senior Nato military officials that the existence of such a device "would compel Saudi Arabia … to pursue policies which could lead to untold and possibly dramatic consequences".

He did not state explicitly what these policies would be, but a senior official in Riyadh who is close to the prince said yesterday his message was clear.

"We cannot live in a situation where Iran has nuclear weapons and we don't. It's as simple as that," the official said. "If Iran develops a nuclear weapon, that will be unacceptable to us and we will have to follow suit."
I remember predicting this some time ago, but I can't find the post. But it didn't take a particularly clear crystal ball to see it coming.

Bookmark and Share

The Eight Words You Can't say on TV

Perhaps Comedian George Carlin's most notorious routine was, "The Seven Words You Can't Say on TV," from 1978. Considering his list (which no, I am not going to reproduce here), I would say that now there are only five of those words you still can't say on TV, and I mean broadcast TV, not cable, where I think the list would be down to two (or maybe none?)

Today, though, an eighth word was discovered that you can't say on TV, and the MSNBC commentator who uttered it promptly got sacked. Hugh Hewitt : Suspended? Really?
Mark Halperin is a star of the Beltway-Manhattan media elite, a lefty and transparently so.

But he is also a terrific though deeply biased political reporter and his slip into street-talk on air today needed and got an apology, but a suspension? I have been in broadcast studios, both television and radio, for two decades and the pejorative Halperin used is as common as it is low on the scale of insults towards political figures. So what is MSNBC saying with this absurd display of "standards?" That none of its hosts talk this way, or that they don't talk this way on air? If it is the later [sic - I think Hewitt means the former - DS], it is a mistake in delivery, not a moral offense, and no suspension is necessary. If the later [sic], there will be a whole lot more suspensions coming down the pike at MSNBC.
Carlin's words could not be uttered on TV (in 1978, anyway) just because they were obscene. But really, today Halperin was not bounced for the particular word that he said. He could have called the president a blockhead or dimwit or lesser term of derision and he still would have been thrown out the door.

Halperin crossed a line, but it wasn't lingual, it was political. He of all people should have known it. Sorry, Mark. No sympathy here.

Bookmark and Share

Unity FPS Shooter Game Tutorial #4

Adding explosions to missiles that have been launched =====















as a reminder the projectile script is as below:

var explosion : GameObject;


function OnCollisionEnter( collision : Collision )
{
var contact : ContactPoint = collision.contacts[0];
var rotation = Quaternion.FromToRotation( Vector3.up, contact.normal );
var instantiatedExplosion : GameObject = Instantiate(
explosion, contact.point, rotation );
Destroy( gameObject );
}


Reasons for increase volume trading during End-of-Quarter

Much of the recent rally has been traced to end-of-quarter window dressing by fund managers, who typically sell losers and buy winners to make their portfolios look better.

The Federal Reserve ends its $600 billion bond-buying program, known as QE2, on Thursday and has not offered any hints of more monetary easing. Markets were volatile in May and June, partly on concerns about QE2's end.


.

US STOCKS-Wall St rallies for fourth day into quarter-end - Yahoo! Singapore Finance

US STOCKS-Wall St rallies for fourth day into quarter-end - Yahoo! Singapore Finance
http://sg.finance.yahoo.com/news/US-STOCKS-Wall-St-rallies-rsg-450933985.html?x=0


.

Wednesday, June 29, 2011

The Importance of Reinvesting Dividends | Fundsupermart.com

http://www.fundsupermart.com/main/research/viewHTML.tpl?articleNo=5303




.

S'pore resale prices of private housing rose at faster pace in 2Q- DTZ - Yahoo! Singapore Finance

S'pore resale prices of private housing rose at faster pace in 2Q- DTZ - Yahoo! Singapore Finance

Singapore, Malaysian state investors to develop $9.86 bln projects - Yahoo! Singapore Finance

RPT-Singapore, Malaysian state investors to develop $9.86 bln projects - Yahoo! Singapore Finance

Singapore Exchange to introduce all-day stock trading from Aug 1 - Yahoo! Singapore Finance

Singapore Exchange to introduce all-day stock trading from Aug 1 - Yahoo! Singapore Finance
http://sg.finance.yahoo.com/news/Singapore-Exchange-introduce-rsg-4094767060.html?x=0

Dell to keep up acquisitions, sustain margin growth - Yahoo! Singapore Finance

Dell to keep up acquisitions, sustain margin growth - Yahoo! Singapore Finance
http://sg.finance.yahoo.com/news/Dell-keep-acquisitions-rsg-2029751045.html?x=0

The Real Reason Behind This Rally - How High Will It Go? - Yahoo! Singapore Finance

The Real Reason Behind This Rally - How High Will It Go? - Yahoo! Singapore Finance

Oh, how very true

Obama: It's Kids Versus Corporate Jets on Debt-Ceiling Talks:
Kids versus corporate jets.

If President Obama's news conference accomplished anything on Wednesday afternoon, it underscored, in striking tones, his strategy for winning the debt ceiling fight with Republicans: Make it a
clash of classes. Rich versus Poor. Us versus Them.

Those who support children, food safety, medical research and, presumably, puppies and apple pie versus the rich fat cats who don't.

In Obama's world, Democrats are for kids and Republicans are for corporate jets. That is a sharp distinction that could help put the GOP on defensive, but it may not be enough to persuade Republicans to change their posture on the debt-ceiling talks.

Republicans have cast Obama as a tax-raiser and a Big-Government spender. This was his jujitsu move to turn their arguments against them. With a hint of disdain, Obama even dredged up the death of Osama bin Laden to score a political point.

Typical Obama pablum, at least the part I heard, which rhetorically came down to, "If you don't want to eat poisoned food or your children to die so the heartless Republicans can give their fat cat friends more tax money, then you have to support me."

And his speech included this knee-slapping howler:
"Call me naive," Obama said, "but my expectation is leaders are going to lead."
Which is kind of interesting for him to utter that on the same day that Doug Matconis posted, "Obama Is President, But Is He A Leader?"
From the start of his Presidency, Barack Obama has displayed a leadership style that, well, displays a distinct lack of leadership. His first major legislative achievement, the 2009 stimulus package, was really just a hodgepodge of Democratic pet projects that had been sitting around for most of the Bush Administration. The piece of domestic legislation that he said would be the cornerstone of his first term in office, health care reform, was drafted by, and guided through Congress by, the leadership in the Senate and the House, whatever role the President played in the process was behind closed doors.

The White House calls his style "leading from the rear." No, really.

Bookmark and Share

Unity FPS Shooter Game Tutorial #3

Here is a modification in the launcher script to shoot two types of weapons
=================================================================================================================================================================================================================================

var projectile : Rigidbody;
var projectile2 : Rigidbody;
var speed = 20;

function Update () {


 if( Input.GetButtonDown( "Fire1" ) )
{

         var instantiatedProjectile : Rigidbody = Instantiate(
projectile, transform.position, transform.rotation );


instantiatedProjectile.velocity =
transform.TransformDirection( Vector3( 0, 0, speed ) );


   Physics.IgnoreCollision( instantiatedProjectile. collider,
     transform.root.collider );



}



if( Input.GetButtonDown( "Fire2" ) )
{

         var instantiatedProjectile2 : Rigidbody = Instantiate(
projectile2, transform.position, transform.rotation );


instantiatedProjectile2.velocity =
transform.TransformDirection( Vector3( 0, 0, speed ) );


   Physics.IgnoreCollision( instantiatedProjectile. collider,
     transform.root.collider );



}








}
==============================================================================================================================================================================================================================















Here is the two rigid bodies are a sphere (red sphere) and a cube(Xcube)

With its oil treasure, Israel gets a shield from tyranny - The Globe and Mail

With its oil treasure, Israel gets a shield from tyranny - The Globe and Mail
The London-based World Energy Council says Israel’s Shfela Basin, a half-hour drive south of Jerusalem, holds 250 billion barrels of recoverable shale oil, possibly making the energy-vulnerable country (as expressed by The Wall Street Journal) “the world’s newest energy giant.” With reserves of 260 billion barrels, Saudi Arabia would remain the world’s No. 1 oil country – though not, perhaps, for long. Howard Jonas, CEO of U.S.-based IDT Corp., the company that owns the Shfela Basin concession, says there is much more oil under Israel than under Saudi Arabia: Perhaps, he says, twice as much.

Bookmark and Share

Some Summer Favorites

Favorite new game:

game1

game2

Mexican Train Dominoes.  We learned it while in California last week and it is the perfect game for our whole family.  I ordered it on Amazon yesterday.  Come over and play it with us!

 

Favorite summer salad (I had it last night.  Wish I’d taken pictures because while the leftovers taste good, wilted lettuce leaves don’t photograph so well):

Mexi-Lime Salad topped with Spicy Honey Chicken

(This is actually my favorite salad for the past year or more.  My cousin-in-law Brooke featured it on her blog a while ago and I added the chicken recipe from Our Best Bites to make it a dinner salad.  It’s my go-to recipe when we have dinner guests because everyone LOVES it.)

 

Favorite new movie:

Temple Grandin.  It is fabulous on every level:  great acting, great cinematography, well-told true story, MANY lessons to learn about love and difference and hard work and achievement.  Totally ter

Favorite new book:

Not exactly a summer read, but it’s kind of like Freakanomics for parenting and children.  I like it because it’s interesting and gives me things to think about in a different way and apply without a ton of stress. 

Favorite summer snack:

yogurt

I know, I know.  Every other area in the country has had these for a looong time.  Spokane lags in the food department.  We just got one 25 minutes away and we go every weekend.  I love it because you can indulge with chocolate and treats or go fruity and sugar free and feel virtuous.

Favorite new children’s pictures:

001006010013014017019021028027

03017720002007

Randi from M Photo again.  Because she’s the best.  We did just the kids, on the day of Jane’s baptism, and I snuck in a few.  Have to show them off.

Favorite Summer Dream:

That I actually can take a half hour every few days to post all of the the fun and funny stuff that goes on around here.  We’ll see!

AFP: Iran secretly tested 'nuclear-capable missiles'

AFP: Iran secretly tested 'nuclear-capable missiles'

Another triumph for Obama's foreign policy!

Bookmark and Share

Don't Mess With the Dutch

Information Dissemination: Footage Of Dutch Freeing Pirated Vessel

In which the pirates off Somalia learn the hard way that the Dutch navy is small but professional and deadly.

Bookmark and Share

Unity FPS Shooter Game tutorial #2

Making the missile explode
======================================================================



var explosion : GameObject;
function OnCollisionEnter( collision : Collision )
{
 var contact : ContactPoint = collision.contacts[0];
 var rotation = Quaternion.FromToRotation( Vector3.up, contact.normal );
 var instantiatedExplosion : GameObject = Instantiate(
  explosion, contact.point, rotation );
 Destroy( gameObject );
}

========================================================================================================================================================

Finally,
we
 want 
to 
make
 the 
missile 
disappear 
from 
the
 game 
as 
it
 has 
now 
collided,

which 
is
 done 
by 
calling 
the 
Destroy()
 function 
with 
gameObject 
as 
a 
parameter

(gameObject 
denotes 
the
 object 
the 
script 
is 
associated
 with)


=====================================================================================================================================================


Add 
the
 code 
into 
the 
Projectile
 Javascript
 and
 save 
it.
Attach
 the
 Projectile
 Javascript 
to 
the
 Missile
 prefab 
by 
selecting
 Component
­>

Scripts
­>
Projectile.
Now 
we 
have 
to
 create 
the 
explosion 
that
 we
 want 
to 
occur
 when ever
 the
 missile 
col­
lides.
First,
create 
a
 new 
Prefab
 (call 
it 
Explosion)
 that 
will 
store 
the 
explosion 
asset.
The
 standard
 assets 
contain 
a 
nice 
explosion 
prefab 
with 
a 
particle
 system 
and 
a

light 
around 
the 
explosion.
Drag 
the 
explosion 
prefab 
under 
Standard
Assets/
Particles/explosion
 into 
the 
Hierarchy
 View.
Adjust
 the 
settings 
on 
the 
explosion 
until 
you’re 
happy 
with 
how 
it 
looks,
then

drag
 the 
Explosion 
from
 the 
Hierarchy 
view 
on to 
the 
Explosion 
Prefab
 in 
the

Project
 panel.
Now
 we 
can 
assign 
the 
explosion 
to 
the 
missile:
Ensuring
 that 
Missile 
prefab 
is 
selected,
 fill
 in 
the 
Explosion 
variable 
by 
dragging

the 
Explosion 
object 
in
 the 
Project 
panel 
onto
 the 
Missile’s
 Explosion 
variable
 in

the
 Inspector 
panel


Unity FPS Shooter Game tutorial


First we create an empty object called Launcher and then make it as a child of Main Camera and attach the script below to it  and give launcher an object that will be a  launched missile which has  to be a rigid body.
========================================================================

Here 
is  
the  
full  
code
  to
  MissileLauncher.js:
var projectile : Rigidbody;
var speed = 20;
function Update()
{
 if( Input.GetButtonDown( "Fire1" ) )
  {
  var instantiatedProjectile : Rigidbody = Instantiate(
   projectile, transform.position, transform.rotation );
  instantiatedProjectile.velocity =
   transform.TransformDirection( Vector3( 0, 0, speed ) );
  Physics.IgnoreCollision( instantiatedProjectile. collider,
   transform.root.collider );
  }
}


Tuesday, June 28, 2011

Couple Dynamics

Useful online tools

  1. http://www.quickmockup.com/webapp/QMockup.html#
  2. https://www.dropbox.com
  3. http://www.sliderocket.com
  4. https://www.proposable.com
  5. http://www.freshbooks.com/
  6. http://www.box.net
  7. http://cacoo.com
  1. http://speckyboy.com/2010/01/11/10-completely-free-wireframe-and-mockup-applications/

    Instantiating Objects from an empty Game object



    here is the script for the idea=========================================================================================================================================================================================================================

    var object : Transform;




    function Update () {

    var theCloned : Transform;
    theCloned = Instantiate(object,
    transform.position, transform.rotation);




    }
    =============================================================================================================================================================================================================================

    But here it is instantiating many Cubes that what we will change in the next script


    Speed modeling for Cities in Games

     need to build a city level. With hi rise buildings, much of lites, etc. So, how is better to create buildings. To build each building in 3d tool, or create buildings from modules?

    Little description. Buildings will be very hi. Like in "Blade Runner" or "Johnny Mnemonic". This is cyberpunk style, so you can imagine size of level and buildings. In some of them player can enter, and walk throw...




    Idea#: I'd say write a script that generates the whole city from scratch. Mutch more interesting than spending hours building each building

    the script will be creating buildings that are primitive Game objects 
    ============================================================================================================================================================================
    Well, the fastest way, without using some sort of a script setup, is the block the whole city itself out with primative shapes, and then detail it down from there, you can decide what buildings are relevant enough that people will need to go inside them, and put interior stuff in those if thats how interactive it needs to be, otherwise just shape the outside of the city. By blocking it out first, you also insure the scale is how you want it
    =========================================================================================================================================================================================================================================================



    Getting animation to play all the way throughby pressing key once


    I am trying to get an animation to play through all the way but it doesn't. The code I am using is:
    function Update ()
     {
     if(Input.GetKeyDown("joystick button 2"))
     {
     animation.Play("HiroXAttack1");
     // name of the animation clip
     }
     }
    ======================================================================================================================================================

    I have to press the button repeatedly to play the entire animation through.
    I tried a different approach and did:
    var isAttacking = false;
    function Update ()
    {
     if(Input.GetKeyDown("joystick button 2"))
     {
    isAttacking = true;
     }
     if(isAttacking)
    {
    animation.Play("HiroXAttack1");
    }

    if(Input.anyKey == false)
    {
     isAttacking = false;
     animation.Stop();
    }
     }

    =======================================================================================================================================================================

    Your first code snippet should work, provided you have set your animation mode to Once, or Clamp, or ClampForever.
    function Update ()
    {
     if(Input.GetKeyDown("joystick button 2"))
     {
     animation.wrapMode = WrapMode.Once;
     animation.Play("HiroXAttack1");
    // name of the animation clip
     }
    }
    ==================================================================================================================================================

    There is also a solution if you want the animations to be on the same layer. To play a given animation without stopping other animations on the same layer, you need to not use Animation.Play but instead do:
    animation["MyOtherAnimation"].enabled = true;
    animation["MyOtherAnimation"].weight = 1;
     animation["MyOtherAnimation"].time = 0;
    ==================================================================================================================================================


    Lighting Idea=====> unity Game Idea

    just like strategy games and some other games all places are dark and once you explore them the lights are turned on and you can see part of the map

    =====================================================================================================================================================

    psuedo code
    ====================================================================
    function ontriggerenter()
    {

      light.enabled=true;

    }

    How to play an animation all the way through on a single key


    ======================================================================================================================================================


    var die1 : boolean;
    var die2 : boolean; 
    function Update() 
    {
     if (Input.GetKeyDown(KeyCode.Alpha1))
     { die1 = true; 
    die2 = false; 
    if (die1) 
    {
     animation.CrossFade("die1"); 
    animation.wrapMode = WrapMode.ClampForever; 
    if (Input.GetKeyDown(KeyCode.Alpha2)) 
    { die2 = true; die1 = false; }
     if (die2)
     { animation.CrossFade("die2"); 
    animation.wrapMode = WrapMode.ClampForever; }
     else { 
    animation.CrossFade("idle"); 
    animation.wrapMode = WrapMode.Loop;
     } 
    }

    ==================================================================================================================================================
    if (die1) 
    {
     if(animation.IsPlaying("die1"))
    { }
    else
    {
     animation.Play("die1"); 
    }
    ==================================================================================================================================================
    the above code can be used to get an animation to play out fully without stopping on a single key press and even when you press the key again it shouldn't play, just double check that my "IsPlaying" method is used correctly

    ====================================================================================================================================================================
    This seems to work just fine. Thank you all for your help.
    ==========================================================================================================================================================================================================================================================================================

    function Start() 
    animation["die1"].layer = 1; 
    animation["die2"].layer = 1;
     } 
    function Update() 
    if (Mathf.Abs(Input.GetAxis("Vertical")) > 0.2)
     { 
    animation.Stop("die1");
     animation.Stop("die2");
     if (Mathf.Abs(Input.GetAxis("Run")) > 0.2) 
    {
     animation.CrossFade("run"); } 
    else 
    animation.CrossFade("walk");
     } } 
    else if 
    (Input.GetButton("Fire1"))
     {
     animation.Stop("die1");
     animation.Stop("die2"); 
    animation["attack1"].wrapMode = WrapMode.Once; animation.Play("attack1"); 
    else if (Input.GetButton("Fire2")) 
    animation.Stop("die1");
     animation.Stop("die2");
     animation["attack2"].wrapMode = WrapMode.Once;
     animation.Play("attack2"); 

    else if (Input.GetKeyDown(KeyCode.Alpha1)) 
    animation["die1"].wrapMode = WrapMode.ClampForever; 
    animation.CrossFade("die1"); 
    else if (Input.GetKeyDown(KeyCode.Alpha2))
     {
     animation["die2"].wrapMode = WrapMode.ClampForever; animation.CrossFade("die2"); 
    } else { animation.CrossFade("idle"); 
    }
     }
    ===========================================================================================================================================================

    Play sound Once


    To play a sound once during Update() use a boolean variable or instantiate a GameObject with an AudioSource with the same settings.
    function Start() {
    soundplayed = false;
     }

    function Update ()
     {

     if (!soundplayed)
     {
      audio.PlayOneShot(blast);
      soundplayed = true;
     }
     ... }

    how to make a animation play only when I get into the range of that game object?

     i have a game object that is an enemy. I want its animation to play only when I get really close to it.(im controllled by a fps player controller in my game) 



    var rayCastLength = 5;
    function Update () { var hit : RaycastHit;
    //check if were in range... 
    if(
    Physics.Raycast(transform.position, transform.forward, hit, rayCastLength))
     { // ... 
    with the object if(hit.collider.gameObject.tag == "lift_door") 
    {
     //play the animation: hit.collider.gameObject.animation.Play("lift_door_open"); 
    }



    }

    Play animation and sound when GUI button is pressed



    I have a GUI button that I have created. When the button is pressed I would like a game object to play a certain animation and also play a sound.
    var lever : AudioClip;
    if (GUI.Button (Rect(510,150,80,20), "Lever"))
     {
     animation.Play ("lever1"); 
    audio.PlayOneShot(lever);
     }
    =====================================================================================================================================================================
    // Plays the default animation
    animation.Play();
    For a specific animation, you can call the animation with play as well.

    // Plays the walk animation - stops all other animations in the same layer
    animation.Play("walk");
    // Plays the walk animation - stops all other animations
    animation.Play("walk", PlayMode.StopAll);
    ====================================================================================================================================================================

    AudioSource.PlayOneShot  

    function PlayOneShot (clip : AudioClip, volumeScale : float = 1.0F) : void

    Description

    Plays an AudioClip.

    // Play impact audio clip when colliding with something
    var impact : AudioClip;
    function OnCollisionEnter () {
    audio.PlayOneShot(impact);
    }

    How to play entire animation?

    how can i play entire animation when i hit an object or just simply pushing a button



    For a button press


    if(Input.GetButton("blah")){ do something;


    or


    if(Input.GetKey("a")){ do something;


    OR

    function OnControllerColliderHit(hit : ControllerColliderHit) 
     var player = GameObject.FindWithTag("w");

     if (hit.gameObject.tag =="w")
    {
         player.animation.CrossFade("sit"); 
     }
     }

    GameObject.CreatePrimitive




    static function CreatePrimitive (type : PrimitiveType) : GameObject

    Description

    Creates a game object with a primitive mesh renderer and appropriate collider.

    // Create a plane, sphere and cube in the scene.

    function Start () {
    var plane : GameObject = GameObject.CreatePrimitive(PrimitiveType.Plane);

    var cube : GameObject = GameObject.CreatePrimitive(PrimitiveType.Cube);
    cube.transform.position = Vector3(0, 0.5, 0);

    var sphere : GameObject = GameObject.CreatePrimitive(PrimitiveType.Sphere);
    sphere.transform.position = Vector3(0, 1.5, 0);

    var capsule : GameObject = GameObject.CreatePrimitive(PrimitiveType.Capsule);
    capsule.transform.position = Vector3(2, 1, 0);

    var cylinder : GameObject = GameObject.CreatePrimitive(PrimitiveType.Cylinder);
    cylinder.transform.position = Vector3(-2, 1, 0);
    }

    Monday, June 27, 2011

    The decline of customer service

    And if you don't believe it, just try calling AT&T.

    beating-customer-service-robots-smartmoney: Personal Finance News from Yahoo! Finance



    Bookmark and Share

    GUI Button Tricks


    /* String Content example */

    function OnGUI () {
    GUI.Label (Rect (0,0,100,50), "This is the text string for a Label Control");
    }
    To display an image, declare a Texture2D public variable, and pass the variable name as the content argument like this:
    /* Texture2D Content example */

    var controlTexture : Texture2D;

    function OnGUI () {
    GUI.Label (Rect (0,0,100,50), controlTexture);
    }
    Here is an example closer to a real-world scenario:
    /* Button Content examples */

    var icon : Texture2D;

    function OnGUI () {
    if (GUI.Button (Rect (10,10, 100, 50), icon)) {
    print ("you clicked the icon");
    }

    if (GUI.Button (Rect (10,70, 100, 20), "This is text")) {
    print ("you clicked the text button");
    }
    }
    There is a third option which allows you to display images and text together in a GUI Control. You can provide a GUIContent object as the Content argument, and define the string and image to be displayed within the GUIContent.
    /* Using GUIContent to display an image and a string */

    var icon : Texture2D;

    function OnGUI () {
    GUI.Box (Rect (10,10,100,50), GUIContent("This is text", icon));
    }
    You can also define a Tooltip in the GUIContent, and display it elsewhere in the GUI when the mouse hovers over it.
    /* Using GUIContent to display a tooltip */

    function OnGUI () {
    // This line feeds "This is the tooltip" into GUI.tooltip
    GUI.Button (Rect (10,10,100,20), GUIContent ("Click me", "This is the tooltip"));
    // This line reads and displays the contents of GUI.tooltip
    GUI.Label (Rect (10,40,100,20), GUI.tooltip);
    }
    If you're daring you can also use GUIContent to display a string, an icon, and a tooltip!
    /* Using GUIContent to display an image, a string, and a tooltip */

    var icon : Texture2D;

    function OnGUI () {
    GUI.Button (Rect (10,10,100,20), GUIContent ("Click me", icon, "This is the tooltip"));
    GUI.Label (Rect (10,40,100,20), GUI.tooltip);
    }

    Random.Range (Random Variables)

    Idea instantiating random fireworks in random places
    =======================================================================================================================================================

    Random.Range  

    static function Range (min : float, max : float) : float

    Description

    Returns a random float number between and min [inclusive] and max [inclusive] (Read Only).
    JavaScript
    // Instantiates prefab somewhere between -10 and 10 on the x-z plane
    var prefab : GameObject;
    function Start () {
    var position = Vector3(Random.Range(-10, 10), 0, Random.Range(-10, 10));
    Instantiate(prefab, position, Quaternion.identity);
    }

    static function Range (min : int, max : int) : int

    Description

    Returns a random integer number between min [inclusive] and max [exclusive] (Read Only).
    If max equals minmin will be returned. The returned value will never be max unless min equals max.

    // Loads a random level from the level list

    Application.LoadLevel(Random.Range(0, Application.levelCount));

    Transform.LookAt (idea AI bots looking at player and shooting)

    ======================================================================================================================================================
    // This complete script can be attached to a camera to make it
    // continuously point at another object.

    // The target variable shows up as a property in the inspector.
    // Drag another object onto it to make the camera look at it.
    var target : Transform;

    // Rotate the camera every frame so it keeps looking at the target
    function Update() {
    transform.LookAt(target);
    }

    ==================================================================================================================================================
    // Point the object at the world origin
    transform.LookAt(Vector3.zero);