Added unity project with examples for bezier curves & Game Of Life

This commit is contained in:
2026-05-19 18:40:06 +02:00
parent 79216f0ee1
commit 9ff1ff5d81
152 changed files with 70513 additions and 0 deletions
@@ -0,0 +1,36 @@
using UnityEngine;
using UnityEngine.EventSystems;
namespace DefaultNamespace.GameOfLife
{
[RequireComponent(typeof(MeshRenderer))]
public class Cell : MonoBehaviour, IPointerClickHandler
{
[SerializeField] private Material _aliveMaterial;
[SerializeField] private Material _deadMaterial;
private bool _isAlive;
public bool IsAlive
{
get => _isAlive;
set
{
_isAlive = value;
_meshRenderer.material = value ? _aliveMaterial : _deadMaterial;
}
}
private MeshRenderer _meshRenderer;
private void Awake()
{
_meshRenderer = GetComponent<MeshRenderer>();
IsAlive = false;
}
public void OnPointerClick(PointerEventData eventData)
{
IsAlive = !IsAlive;
}
}
}