Skip to content

Instantly share code, notes, and snippets.

View ttruty's full-sized avatar

Timothy Truty ttruty

View GitHub Profile
@ttruty
ttruty / gist:e2f4632754843787b417695bcd9159d5
Created June 4, 2024 22:25
Arrange pile of cards in Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CardManager : MonoBehaviour
{
[SerializeField] private GameObject cardPrefab;
[SerializeField] private int numberOfCards = 10;
[SerializeField] private float stackSpacing = 0.2f; // Adjust to control spacing between cards
[SerializeField] private Vector2 stackPosition = new Vector2(0, -3); // Bottom of the screen
@ttruty
ttruty / SwingingArmMotion.cs
Created January 9, 2023 22:13
Arm swinging locomotion for VR in Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SwingingArmMotion : MonoBehaviour
{
// Game Objects
[SerializeField] private GameObject LeftHand;
[SerializeField] private GameObject RightHand;
[SerializeField] private GameObject MainCamera;
# Test if a number is prime
def is_prime(x):
for n in range(2, x - 1):
if x % n == 0:
return False
else:
return True
# test # print is_prime(17)