- Home /
Please translate short script to Java from C#?
I'm new to Unity and scripting.. I truly appreciate the help.
using UnityEngine;
public class minimapcee : MonoBehaviour {
public RenderTexture MiniMapTexture;
public Material MiniMapMaterial;
private float offset;
void Awake()
{
offset = 10;
}
void OnGUI()
{
if(Event.current.type == EventType.Repaint)
Graphics.DrawTexture(new Rect(Screen.width - 256 - offset, 256 + offset, 256, 256), MiniMapTexture, MiniMapMaterial);
}
}
This is a knowledge base, not a sweat shop. Someone nice will probably do it but it's not what the site is for.
You should be trying to do it yourself and asking for help when you get stuck etc. If you don't know enough to try, then you need to start somewhere smaller, do tutorials and build your way up.
Here's some links I found useful in converting between C# and JS :
http://answers.unity3d.com/questions/12911/what-are-the-syntax-differences-in-c-and-javascrip.html
Answer by loihb · Sep 04, 2012 at 07:33 PM
class minimapcee extends MonoBehaviour {
public var MiniMapTexture : RenderTexture;
public var MiniMapMaterial : Material;
private var offset : float;
function Awake() {
offset = 10;
}
function OnGUI() {
if (Event.current.type == EventType.Repaint)
Graphics.DrawTexture(new Rect(Screen.width - 256 - offset, 256 + offset, 256, 256), MiniMapTexture, MiniMapMaterial);
}
}
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
I need help instantiateing a bullet 0 Answers
Have null errors 1 Answer
How to get around adding loads of "if" commands in my script 2 Answers