#pragma strict
var b1 : int = 2;
var hp : int = 60;
var flas : Transform;
var sw : Transform;
var mech : GameObject;
var swo : boolean=false;
var flasm : GameObject;
function Start () {
}
function Update () {
if( Input.GetKeyDown(KeyCode.F) )
{
if (b1>0)
{
if (hp<100)
{
b1=(b1-1);
hp=(hp+20);
}
}
if (hp>100){
hp=100;
}
}
var dist = Vector3.Distance(flas.position, transform.position);
print ("Distance to other: " + dist);
if( Input.GetKeyDown(KeyCode.G))
{
if (flasm.active==true)
{
if (dist>2)
{
flasm.active=false;
b1=(b1+1);
}
}
}
var dists = Vector3.Distance(sw.position, transform.position);
if( Input.GetKeyDown(KeyCode.Q))
{
if (dists<4)
{
mech.active=false;
}
}
}
}
function OnGUI () {
GUI.Label ( Rect (10, 50, 100, 20), "Фласки "+b1);
GUI.Label ( Rect (10,10,100,20), "Здоровье "+hp);
}