Merge branch 'main' of github.com:LeGall29/GGJ2024
This commit is contained in:
commit
f6b5408275
31
Assets/Scripts/GameManager.cs
Normal file
31
Assets/Scripts/GameManager.cs
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class GameManager : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Start is called before the first frame update
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum GameState
|
||||||
|
{
|
||||||
|
EnteringName,
|
||||||
|
WaitingForOtherPlayers,
|
||||||
|
Explanation,
|
||||||
|
MakeProposition,
|
||||||
|
PropositionSent,
|
||||||
|
VotingTime,
|
||||||
|
Ending
|
||||||
|
}
|
||||||
|
|
||||||
|
|
11
Assets/Scripts/GameManager.cs.meta
Normal file
11
Assets/Scripts/GameManager.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 27a435387a7644784a6fc6ae538b68e5
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -4,16 +4,131 @@
|
|||||||
|
|
||||||
public class RoomManager : MonoBehaviour
|
public class RoomManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
private RoomState currentState;
|
||||||
|
private List<Player> players;
|
||||||
|
|
||||||
// Start is called before the first frame update
|
public float propositionTime = 60;
|
||||||
void Start()
|
public float votingTime = 20;
|
||||||
|
|
||||||
|
private float propositionCurrentTime = 0;
|
||||||
|
private float votingCurrentTime = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Contain the infos about the current displayed question (during votes)
|
||||||
|
/// </summary>
|
||||||
|
private Question currentQuestion;
|
||||||
|
|
||||||
|
private List<Question> questions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// When this is equal to questions.Count, go to score page
|
||||||
|
/// </summary>
|
||||||
|
private int numberOfQuestionVoted = 0;
|
||||||
|
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
propositionCurrentTime = propositionTime;
|
||||||
|
votingCurrentTime = votingTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void PlayerSendProposition(Proposition _proposition)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
/// <summary>
|
||||||
void Update()
|
/// Called when the first player clicked "Start"
|
||||||
|
/// </summary>
|
||||||
|
public void HostStartGame()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Start the proposition timer
|
||||||
|
/// </summary>
|
||||||
|
public void StartPropositionTimer()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Automatically called when the proposition timer has finished
|
||||||
|
/// </summary>
|
||||||
|
public void PropositionTimerFinished()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Start the voting timer
|
||||||
|
/// </summary>
|
||||||
|
public void StartVotingTimer()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Automatically called when the voting timer has finished
|
||||||
|
/// </summary>
|
||||||
|
public void VotingTimerFinished()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Automatically called when a proposition is updated (someone has voted or a picture has been proposed)
|
||||||
|
/// </summary>
|
||||||
|
public void OnPropositionUpdate()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Will generate a question with a prompt and two owners
|
||||||
|
/// </summary>
|
||||||
|
public void GenerateQuestion()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Generate all the player pairs
|
||||||
|
/// (players should not play against themself.
|
||||||
|
/// (players should not play twice with the same person)
|
||||||
|
/// </summary>
|
||||||
|
public void GenerateCouples()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// is automatically called when a player connect to the room
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="_player"></param>
|
||||||
|
public void PlayerConnect(Player _player)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[ContextMenu("Fake Player Connection")]
|
||||||
|
private void FakePlayerConnection()
|
||||||
|
{
|
||||||
|
Player temp = new Player();
|
||||||
|
temp.id = System.Guid.NewGuid().ToString();
|
||||||
|
temp.SetName("Momo");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum RoomState
|
||||||
|
{
|
||||||
|
WaitingForPlayer,
|
||||||
|
WaitingForPropositions,
|
||||||
|
ShowPropositions,
|
||||||
|
ShowVoters,
|
||||||
|
Score
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user