Translate Java into C# script, with minor adjusments
£30-60 GBP
Completed
Posted almost 9 years ago
£30-60 GBP
Paid on delivery
I have a small project which I would like to have translated into C#
Description;
It is a Selection Script that allows User to hover (mouse over), and Click on some object in order to select it.
When User Hover with mouse over some object, a name of that object gets displayed (ObjectTitle). When User clicks on that object, another object is spawned (called ObjectSelection) as a visual reference, that Object/Unit has been selected.
Now once Object has been selected we can hit a space bar and delete that object.
Instructions;
-I have this Selection script written in Java script, and it works perfectly but I need it in C sharp.
It is a small one A4 page of text....
- I would like also to add some extra features....
A. I need Objects title to always face camera...
In current script Objects title is always facing in Z direction or whatever was set as front, so if we rotate camera 180 degree and view this object from behind then hover over it, Object's name will be displayed in reverse like mirror image because it is viewed from behind.
I need it Objects title to always face camera like 2d Sprite
Here is the Script;
#pragma strict
var Highlight_00 : Material;
var Title_Name : String = "?";
private var Title_ColorInitial : Color = Color(1.0, 1.0, 1.0, 1.0);
private var Title_ColorFaded : Color = Color(0.0, 0.0, 0.0, 0.0);
private var Title_EnabledByMouse : boolean = false;
private var Title_EnabledByKey : boolean = false;
private var myTransform_Main : Transform;
private var myTransform_Title : Transform;
private var myTransform_Selection : Transform;
function Awake ()
{
myTransform_Main = transform;
myTransform_Title = [login to view URL]("ObjectTitle");
myTransform_Selection = [login to view URL]("ObjectSelection");
myTransform_Title.GetComponent.<Renderer>().[login to view URL] = Title_ColorFaded;
myTransform_Selection.GetComponent.<Renderer>().enabled = false;
myTransform_Selection.GetComponent.<Renderer>().material = Highlight_00;
}
function Update ()
{
if([login to view URL](0))
{
myTransform_Selection.GetComponent.<Renderer>().enabled = false;
}
/* TO ENABLE THIS, ASSIGN ALT KEY BY NAME "ShowNamesTest"
if ([login to view URL] ("ShowNamesTest"))
{
Title_EnabledByKey = true;
Custom_TitleEnable();
}
if ([login to view URL] ("ShowNamesTest"))
{
Title_EnabledByKey = false;
Custom_TitleDisable();
}
*/
if(myTransform_Selection.GetComponent.<Renderer>().enabled == true)
{
[login to view URL](Vector3(0,1,0), [login to view URL]*15);
if ([login to view URL] ("space"))
{
print ("space key was pressed");
Destroy (gameObject);
}
}
}
function OnMouseEnter ()
{
Title_EnabledByMouse = true;
Custom_TitleEnable();
}
function OnMouseExit ()
{
Title_EnabledByMouse = false;
if(Title_EnabledByKey == true)
{
return;
}
Custom_TitleDisable();
}
function Custom_TitleDisable ()
{
for (var a = 0.0; a < 0.5; a += [login to view URL])
{
if(Title_EnabledByMouse == true || Title_EnabledByKey == true)
{
return;
}
else
{
myTransform_Title.GetComponent.<Renderer>().[login to view URL] = [login to view URL] (Title_ColorInitial, Title_ColorFaded, a/0.5);
yield;
}
}
}
function Custom_TitleEnable ()
{
myTransform_Title.GetComponent.<Renderer>().[login to view URL] = Title_ColorInitial;
}
function OnMouseDown()
{
yield;
myTransform_Selection.GetComponent.<Renderer>().enabled = true;
}
Hello sir. I have 5 years of game programming experience and more than 2 working on unity. I've done a lot of translation of js scripts into c# so I will do it in a few hours. The other issue can be fixed with a simple validation of the camera's position. Please contact me if you're interested in my offer.
£100 GBP in 1 day
5.0 (19 reviews)
5.6
5.6
9 freelancers are bidding on average £77 GBP for this job
We are very interested in this project. I have read your above description and i think its well within our range to execute this is in a good time frame so would you be kind enough to message me so we can have a fast and understanding agreement.
Hello i can do this for you if you want to. Just send me a private message so we can discuss it if you want to. I have already build two smaller games in unity with c# so i think i can manage this as well