RightClick And LeftClick Event !

i have 2script for modify an object in game.
One of the things I need to click on the left and one right-click on the put.
one of scripts is C# and other is Java.
i write script with java for this event , but one of script is java and i can’t put C# script in Java.
can i link C# script in Java ?
and how can i write an script with java for this event’s and link 2scripts at this ?

thank’s soooo much :smile:

sry about my english :slight_smile:

what is the script? it is easy to convert c# to java or vice versa

tnx carson:)

how can i translate C# to Java ?

mostly the variables are different.

for example:

c#:
private bool notTrue = false;
public int nine = 9;

javascript:
private var notTrue = false;
public var nine = 9;

i write this sample for here , plz see it and say to me problem’s !
with left and right click must change object material.but not work :frowning: :face_with_spiral_eyes:
with no error.

var materialA : Material;
var materialB : Material;
var materialC : Material;
private var stause : int = 0;
var e : Event = Event.current;

function OnMouseDown()
{

	if(e.button == 0  e.isMouse)
	{
		if(stause == 0)
		{
			renderer.material = materialA;
			stause = 1;
		}
		else
		if(stause ==1)
		{
			renderer.material = materialB;
			stause = 2;
		}
		else
		if(stause ==2)
		{
			renderer.material = materialC;
			stause = 0;
		}
	}
	else 
	if(e.button == 1  e.isMouse)
	{
		if(stause == 0)
		{
			renderer.material = materialA;
			stause = 1;
		}
		else
		if(stause ==1)
		{
			renderer.material = materialB;
			stause = 2;
		}
		else
		if(stause ==2)
		{
			renderer.material = materialC;
			stause = 0;
		}
	}
}

Try using
if (Input.getMouseButtonDown(0)) {

and
if (Input.getMouseButtonDown(1)) {

thank’s.
this might use at Function Update , but i use OnMouseDown !

Who can help fix this code?