MouseDown event of OTSprite.

Hello I’m user of Orthello framework.
How can I get MouseDownEvent of OTSprite???
Is onInput good enough to recognize mouse-down or mouse-up?:face_with_spiral_eyes:

OTSprite spSp = OT.CreateObject(OTObjectType.Sprite).GetComponent<OTSprite>();
spSp.registerInput = true;
spSp.onInput = onInput;
OTSprite otSp = OT.CreateObject(OTObjectType.Sprite).GetComponent<OTSprite>();
otSp.gameObject.AddComponent("ButtonBehaviourScript");

I create a ButtonBehaviourScript extended MonoBehaviour and addtoOTSprite.gameObject.

public class ButtonBehaviourScript :MonoBehaviour{
	void OnMouseDown()
    {
    	Debug.Log("OnMouseDown");
		Debug.Log (this);
    }
    
    void OnMouseUp()
    {
    	Debug.Log("OnMouseUp");
    }
}

Way to post in the wrong section bro.

1 Like