Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class Cell : MonoBehaviour {
- SpriteRenderer image;
- int value;
- public Game game;
- public Vector2Int position;
- void Start() {
- image = GetComponent<SpriteRenderer>();
- }
- public int GetValue() {
- return value;
- }
- public void SetValue(int newValue) {
- value = newValue;
- if (newValue == 0) {
- image.color = Color.white;
- } else if (newValue == -1) {
- image.color = Color.blue;
- } else if (newValue == 1) {
- image.color = Color.red;
- }
- }
- void OnMouseDown() {
- game.Click(position);
- }
- }
Add Comment
Please, Sign In to add comment