ZoeAppClass/Assets/Scripts/Conversation/Click.cs

48 lines
921 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
public class Click : MonoBehaviour
{
public Conversation conversation;
Image thisRenderer;
public Sprite click, not;
// Start is called before the first frame update
void Start()
{
conversation = GetComponentInParent<Conversation>();
thisRenderer = GetComponent<Image>();
}
private void OnMouseDown()
{
conversation.StartRecording();
thisRenderer.sprite = click;
}
public void StartRecord() {
conversation.StartRecording();
}
public void StopRecord()
{
conversation.StopRecording();
}
private void OnMouseUp()
{
conversation.StopRecording();
thisRenderer.sprite = not;
}
private void OnMouseOver()
{
Debug.Log("A");
}
}