Skip to content

Instantly share code, notes, and snippets.

@jimu
jimu / RecieveBlock.cs
Created August 10, 2020 06:36
Debugging for kayra yorulmaz
public void OnDrop(PointerEventData Block)
{
Debug("Block.pointerDrag=" + (Block.pointerDrag == null ? "NULL" : "NOT-NULL") +
", Block.pointerDrag.tag='" + Block.pointerDrag.tag +
"', gameObject.tag='" + gameObject.tag + "'");
if (Block.pointerDrag != null && Block.pointerDrag.tag == gameObject.tag)
{
Block.pointerDrag.GetComponent<RectTransform>().anchoredPosition = GetComponent<RectTransform>().anchoredPosition;
DragDrop.isInSpace = true;
@jimu
jimu / PlayerController.cs
Created July 30, 2020 23:46
Code for Jonathan Zheng
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
private Rigidbody playerRb;
public float jumpForce;
@jimu
jimu / CameraSwitch.cs
Created July 30, 2020 23:06
Camera code for Trevor Speed
void Update()
{
If (Input.GetKeyDown(KeyCode.C))
{
cameras[cameraIndex].SetActive(false);
cameraIndex = (cameraIndex + 1) % cameras.Length;
cameras[cameraIndex].SetActive(true);
}
}
@jimu
jimu / gist:f91994443e2d3c1028b54504be1fe16e
Created July 30, 2020 23:05
Unity Code for Trevor Speed
void Update()
{
If (Input.GetKeyDown(KeyCode.C))
{
cameras[cameraIndex].SetActive(false);
cameraIndex = (cameraIndex + 1) % cameras.Length;
cameras[cameraIndex].SetActive(true);
}
}
@jimu
jimu / GameManager.cs
Created July 27, 2020 08:53
Igor Kheison
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameManager : MonoBehaviour
{
public ParticleSystem dirtParticle;
void Update()
{
@jimu
jimu / Spawner.cs
Created July 25, 2020 05:21
Code sample for Virgil Simpelo from the Create with Code Live Group Forum
public class Spawner : MonoBehaviour
{
[SerializeField] private float minDelay = 1.0f;
[SerializeField] private float maxDelay = 5.0f;
[SerializeField] private GameObject houndPrefab;
private bool isGameRunning;
// Flags the game as running and queues the first hound
void Start()