Hello.
So, i’m making a application for Android and i use MouseUp, MouseEnter and MouseExit, to change the color of the text and open a new screen and url. So my question is, this functions work on android?
Because i tested on a Android Simulator for PC and worked but i don’t tested on my phone because it’s broken, so can someone tell me if this functions works for android. If don’t work, say to me the function that work.
Code to enter on a new screen:
var isQuit=false;
function OnMouseEnter(){
renderer.material.color=Color.red;
}
function OnMouseExit(){
renderer.material.color=Color.white;
}
function OnMouseUp(){
if (isQuit==true) {
Application.Quit();
}
else {
Application.LoadLevel(1);
}
}
function Update(){
if (Input.GetKey(KeyCode.Escape)) {
Application.Quit();
}
}
Code to enter on a website:
var isQuit=false;
function OnMouseEnter(){
renderer.material.color=Color.red;
}
function OnMouseExit(){
renderer.material.color=Color.white;
}
function OnMouseUp(){
if (isQuit==true) {
Application.Quit();
}
else {
Application.OpenURL ("url");
}
}
You are welcome ( : And also, it will work, but it may hit your performance a bit. Check [this question][1] to see why. [1]: http://answers.unity3d.com/questions/1064394/onmousedown-and-mobile.html
– Datapaxthe actual name of the file must match the class. looks like you named the file of the script "size" but pasted in the code above which starts out " public class Test : MonoBehaviour". either rename the script to Test or change the code to " public class size : MonoBehaviour"
– shadowpuppetHello there As ShadowPuppet said, in this case you need your class name to match the file's (script's) name. Either rename the file to "Test" (not recommended), or rename the class from "Test" to something else. In your case, I believe it would be size? I would recommend renaming it to something more intuitive, like "Scaler" or "Resizer". Best of luck to you! ~LegendBacon
– Legend_Bacon