Mini-Games-Game/Assets/Scripts/Colours.cs
Santi bfee0439de Unity: Created the first part of a minigame with pickup objects
Script for comparing materials for possible minigame. Made prototype layout for this minigame
2024-04-30 19:45:02 +01:00

30 lines
645 B
C#

using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
public class Colours : MonoBehaviour
{
public bool done = false;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnTriggerEnter(Collider other)
{
if(other.gameObject.GetComponent<Renderer>().material.name == gameObject.GetComponentInParent<Renderer>().material.name && !done)
{
Debug.Log("YUM! Red is my favourite colour!");
done = true;
}
}
}