The code works by clicking my guitexture I zoom, but I would want “to combine” the functions MouseDown and function Update.
As long as I remain rested with the mouse ( MouseDown), I would want that the zoom changes but this function works only with UpDate.
How to combine(organize) 2 in OnMouseDown?
test.cs
using UnityEngine;
using System.Collections;
public class test : MonoBehaviour {
public Camera cam ;
public Texture2D normaleTextureVert ;
public Texture2D rollOverTextureJaune ;
public Texture2D clicTextureRouge ;
public void OnMouseEnter ()
{
guiTexture.texture = rollOverTextureJaune;
}
public void OnMouseExit ()
{
guiTexture.texture = normaleTextureVert;
}
public void OnMouseDown ()
{
guiTexture.texture = clicTextureRouge;
cam.orthographicSize -= .05f;
}
public void UpDate ()
{
// cam.orthographicSize -= .05f; here change cam.orthographicSize on dynamic ???????????
}
}