Skip to content

Instantly share code, notes, and snippets.

View codehoose's full-sized avatar

Sloan Kelly codehoose

View GitHub Profile
@codehoose
codehoose / SaveDropdownValue.cs
Created July 15, 2018 19:28
Code from the video https://youtu.be/3NzNIsJO2Hs. Saves the dropdown's selected item to playerprefs & reloads the value when the game restarts.
[RequireComponent(typeof(Dropdown))]
public class SaveDropdownValue : MonoBehaviour
{
const string PrefName = "optionvalue";
private Dropdown _dropdown;
void Awake()
{
_dropdown = GetComponent<Dropdown>();
using System.Collections;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
public class CountdownController : MonoBehaviour
{
public int seconds = 10;
public Text countdown;
using System;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using UnityEngine.UI;
[RequireComponent(typeof(Slider))]
public class SliderMenu : MonoBehaviour
{
Slider _slider;
[Serializable]
public class MyComponentData
{
public Vector3 pos;
public string name;
}
public class MyComponent : MonoBehaviour
{