Skip to content

Instantly share code, notes, and snippets.

@manuelborst
manuelborst / playerMovementSphere.cs
Last active August 3, 2021 09:48
Player Movement Sphere
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class playerScript : MonoBehaviour
{
public float speed = 20F;
Rigidbody rigidbody;
// Start is called before the first frame update
Mensch mensch1 = new Mensch(12, "Juri", "Schüler");
Mensch mensch2 = new Mensch(25, "Carla", "Studentin");
mensch1.meinJob();
mensch2.meinJob();
} // End of start
@manuelborst
manuelborst / basics.cs
Last active August 2, 2021 16:13
Alle Basics
lebensEnergie = 11;
Debug.Log("Die Figur hat noch: " + lebensEnergie + " Lebensenergie.");
Debug.Log(myString);
Debug.Log("Das Ergebnis ist: " + addition(15, lebensEnergie));
//Arithmetische Operatoren
int a = 8;
int b = 3;
int c;
@manuelborst
manuelborst / dragAndDrop.js
Created August 2, 2021 16:05
Drag and Drop JS
const empty = document.querySelectorAll(".empty");
const drag = document.querySelector(".drag");
drag.addEventListener("dragstart", dragStart);
drag.addEventListener("dragend", dragEnd);
// requestAnimationFrame - подменяет стиль на прозрачный. работает с частотой 60fps
function dragStart(event) {
console.log("start");
this.style.backgroundColor = "green";
@manuelborst
manuelborst / dragAndDrop.pde
Created August 2, 2021 16:03
Drag and Drop Processing
/**
* Mouse Functions.
*
* Click on the box and drag it across the screen.
*/
float bx;
float by;
int boxSize = 75;
boolean overBox = false;
@manuelborst
manuelborst / DragTransform.cs
Created August 2, 2021 15:55
Drag and Drop 3D
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
class DragTransform : MonoBehaviour
{
private Color mouseOverColor = Color.blue;
private Color originalColor = Color.yellow;
private bool dragging = false;