Skip to content

Instantly share code, notes, and snippets.

@TheCuttlefish
TheCuttlefish / RotateBody.cs
Created November 10, 2020 14:30
Swing mechanic
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RotateBody : MonoBehaviour
{
// Start is called before the first frame update
float zRotation;
@TheCuttlefish
TheCuttlefish / MouseInput.cs
Created November 9, 2020 17:49
Mouse input with delay (lerp)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MouseInput : MonoBehaviour
{
Vector3 mousePos;
Vector3 offset = new Vector3(0, 0, 10);
float xDistance;
@TheCuttlefish
TheCuttlefish / Example.cs
Created November 9, 2020 16:15
If statements and Switch statement
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Example : MonoBehaviour
{
public string day = "Monday";
void Start()
@TheCuttlefish
TheCuttlefish / code-challenge-2020-3d-social-media-button.markdown
Created November 8, 2020 21:08
Code Challenge 2020 || 3D Social Media Button
@TheCuttlefish
TheCuttlefish / MyInput.cs
Created November 5, 2020 14:09
Input colour transition
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MyInput : MonoBehaviour
{
public float colourTransitoin = 0;
[Range (0.0001f, 1f)]
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class StatesExample : MonoBehaviour
{
public enum lightState { on, off};
public lightState currentLightState;
@TheCuttlefish
TheCuttlefish / Demo.cs
Created October 30, 2020 17:39
Interactive thing (Changing position/rotation/scale)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Demo : MonoBehaviour
{
Vector3 mousePos;
@TheCuttlefish
TheCuttlefish / Demo.cs
Created October 30, 2020 15:34
Shapes reacting to mouse position
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Demo : MonoBehaviour
{
Vector3 mousePos;
@TheCuttlefish
TheCuttlefish / CamMovement.cs
Created October 29, 2020 14:21
Camera Movement
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CamMovement : MonoBehaviour
{
bool mouseDown = false;
Vector3 currentMousePos;
@TheCuttlefish
TheCuttlefish / LSystem.cs
Created October 6, 2020 02:50
Lsystem example
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LSystem : MonoBehaviour
{
private string axiom = "AA";
private string rule1 = "B"; // A -> B
private string rule2 = "AB"; // B -> AB
private int index; // character index