ZoeRobotIngles/Assets/Scripts/Conversation/Click.cs

31 lines
677 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Click : MonoBehaviour
{
public Conversation conversation;
SpriteRenderer thisRenderer;
public Sprite click, not;
// Start is called before the first frame update
void Start()
{
conversation = GameObject.Find("Control").GetComponent<Conversation>();
thisRenderer = GetComponent<SpriteRenderer>();
}
private void OnMouseDown()
{
conversation.StartRecording();
thisRenderer.sprite = click;
}
private void OnMouseUp()
{
conversation.StopRecording();
thisRenderer.sprite = not;
}
}