public var blip : Texture; //代表角色
public var blip_other : Texture;//敌人
public var radarBG : Texture; //地图背景图片
public var centerObject : Transform; //角色位置
public var mapScale = 0.6; //地图缩放
public var mapCenter = Vector2(50,50); //地图中心
function OnGUI () {
bX=centerObject.position.x * mapScale;
bY=centerObject.position.z * mapScale;
GUI.DrawTexture(Rect(mapCenter.x -50,mapCenter.y - 50,100,100),radarBG);
GUI.DrawTexture(Rect(mapCenter.x,mapCenter.y,4,4),blip);
DrawBlipsForEnemies();
}
function DrawBlipsForCows(){
var gos : GameObject[];
gos = GameObject.FindGameObjectsWithTag("Cow");
var distance = Mathf.Infinity;
var position = transform.position;
for (var go : GameObject in gos) {
drawBlip(go,blip);
}
}
function drawBlip(go,aTexture){