Found some scripts I want to use but they’re all in js and my entire project is C#.
Only one I am not sure of is this one for the crosshair.
If anyone could help please it would be great.
@script ExecuteInEditMode()
var crosshair : Texture2D;
function OnGUI () {
var w = crosshair.width/2;
var h = crosshair.height/2;
position = Rect((Screen.width - w)/2,(Screen.height - h )/2, w, h);
if (!Input.GetButton ("Fire2")) {
GUI.DrawTexture(position, crosshair);
}
}
Only one part that I am not really sure what to do with is the 2 vars in the OnGUI function.
function OnGUI () {
var w = crosshair.width/2;
var h = crosshair.height/2;
Not sure what to call them in C#.