This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class PaintCanvas : MonoBehaviour | |
{ | |
public static Texture2D Texture { get; private set; } | |
public static byte[] GetAllTextureData() | |
{ | |
return Texture.GetRawTextureData(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.Networking; | |
public class PlayerColor : NetworkBehaviour | |
{ | |
[SyncVar] | |
public Color color = Color.white; | |
private void Update() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using System.Linq; | |
using System.Xml.Serialization; | |
using UnityEngine; | |
public class QuestionCollection : MonoBehaviour | |
{ | |
private QuizQuestion[] allQuestions; | |
private void Awake() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class QuizQuestion | |
{ | |
public string Question { get; set; } | |
public string[] Answers { get; set; } | |
public int CorrectAnswer { get; set; } | |
public bool Asked { get; set; } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using UnityEngine; | |
public class QuizController : MonoBehaviour | |
{ | |
private QuestionCollection questionCollection; | |
private QuizQuestion currentQuestion; | |
private UIController uiController; | |
[SerializeField] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq; | |
using UnityEngine; | |
public class QuestionCollection : MonoBehaviour | |
{ | |
private QuizQuestion[] allQuestions; | |
private void Awake() | |
{ | |
LoadAllQuestions(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEngine; | |
[CreateAssetMenuAttribute] | |
public class QuizQuestion : ScriptableObject | |
{ | |
[SerializeField] | |
private string question; | |
[SerializeField] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class UIController : MonoBehaviour | |
{ | |
[SerializeField] | |
private Text questionText; | |
[SerializeField] | |
private Button[] answerButtons; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class JetpackBasic : MonoBehaviour | |
{ | |
private Rigidbody body; | |
private SteamVR_TrackedController controller; | |
[SerializeField] | |
private float thrustMultipler = 14f; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.Serialization; | |
public class ExampleScript : MonoBehaviour | |
{ | |
[SerializeField] | |
[FormerlySerializedAs("floatValue")] | |
private float floatValueRenamed; | |
[SerializeField] |