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.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 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
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.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
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 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; | |
public class ColorPicker : MonoBehaviour | |
{ | |
public static Color SelectedColor { get; private set; } | |
[SerializeField] | |
private Renderer selectedColorPreview; | |
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 UnityEngine; | |
using UnityEngine.Networking; | |
public class PlayerBrush : NetworkBehaviour | |
{ | |
#region Initialization | |
[Server] | |
private void Start() | |
{ | |
var data = PaintCanvas.GetAllTextureData(); |
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.UI; | |
public class BrushSizeSlider : MonoBehaviour | |
{ | |
private Slider slider; | |
public static int BrushSize { get; private set; } | |
private void Start() |