add slides for complex algorithms

add unity project for complex algorithms
add example for bezier curves
add example for game of life
This commit is contained in:
2025-05-13 14:23:35 +02:00
parent 954abad662
commit 8f15627bc1
154 changed files with 70872 additions and 0 deletions
@@ -0,0 +1,38 @@
using System;
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 = false;
public bool IsAlive
{
get => _isAlive;
set
{
_isAlive = value;
_meshRenderer.material = _isAlive ? _aliveMaterial : _deadMaterial;
}
}
private MeshRenderer _meshRenderer;
private void Awake()
{
_meshRenderer = GetComponent<MeshRenderer>();
IsAlive = false;
}
public void OnPointerClick(PointerEventData eventData)
{
IsAlive = !IsAlive;
}
}
}