Skip to content

Instantly share code, notes, and snippets.

View CodingDino's full-sized avatar

Sarah Herzog CodingDino

View GitHub Profile
@CodingDino
CodingDino / 01_05_Jiyambi_Valley_of_Trials.lua
Created July 5, 2011 01:35
WoW-Pro Leveling Addon File: Durotar, Valley of Trials, Orc - update
-- URL: http://wow-pro.com/wiki/source_code_durotar
-- Date: 2011-06-25 01:32
-- Who: Crackerhead22
-- Log: ! Missing A step for step T qid 24721 - 24712 is wrong QID, fixed to 24751
-- URL: http://wow-pro.com/node/3199/revisions/24536/view
-- Date: 2011-06-08 23:20
-- Who: Fluclo
-- Log: Shouldn't be a need to grind in Cataclysm, so tweaked to remove any grinding.
@CodingDino
CodingDino / Main.cpp
Created July 4, 2018 06:07
3.4.4 - Number Guessing
// Include the library we need to print stuff
#include <iostream>
// Include the library we need to generate random numbers
#include <stdlib.h>
// Include the library we need to get the current time
#include <time.h>
// The start of our main() function, starting point of the program
int main()
// curly bracket that starts the main() function.
@CodingDino
CodingDino / ClickToMove.cs
Last active April 24, 2024 11:09
Unity script with simple click-to-move functionality
using UnityEngine;
// This script assumes the player will have a Rigidbody2D attached
// and it won't work without it
// This line enforces that the object have a Rigidbody2D in the
// Unity editor
[RequireComponent(typeof(Rigidbody2D))]
public class ClickToMove : MonoBehaviour
{
// ------------------------------------------------
@CodingDino
CodingDino / HeldButton.cs
Created March 18, 2020 09:45
Unity script to convert a normal Unity UI Button to respond to being held down rather than just clicked
using UnityEngine;
using UnityEngine.UI; // Required when referring to the Button component
using UnityEngine.EventSystems; // Required when using Event data.
// This line means that this script can only be attached to
// a GameObject that has a Button component on it
[RequireComponent(typeof(Button))]
// The additional things in this list (IPointerDownHandler etc) let us
// respond to more mouse / touch events happening to this object
public class HeldButton : MonoBehaviour, IPointerDownHandler, IPointerUpHandler, IPointerExitHandler
@CodingDino
CodingDino / PlayerAnimation.cs
Created March 24, 2020 16:22
Example Unity script for setting a player's animation parameters based on their physics velocity.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerAnimation : MonoBehaviour
{
// Called once per frame
public void Update()
{
// Get the rigidbody from our player so we can check its speed
@CodingDino
CodingDino / ConditionDestroy.cs
Created March 25, 2020 11:53
A Unity Playground condition script to trigger Actions when an object is destroyed.
using UnityEngine;
using System.Collections;
using UnityEngine.Events;
[AddComponentMenu("Playground/Conditions/Condition Destroy")]
public class ConditionDestroy : ConditionBase
{
// This function will be called by Unity when the object is destroyed
void OnDestroy()
@CodingDino
CodingDino / PlayerJump.cs
Last active March 19, 2023 22:21
A Unity script allowing a character to jump when the Jump() function is called, for example from an on-screen control or another script.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// NOTE: Make sure your ground has the "Ground" tag (or whatever custom tag you set it to)
// NOTE: You may need to change your player's Rigidbody settings to Sleeping Mode: Never Sleep
public class PlayerJump : MonoBehaviour
{
// An editor variable to control how much upward force the player gets when they jump
// Larger numbers means higher jumps
@CodingDino
CodingDino / AudioExample.cs
Created March 25, 2020 14:36
A Unity script showing an example of how to play audio.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AudioExample : MonoBehaviour
{
// Variable to hold the Audio Clip that should play
public AudioClip audioToPlay;
// This function will be called by a button on screen
@CodingDino
CodingDino / ConditionDestroyInspector.cs
Created March 26, 2020 16:09
Inspector script for the ConditionDestroy expansion to Unity Playground
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
[CanEditMultipleObjects]
[CustomEditor(typeof(ConditionDestroy))]
public class ConditionDestroyInspector : ConditionInspectorBase
{
private string explanation = "Use this script to perform an action when this GameObject is destroyed.";
@CodingDino
CodingDino / UIScript.cs
Created March 30, 2020 14:12
Updates to Unity Playground UI script (and inspector) to allow hearts for health display and to allow separate win / loss scenes
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
[AddComponentMenu("")]
public class UIScript : MonoBehaviour
{