multiply shootforce by fire1 button held?
By: a guest | Mar 19th, 2010 | Syntax:
JavaScript | Size: 0.77 KB | Hits: 81 | Expires: Never
var crosshairTexture : Texture2D;
var weaponSelect : Texture2D;
var position : Rect;
var position_Select : Rect;
function Start ()
{
position = Rect( ( Screen.width - crosshairTexture.width ) / 2, ( Screen.height - crosshairTexture.height ) / 2, crosshairTexture.width, crosshairTexture.height );
position_Select = Rect( ( Screen.width - weaponSelect.width ) / 2, ( Screen.height - weaponSelect.height ) / 2, weaponSelect.width, weaponSelect.height );
}
function OnGUI() // Switch crosshair Texture based on Fire2 down/up state?
{
if (Input.GetButtonDown("Fire2"))
{
if (position == crosshairTexture)
{
GUI.DrawTexture( position_Select, weaponSelect );
}
else
{
GUI.DrawTexture( position, crosshairTexture );
}
}
}