Insanely huge initial commit

This commit is contained in:
2026-02-21 17:04:05 -08:00
parent 9cdd36191a
commit 613d75914a
22525 changed files with 4035207 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ChairController : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1198b75c2511bb040b26688ea6c572c2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,22 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameAudioController : MonoBehaviour {
[SerializeField] public AudioSource sound;
[SerializeField] public AudioClip talentTabOpen;
[SerializeField] public AudioClip talentTabClose;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e9523b6feae576e43a4ccb946d124b16
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,459 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Pathfinding;
using Com.LuisPedroFonseca.ProCamera2D;
using TMPro;
using UnityEngine.UI;
public enum PatronType {
Default
}
public class Party {
// Gameplay stats.
// Set of patrons to be seated. The size determines eligible tables.
// The type determines what sprites to use.
public List<PatronType> patrons;
// Default amount of time before the party walks out when waiting on something.
public int patience = 5;
// Chance for a party to give a task instead of an order.
public int baseTaskRate = 50;
// Default speed at which a party decides on an order and eats.
public int baseSpeed = 10;
public Party(List<PatronType> patrons, int patience, int baseTaskRate, int baseSpeed) {
this.patrons = patrons;
this.patience = patience;
this.baseTaskRate = baseTaskRate;
this.baseSpeed = baseSpeed;
}
}
public class TalentState {
public int energy { get; set; } = 100;
public int tips { get; set; } = 0;
public int exp { get; set; } = 0;
// Not owned.
public TableController assignedTable { get; set; } = null;
// public StageSlotController assignedStageSlot = null;
// public int assignedBackroom = -1;
// public bool atFrontDesk = false;
}
public class GameStateController : MonoBehaviour {
[SerializeField] TalentListController talentList;
[HideInInspector] GameAudioController audioController;
[HideInInspector] int selectedTab = -1;
[HideInInspector] ProCamera2D proCamera2D;
[HideInInspector] ProCamera2DPanAndZoom proCamera2DPan;
[HideInInspector] ProCamera2DTransitionsFX proCamera2DTransition;
[HideInInspector] Animator expandedCG;
[HideInInspector] SummaryController summaryController;
// List of all tables in the map.
// Used to validate party seating eligibility.
[HideInInspector] private List<TableController> tables = new List<TableController>();
[SerializeField] public List<OrderPlacementController> orderPlacements;
// Game loop stats.
[HideInInspector] public int moneyEarned = 0;
[HideInInspector] public int currentTime = 0;
[HideInInspector] public int patrons = 0;
[HideInInspector] public Queue<Party> frontDeskQueue = new Queue<Party>();
[HideInInspector] public Queue<Order> orderBacklog = new Queue<Order>();
[HideInInspector] public bool gameRunning = false;
// Game init values.
[SerializeField] int secondsPerTick = 10;
[SerializeField] int maxTime = 30;
[SerializeField] int openingHour = 6;
// Game init values (configurable).
// Varies based on progress in the game. Will be loaded dynamically.
// Max number of parties waiting to be seated.
[SerializeField] int queueCapacity = 3;
// Spawn speed of new parties per minute.
[SerializeField] int baseSpawnRate = 1;
// Seconds to wait before spawning the first party.
[SerializeField] int firstSpawnTime = 3;
// EXP earned for completing actions.
// Subject to bonuses based on what the talent does.
[SerializeField] public int baseExp = 5;
// Probability distribution of party size, starting at 1.
// Works the same as the Grand Star item lottery.
// Must add to 100.
[SerializeField] List<int> partySizeDistribution =
new List<int>() { 25, 50, 20, 5 };
// Multiplier distribution to receive different letter grades.
// C, B, A, S, SS. You get an F if you're below the goal.
[SerializeField] public List<float> gradeDistribution =
new List<float>() { 1.0f, 1.5f, 2.0f, 2.5f, 3.0f };
// Goal for the day. You fail and the day resets if you don't hit this goal.
[SerializeField] public int moneyGoal = 100;
// Base multiplier for earned money per patron.
[SerializeField] public float baseMoneyMultiplier = 100.0f;
// Base difficulty for patron patience and tipping.
[SerializeField] public float difficulty = 1.0f;
// Status indicators.
// Not owned.
[SerializeField] public TextMeshProUGUI text_CurrentTime;
[SerializeField] public TextMeshProUGUI text_CurrentMoney;
[SerializeField] public TextMeshProUGUI text_CurrentPatrons;
// Guaranteed waypoints.
// Not owned.
// Backroom is targeted automatically when a talent receives a task.
[HideInInspector] public Transform backroom;
// Bar is targeted with a hotkey (B).
[HideInInspector] public Transform bar;
// Front desk is targeted with a hotkey (F).
[HideInInspector] public Transform frontDesk;
// Dishes can be targeted with a hotkey (D).
[HideInInspector] public Transform dishes;
// Should load from GameData later.
public TalentState[] talentState = {
// Elaine
new TalentState() {
energy = GameData.GLOBAL
.employeeStats[(int)Employee.Elaine].maxEnergy
},
new TalentState() {
energy = GameData.GLOBAL
.employeeStats[(int)Employee.Irida].maxEnergy
},
new TalentState() {
energy = GameData.GLOBAL
.employeeStats[(int)Employee.Clem].maxEnergy
},
new TalentState() {
energy = GameData.GLOBAL
.employeeStats[(int)Employee.Schroder].maxEnergy
},
};
private void EndTimer() {
Debug.Log("TODO: Make all employees stop what they're doing");
gameRunning = false;
summaryController.gameObject.SetActive(true);
summaryController.SetText();
}
IEnumerator GameTimer() {
while (currentTime < maxTime) {
yield return new WaitForSeconds(secondsPerTick);
currentTime += 1;
}
EndTimer();
}
IEnumerator SpawnTimer() {
yield return new WaitForSeconds(firstSpawnTime);
if (frontDeskQueue.Count < queueCapacity) {
NewParty();
}
while (gameRunning) {
yield return new WaitForSeconds(60 / baseSpawnRate);
if (frontDeskQueue.Count < queueCapacity) {
NewParty();
}
}
}
private void StartTimer() {
if (currentTime < maxTime) {
gameRunning = true;
StartCoroutine("GameTimer");
StartCoroutine("SpawnTimer");
}
}
private PatronType GeneratePatron() {
Debug.Log("TODO: Patron type variance");
return PatronType.Default;
}
private void NewParty() {
int lotto = Random.Range(0, 100);
int lottoSum = 0;
int i = 0;
List<PatronType> patrons = new List<PatronType>() {
GeneratePatron()
};
while (i < partySizeDistribution.Count && partySizeDistribution[i] + lottoSum < lotto) {
lottoSum += partySizeDistribution[i];
i += 1;
patrons.Add(GeneratePatron());
}
Debug.Log("TODO: Party stat variance");
frontDeskQueue.Enqueue(new Party(
patrons,
/*patience =*/ 5,
/*baseTaskRate =*/ 10,
/*baseSpeed =*/ 15));
Debug.Log("New Party (" + frontDeskQueue.Count.ToString() + ")");
}
// Start is called before the first frame update
void Start() {
audioController = GetComponent<GameAudioController>();
backroom = GameObject.FindGameObjectWithTag("BackroomWaypoint").transform;
bar = GameObject.FindGameObjectWithTag("BarWaypoint").transform;
frontDesk = GameObject.FindGameObjectWithTag("FrontDeskWaypoint").transform;
dishes = GameObject.FindGameObjectWithTag("DishesWaypoint").transform;
proCamera2D = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<ProCamera2D>();
proCamera2DPan = proCamera2D.GetComponent<ProCamera2DPanAndZoom>();
proCamera2DTransition = proCamera2D.GetComponent<ProCamera2DTransitionsFX>();
expandedCG = GameObject.FindGameObjectWithTag("ExpandedCG").GetComponent<Animator>();
expandedCG.gameObject.SetActive(false);
summaryController = GameObject.FindGameObjectWithTag("Summary").GetComponent<SummaryController>();
summaryController.gameObject.SetActive(false);
proCamera2DTransition.TransitionEnter();
int i = 1;
foreach (GameObject g in GameObject.FindGameObjectsWithTag("Table")) {
TableController table = g.GetComponent<TableController>();
table.tableId = i;
i++;
tables.Add(table);
}
Debug.Log("TODO: Move this to a ready-set-go");
StartTimer();
}
TalentController GetSelectedEmployee() {
GameObject employee = GameObject.FindGameObjectWithTag(((Employee)selectedTab).ToString());
if (employee != null) {
return employee.GetComponent<TalentController>();
}
return null;
}
public void GainExp(Employee e, int amount) {
talentState[(int)e].exp += amount;
}
public void GainTips(Employee e, int amount) {
moneyEarned += amount;
talentState[(int)e].tips += amount;
}
public void GainMoney(int amount) {
moneyEarned += amount;
}
// Attempt to select the [tabIndex]'th Talent.
public void HandleSelect(int tabIndex) {
if (selectedTab == tabIndex) {
// Deselect tab
Debug.Log("Attempting to de-select tab " + tabIndex.ToString());
talentList.setActiveTab(-1);
selectedTab = -1;
audioController.sound.PlayOneShot(
audioController.talentTabClose);
// Return pan to the player.
proCamera2D.RemoveAllCameraTargets();
proCamera2DPan.enabled = true;
} else {
// Select tab
Debug.Log("Attempting to select tab " + tabIndex.ToString());
talentList.setActiveTab(tabIndex);
selectedTab = tabIndex;
audioController.sound.PlayOneShot(
audioController.talentTabOpen);
// Switch target to the newly selected employee if in target mode.
if (proCamera2DPan.enabled == false) {
HandleTargetSelection();
}
}
}
void HandleShowCG() {
if (expandedCG.isActiveAndEnabled) {
talentList.gameObject.SetActive(true);
expandedCG.gameObject.SetActive(false);
Debug.Log("TODO: Stop loop sound for animation");
} else if (selectedTab != -1) {
talentList.gameObject.SetActive(false);
expandedCG.gameObject.SetActive(true);
Debug.Log("TODO: Set animator float for CG of " + ((Employee)selectedTab).ToString());
Debug.Log("TODO: Play loop sound for animation");
}
}
void HandleTargetSelection() {
if (!proCamera2DPan.enabled) {
// Turn off targeting.
proCamera2D.RemoveAllCameraTargets();
proCamera2DPan.enabled = true;
} else if (selectedTab != -1) {
TalentController talent = GetSelectedEmployee();
if (talent != null) {
talent.OnTarget();
// Targeting takes pan away from the player.
proCamera2DPan.enabled = false;
proCamera2D.RemoveAllCameraTargets();
proCamera2D.AddCameraTarget(talent.transform, 1, 1, 1);
}
}
}
// If an employee is selected, have them tend to the table.
public void HandleTableClick(TableController table) {
if (selectedTab != -1 &&
table.waypoint != null) {
// The target employee's name should be the object tag associated with their selection index.
// Elaine = 0, Irida = 1, Clem = 2, Schroder = 3.
TalentController talent = GetSelectedEmployee();
if (talent != null) {
Debug.Log("Queueing " + ((Employee)selectedTab).ToString() + " to a table.");
talent.QueueDestination(table.waypoint, AssignmentType.Table, table);
}
}
}
// If an employee is selected, have them visit this order waypoint.
public void HandleOrderClick(OrderPlacementController order) {
if (selectedTab != -1 &&
order.waypoint != null) {
// The target employee's name should be the object tag associated with their selection index.
// Elaine = 0, Irida = 1, Clem = 2, Schroder = 3.
TalentController talent = GetSelectedEmployee();
if (talent != null) {
Debug.Log("Queueing " + ((Employee)selectedTab).ToString() + " to pick up an order.");
talent.QueueDestination(order.waypoint, AssignmentType.Order, null, order);
}
}
}
private IEnumerator FinishCooking(Order o, float time) {
yield return new WaitForSeconds(time);
bool orderAccepted = false;
foreach (OrderPlacementController placement in orderPlacements) {
if (placement.order == null) {
placement.TakeOrder(o);
orderAccepted = true;
break;
}
}
if (!orderAccepted) {
orderBacklog.Enqueue(o);
}
}
// Starts coroutines to cook a list of orders.
public void Cook(List<Order> orders) {
foreach (Order o in orders) {
Debug.Log("TODO: Cook time based on difficulty");
StartCoroutine(FinishCooking(o, Random.Range(1.0f, 5.0f)));
}
}
// Returns true iff an open table with sufficient capacity is available for seating.
public bool ValidateParty(Party p) {
foreach (TableController t in tables) {
if (t.chairs.Count >= p.patrons.Count && t.party == null) {
return true;
}
}
return false;
}
// Check if the front desk is already occupied.
// If not, attempt to assign the selected talent to the front desk.
void HandleFrontDeskClick() {
if (selectedTab != -1) {
TalentController talent = GetSelectedEmployee();
if (talent != null) {
Debug.Log("Queueing " + ((Employee)selectedTab).ToString() + " to the front desk.");
talent.QueueDestination(frontDesk, AssignmentType.FrontDesk);
}
}
}
// Attempt to assign the selected talent to the bar.
void HandleBarClick() {
if (selectedTab != -1) {
TalentController talent = GetSelectedEmployee();
if (talent != null) {
Debug.Log("Queueing " + ((Employee)selectedTab).ToString() + " to the bar.");
talent.QueueDestination(bar, AssignmentType.Bar);
}
}
}
// Attempt to assign the selected talent to the bar.
void HandleDishesClick() {
if (selectedTab != -1) {
TalentController talent = GetSelectedEmployee();
if (talent != null) {
Debug.Log("Queueing " + ((Employee)selectedTab).ToString() + " to the dishes.");
talent.QueueDestination(dishes, AssignmentType.Dishes);
}
}
}
// Turn a time tick into XX:YY PM/AM.
// Starting time is set by openingHour and each tick is 15 minutes.
// So tick 5 with openingHour 6 is 7:15 PM.
private string BuildTimeString(int time) {
int minute = (time % 4) * 15;
int hour = (time / 4 + openingHour) % 12;
if (hour == 0) hour = 12;
return hour.ToString() + ":"
+ minute.ToString().PadLeft(2, '0')
+ ((hour < openingHour || hour == 12) ? " AM" : " PM");
}
private void LateUpdate() {
text_CurrentTime.SetText(BuildTimeString(currentTime));
text_CurrentMoney.SetText("$" + moneyEarned.ToString());
text_CurrentPatrons.SetText(patrons.ToString());
}
// Update is called once per frame
void Update() {
if (Input.GetKeyDown(KeyCode.Alpha1)) {
HandleSelect(0);
} else if (Input.GetKeyDown(KeyCode.Alpha2)) {
HandleSelect(1);
} else if (Input.GetKeyDown(KeyCode.Alpha3)) {
HandleSelect(2);
} else if (Input.GetKeyDown(KeyCode.Alpha4)) {
HandleSelect(3);
} else if (Input.GetKeyDown(KeyCode.Alpha5)) {
HandleSelect(4);
} else if (Input.GetKeyDown(KeyCode.Alpha6)) {
HandleSelect(5);
} else if (Input.GetKeyDown(KeyCode.E)) {
HandleShowCG();
} else if (Input.GetKeyDown(KeyCode.T)) {
HandleTargetSelection();
} else if (Input.GetKeyDown(KeyCode.F)) {
HandleFrontDeskClick();
} else if (Input.GetKeyDown(KeyCode.B)) {
HandleBarClick();
} else if (Input.GetKeyDown(KeyCode.D)) {
HandleDishesClick();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b294d80dcfa51404aa7d5bfe04b29794
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,60 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using TMPro;
public class Order {
public TableController destination;
public Order(TableController destination) {
this.destination = destination;
}
}
public class OrderPlacementController : MonoBehaviour, IPointerClickHandler
{
[SerializeField] public Transform waypoint = null;
[SerializeField] public TextMeshPro debugText = null;
[HideInInspector] public Order order = null;
// Not owned.
[HideInInspector] private GameStateController gameStateController;
public void OnPointerClick(PointerEventData eventData) {
Debug.Log("I'm an order waypoint and you clicked on me!!");
gameStateController.HandleOrderClick(this);
}
// API to take a new order.
public void TakeOrder(Order o) {
Debug.Log("Animation update");
order = o;
}
// Yield the order to a talent, setting it as null for self.
// If an order is in the backlog, it'll be placed immediately at this table.
public Order PickUp() {
Order o = order;
order = null;
if (gameStateController.orderBacklog.Count > 0) {
TakeOrder(gameStateController.orderBacklog.Dequeue());
}
return o;
}
// Start is called before the first frame update
void Start() {
gameStateController = GameObject.FindGameObjectWithTag("GameStateController").GetComponent<GameStateController>();
}
private void LateUpdate() {
if (order != null) {
debugText.SetText(order.destination.tableId.ToString());
} else {
debugText.SetText("");
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 209d7b37c6709ec4f884baa2a1809223
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,253 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using Com.LuisPedroFonseca.ProCamera2D;
using UnityEngine.SceneManagement;
public class SummaryController : MonoBehaviour {
[SerializeField] TextMeshProUGUI textPatrons;
[SerializeField] TextMeshProUGUI textMoney;
[SerializeField] TextMeshProUGUI textGrade;
// TODO: TMPros for each talent's summary
[SerializeField] TextMeshProUGUI textElaineXP;
[SerializeField] TextMeshProUGUI textIridaXP;
[SerializeField] TextMeshProUGUI textClemXP;
[SerializeField] TextMeshProUGUI textSchroderXP;
// Not owned.
[HideInInspector] GameStateController gameStateController;
[HideInInspector] ProCamera2DTransitionsFX transition;
// Makes up a grade given the game state.
public string GetGrade() {
Debug.Log("GetGrade not yet implemented");
if (gameStateController.moneyEarned < gameStateController.moneyGoal) {
return "F";
}
string[] grades = { "C", "B", "A", "S", "SS" };
int i = 0;
while (i < grades.Length &&
gameStateController.moneyEarned > gameStateController.moneyGoal * gameStateController.gradeDistribution[i]) {
i++;
}
return grades[i - 1];
}
void Start() {
gameStateController = GameObject.FindGameObjectWithTag("GameStateController").GetComponent<GameStateController>();
transition = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<ProCamera2DTransitionsFX>();
}
public void SetText() {
ProcessAndShowEXP();
textPatrons.SetText(gameStateController.patrons.ToString());
textMoney.SetText(gameStateController.moneyEarned.ToString());
textGrade.SetText(GetGrade());
}
// Update is called once per frame
void Update()
{
}
public void GoToManagement() {
SceneManager.LoadScene("Manager");
}
// For when the player unlocks something that starts with a scene.
public void GoToDialogue() {
SceneManager.LoadScene("SceneViewer");
}
public Dialogue ReturnDialogueIfUnlock(Unlockable u, Dialogue d) {
if (!GameData.IsUnlocked(u)) {
GameData.Unlock(u);
return d;
}
return Dialogue.None;
}
public Dialogue ProcessUnlockables() {
// Character-specific scenes.
if (GameData.StatsOf(Employee.Elaine).level >= 3) {
GameData.Unlock(Unlockable.Dialogue_Elaine_Voyeurism);
}
if (GameData.StatsOf(Employee.Elaine).level >= 6) {
GameData.Unlock(Unlockable.Dialogue_Elaine_Femdom);
}
if (GameData.StatsOf(Employee.Elaine).level >= 9) {
GameData.Unlock(Unlockable.Dialogue_Elaine_Foodplay);
}
if (GameData.IsPlayerUnlocked(Employee.Irida) &&
GameData.StatsOf(Employee.Irida).level >= 4) {
GameData.Unlock(Unlockable.Dialogue_Irida_Anal);
}
if (GameData.IsPlayerUnlocked(Employee.Irida) &&
GameData.StatsOf(Employee.Irida).level >= 6) {
GameData.Unlock(Unlockable.Dialogue_Irida_Boobies);
}
if (GameData.IsPlayerUnlocked(Employee.Irida) &&
GameData.StatsOf(Employee.Irida).level >= 8) {
GameData.Unlock(Unlockable.Dialogue_Irida_Oral);
}
if (GameData.IsPlayerUnlocked(Employee.Clem) &&
GameData.StatsOf(Employee.Clem).level >= 4) {
GameData.Unlock(Unlockable.Dialogue_Clem_FFM);
}
if (GameData.IsPlayerUnlocked(Employee.Clem) &&
GameData.StatsOf(Employee.Clem).level >= 6) {
GameData.Unlock(Unlockable.Dialogue_Clem_Exploration);
}
if (GameData.IsPlayerUnlocked(Employee.Clem) &&
GameData.StatsOf(Employee.Clem).level >= 8) {
GameData.Unlock(Unlockable.Dialogue_Clem_Confession);
}
if (GameData.IsPlayerUnlocked(Employee.Schroder) &&
GameData.StatsOf(Employee.Schroder).level >= 5) {
GameData.Unlock(Unlockable.Dialogue_Schroder_Packing);
}
if (GameData.IsPlayerUnlocked(Employee.Schroder) &&
GameData.StatsOf(Employee.Schroder).level >= 8) {
GameData.Unlock(Unlockable.Dialogue_Schroder_Anal);
}
if (GameData.IsPlayerUnlocked(Employee.Schroder) &&
GameData.StatsOf(Employee.Schroder).level >= 9) {
GameData.Unlock(Unlockable.Dialogue_Schroder_Dom);
}
if (GameData.IsPlayerUnlocked(Employee.Schroder) &&
GameData.StatsOf(Employee.Schroder).level >= 10) {
GameData.Unlock(Unlockable.Dialogue_Schroder_Lapdance);
}
// Backrooms: Unlock all characters
if (GameData.IsUnlocked(Unlockable.IridaPlayable) &&
GameData.IsUnlocked(Unlockable.ClemPlayable) &&
GameData.IsUnlocked(Unlockable.SchroderPlayable)) {
GameData.Unlock(Unlockable.Backrooms);
}
Debug.Log("TODO: Schroder special condition of stripper assignment");
// Irida: Clear 3 days and Elaine level 3+
if (GameData.StatsOf(Employee.Elaine).level >= 3
&& GameData.GLOBAL.day > 3) {
return ReturnDialogueIfUnlock(
Unlockable.IridaPlayable,
Dialogue.Unlock_Irida);
}
// Clem: Clear 8 days and Elaine and Irida level 5+
else if (
GameData.StatsOf(Employee.Elaine).level >= 5
&& GameData.StatsOf(Employee.Irida).level >= 5
&& GameData.GLOBAL.day > 8) {
return ReturnDialogueIfUnlock(
Unlockable.ClemPlayable,
Dialogue.Unlock_Clem);
}
// Schroder: Clear 14 days and Elaine, Irida, Clem level 7+
else if (
GameData.StatsOf(Employee.Elaine).level >= 7
&& GameData.StatsOf(Employee.Irida).level >= 7
&& GameData.StatsOf(Employee.Clem).level >= 7
&& GameData.GLOBAL.day > 14) {
return ReturnDialogueIfUnlock(
Unlockable.SchroderPlayable,
Dialogue.Unlock_Schroder);
}
return Dialogue.None;
}
// Process GameData after completing a day.
private void ProcessAndShowEXP(bool won = true) {
Debug.Log("TODO: Calculate exp gain per employee based on daily activities");
Debug.Log("TODO: Build summary around results of above calculation (pre-calculate)");
int[] previousLevels = {
GameData.StatsOf(Employee.Elaine).level,
GameData.StatsOf(Employee.Irida).level,
GameData.StatsOf(Employee.Clem).level,
GameData.StatsOf(Employee.Schroder).level,
};
int[] previousExp = {
GameData.StatsOf(Employee.Elaine).exp,
GameData.StatsOf(Employee.Irida).exp,
GameData.StatsOf(Employee.Clem).exp,
GameData.StatsOf(Employee.Schroder).exp,
};
Debug.Log("TODO: Implement ability to lose and not gain exp/money/day");
if (won) {
for (int i = 0; i < 4; i++) {
GameData.StatsOf((Employee)i).GainExp(
gameStateController.talentState[i].exp);
}
GameData.GLOBAL.money += gameStateController.moneyEarned;
GameData.GLOBAL.day += 1;
}
Debug.Log("bruh");
textElaineXP.SetText(
"LV" +
previousLevels[0].ToString() + " " +
previousExp[0].ToString() + " / " +
EmployeeStats.expRequirement[previousLevels[0]] + " => " +
GameData.StatsOf(Employee.Elaine).level.ToString() + " " +
GameData.StatsOf(Employee.Elaine).exp.ToString() + " / " +
EmployeeStats.expRequirement[GameData.StatsOf(Employee.Elaine).level]);
if (GameData.IsPlayerUnlocked(Employee.Irida)) {
textIridaXP.SetText(
"LV" +
previousLevels[1].ToString() + " " +
previousExp[1].ToString() + " / " +
EmployeeStats.expRequirement[previousLevels[1]] + " => " +
GameData.StatsOf(Employee.Irida).level.ToString() + " " +
GameData.StatsOf(Employee.Irida).exp.ToString() + " / " +
EmployeeStats.expRequirement[GameData.StatsOf(Employee.Irida).level]);
}
if (GameData.IsPlayerUnlocked(Employee.Clem)) {
textClemXP.SetText(
"LV" +
previousLevels[2].ToString() + " " +
previousExp[2].ToString() + " / " +
EmployeeStats.expRequirement[previousLevels[2]] + " => " +
GameData.StatsOf(Employee.Clem).level.ToString() + " " +
GameData.StatsOf(Employee.Clem).exp.ToString() + " / " +
EmployeeStats.expRequirement[GameData.StatsOf(Employee.Clem).level]);
}
if (GameData.IsPlayerUnlocked(Employee.Schroder)) {
textSchroderXP.SetText(
"LV" +
previousLevels[3].ToString() + " " +
previousExp[3].ToString() + " / " +
EmployeeStats.expRequirement[previousLevels[3]] + " => " +
GameData.StatsOf(Employee.Schroder).level.ToString() + " " +
GameData.StatsOf(Employee.Schroder).exp.ToString() + " / " +
EmployeeStats.expRequirement[GameData.StatsOf(Employee.Schroder).level]);
}
}
public void Continue() {
Dialogue unlockedScene = ProcessUnlockables();
Debug.Log("TODO: Autosave toggle as option");
GameData.Save();
if (unlockedScene != Dialogue.None) {
VNData.NextScene = unlockedScene;
transition.OnTransitionExitEnded = GoToDialogue;
} else {
transition.OnTransitionExitEnded = GoToManagement;
}
transition.TransitionExit();
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fbb1bb49c234df44fa5cab5d5cf22b25
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,181 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine.EventSystems;
using UnityEngine;
using TMPro;
public enum TableState {
Empty,
Deciding, // Deciding on an order or task
ReadyToOrder, // Actively waiting for an employee
WaitingOnOrder, // Specifically for food
Escorting, // Moving to backroom. Transitions to Empty
Eating, // Transitions to Deciding or Done
WaitingOnCheck, // Interaction takes the check. Transitions to Plates
Plates // The table needs to be bussed. Transitions to Empty
}
public class TableController : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler
{
[SerializeField] public int tableId = 0;
[SerializeField] public Transform waypoint;
[SerializeField] public Transform pornModal;
[SerializeField] public Animator pornAnimator;
// Autograb.
[HideInInspector] public List<ChairController> chairs;
[HideInInspector] public float patienceTimeStart = 0.0f;
[HideInInspector] public float maxWait = 30.0f;
// Should increase significantly with tasks.
[HideInInspector] public float tipMultiplier = 0.3f;
[HideInInspector] public List<float> remainingPatience = new List<float>();
// TODO: Implement patron actions, timeouts, etc.
// Not owned.
private GameStateController gameStateController;
[SerializeField] TextMeshPro debugText;
// Gameplay fields.
[HideInInspector] public Party party = null;
[HideInInspector] public TableState state = TableState.Empty;
[HideInInspector] public bool waiting = false;
// Mutex.
[HideInInspector] public bool servicing = false;
public void OnPointerClick(PointerEventData eventData) {
Debug.Log("I'm a table and you clicked on me!!");
gameStateController.HandleTableClick(this);
}
public void OnPointerEnter(PointerEventData eventData) {
Debug.Log("I'm a table and you're hovering on me!");
}
public void OnPointerExit(PointerEventData eventData) {
Debug.Log("I'm a table and you left!");
}
private void StartWait() {
waiting = true;
patienceTimeStart = Time.time;
}
private void EndWait() {
waiting = false;
float waited = 1.0f - (Time.time - patienceTimeStart) / maxWait;
Debug.Log("Table patience remaining on complete: " + waited.ToString());
remainingPatience.Add(waited);
}
private void ResetPatience() {
waiting = false;
remainingPatience.Clear();
}
public int GetPay() {
if (remainingPatience.Count == 0 || party.patrons.Count == 0) {
return 0;
}
Debug.Log("Make dynamic based on other party stats");
float pay = party.patrons.Count
* gameStateController.baseMoneyMultiplier
/ gameStateController.difficulty;
return Mathf.FloorToInt(pay);
}
public int GetTip() {
if (remainingPatience.Count == 0 || party.patrons.Count == 0) {
return 0;
}
float avgPatience = 0.0f;
foreach (float p in remainingPatience) {
avgPatience += Mathf.Max(0.0f, p);
}
avgPatience /= remainingPatience.Count;
Debug.Log("Make dynamic based on party stats");
float pay = party.patrons.Count
* gameStateController.baseMoneyMultiplier
* tipMultiplier
* (1.0f - avgPatience)
/ gameStateController.difficulty;
return Mathf.FloorToInt(pay);
}
public Order GenerateOrder() {
Debug.Log("TODO: Capture event where employee picks up a ticket");
state = TableState.WaitingOnOrder;
EndWait();
StartWait();
return new Order(this);
}
private IEnumerator DecideOnOrder() {
Debug.Log("TODO: Make order time dynamic and based on day's difficulty");
yield return new WaitForSeconds(5);
state = TableState.ReadyToOrder;
StartWait();
}
public void AssignParty(Party p) {
party = p;
state = TableState.Deciding;
remainingPatience.Clear();
Debug.Log("Make maxWait dynamic based on Party and GameState difficulty");
maxWait = 30.0f; // 30 seconds
StartCoroutine("DecideOnOrder");
Debug.Log("TODO: Update chairs after being seated");
}
private IEnumerator FinishEating() {
Debug.Log("TODO: Make order time dynamic and based on day's difficulty");
yield return new WaitForSeconds(5);
state = TableState.WaitingOnCheck;
StartWait();
}
public void StartEating() {
EndWait();
state = TableState.Eating;
StartCoroutine("FinishEating");
Debug.Log("TODO: Update chairs to start eating");
}
public void PickUpCheck() {
EndWait();
state = TableState.Plates;
Debug.Log("TODO: Update chairs to go yay and make money");
}
public void CleanUpDishes() {
Debug.Log("TODO: Implement dishes or empty state depending on backroom vs escort");
state = TableState.Empty;
party = null;
ResetPatience();
}
// Start is called before the first frame update
void Start() {
gameStateController = GameObject.FindGameObjectWithTag("GameStateController").GetComponent<GameStateController>();
chairs = new List<ChairController>(transform.GetComponentsInChildren<ChairController>());
}
// Update is called once per frame
void LateUpdate() {
if (waiting && Time.time - patienceTimeStart > maxWait) {
// Debug.Log("TIME'S OUT, SUCKER");
}
debugText.SetText("Table: " + tableId.ToString()
+ "\nCapacity: " + chairs.Count.ToString()
+ "\nOccupancy: " + ((party == null) ? "0" : party.patrons.Count.ToString())
+ "\nTableState: " + state.ToString()
);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 130fe064c437c88469cbafba08c3bd2a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,372 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Pathfinding;
public enum AssignmentType {
None,
Table,
Backroom,
FrontDesk,
Bar,
Order,
Dishes
}
// To-do item for an employee. The player queues these up,
// and the employee performs each one best-effort as quickly as they can.
public class Destination {
public Transform waypoint;
public AssignmentType assignmentType;
public TableController assignedTable;
public OrderPlacementController order;
public Destination(Transform waypoint, AssignmentType assignmentType, TableController assignedTable, OrderPlacementController order) {
this.waypoint = waypoint;
this.assignmentType = assignmentType;
this.assignedTable = assignedTable;
this.order = order;
}
}
public class TalentController : MonoBehaviour {
[SerializeField] List<AudioClip> greetings;
[SerializeField] List<AudioClip> comply;
// Prefab to spawn XP/Money text.
[SerializeField] GameObject fadingTextProto;
[HideInInspector] AudioSource audioSource;
[HideInInspector] Animator animator;
// Pathfinding related objects.
[HideInInspector] AIDestinationSetter destination;
[HideInInspector] AILerp aiLerp;
// Not owned.
[HideInInspector] GameStateController gameStateController;
[HideInInspector] bool busy = false;
// The distance at which an employee will stop away from a table, if they're
// walking towards it while it's being serviced by another employee.
[SerializeField] float maxServiceWaitDistance = 4.0f;
// Table service variables.
[SerializeField] TableController assignedTable = null;
[HideInInspector] List<Order> heldTickets = new List<Order>();
[HideInInspector] List<Order> heldFood = new List<Order>();
[HideInInspector] OrderPlacementController assignedOrder = null;
[HideInInspector] bool isAtWaypoint = true;
[HideInInspector] Party seatingParty = null;
[HideInInspector] bool isHoldingPlates = false;
[HideInInspector] AssignmentType assignmentType = AssignmentType.None;
// TOOD: The list of destinations is overrideable by a visit to the Backroom.
[SerializeField] Queue<Destination> todo = new Queue<Destination>();
[SerializeField] Employee employee = Employee.Elaine;
// Start is called before the first frame update
void Start() {
audioSource = GetComponent<AudioSource>();
destination = GetComponent<AIDestinationSetter>();
animator = GetComponent<Animator>();
aiLerp = GetComponent<AILerp>();
gameStateController = GameObject.FindGameObjectWithTag("GameStateController").GetComponent<GameStateController>();
// TODO: Maybe something safer on GetComponent.
if (!GameData.IsPlayerUnlocked(employee)) {
Destroy(gameObject);
}
}
void NewDestination(Transform waypoint,
AssignmentType destinationType = AssignmentType.None,
TableController table = null,
OrderPlacementController order = null) {
destination.target = waypoint;
assignmentType = destinationType;
assignedTable = table;
assignedOrder = order;
isAtWaypoint = false;
busy = true;
}
// Vector push-back a new Destination onto the employee's to-do list.
// They will act upon all destinations, in the order they were enqueued by the player.
public void QueueDestination(Transform waypoint,
AssignmentType destinationType = AssignmentType.None,
TableController table = null,
OrderPlacementController order = null) {
if (todo.Count == 0 && !busy) {
PlayRandomSound(comply);
}
todo.Enqueue(new Destination(waypoint, destinationType, table, order));
}
public void PlayRandomSound(List<AudioClip> sounds) {
if (sounds.Count > 0) {
audioSource.PlayOneShot(sounds[Random.Range(0, sounds.Count)]);
}
}
public void OnTarget() {
PlayRandomSound(greetings);
}
private void GainPay(int amount, int tips) {
Debug.Log("Spawn text with amount + tip amount");
gameStateController.GainMoney(amount);
gameStateController.GainTips(employee, tips);
TextFadeController tfc = Instantiate(fadingTextProto).GetComponent<TextFadeController>();
tfc.transform.position = transform.position;
tfc.baseColor = Color.green;
tfc.text.SetText("+$" + amount.ToString() + " +$" + tips.ToString());
}
private void GainExp(int amount) {
Debug.Log("Spawn text with exp amount");
gameStateController.GainExp(employee, amount);
TextFadeController tfc = Instantiate(fadingTextProto).GetComponent<TextFadeController>();
tfc.transform.position = transform.position;
tfc.baseColor = Color.yellow;
tfc.text.SetText("+" + amount.ToString() + " XP");
}
private IEnumerator PickUpTicket() {
Debug.Log("TODO: Make dynamic based on employee speed");
Debug.Log("TODO: Update animation to having conversation");
Debug.Log("TODO: Implement chance of generating a task instead");
yield return new WaitForSeconds(2);
heldTickets.Add(assignedTable.GenerateOrder());
assignedTable.servicing = false;
assignedTable = null;
GainExp(gameStateController.baseExp);
assignmentType = AssignmentType.None;
busy = false;
}
private IEnumerator DropOffTickets() {
Debug.Log("TODO: Make dynamic based on employee speed");
Debug.Log("TODO: Update animation to dropping off tickets");
yield return new WaitForSeconds(1);
gameStateController.Cook(heldTickets);
heldTickets.Clear();
GainExp(gameStateController.baseExp);
assignmentType = AssignmentType.None;
busy = false;
}
private IEnumerator PickUpFood() {
Debug.Log("TODO: Make dynamic based on employee speed");
Debug.Log("TODO: Update animation to grabbing the order");
yield return new WaitForSeconds(1);
heldFood.Add(assignedOrder.PickUp());
assignedOrder = null;
GainExp(gameStateController.baseExp);
assignmentType = AssignmentType.None;
busy = false;
}
private IEnumerator DropOffFood() {
int i = 0;
bool droppedOff = false;
for (; i < heldFood.Count; i++) {
if (heldFood[i].destination.tableId == assignedTable.tableId) {
Debug.Log("TODO: Make dynamic based on employee speed");
Debug.Log("TODO: Update animation to dropping off food");
yield return new WaitForSeconds(2);
assignedTable.StartEating();
GainExp(gameStateController.baseExp);
droppedOff = true;
break;
}
}
if (droppedOff) {
heldFood.RemoveAt(i);
}
assignedTable.servicing = false;
assignedTable = null;
assignmentType = AssignmentType.None;
busy = false;
}
private IEnumerator PickUpDishes() {
Debug.Log("TODO: Make dynamic based on employee speed");
Debug.Log("TODO: Update animation to picking up dishes");
yield return new WaitForSeconds(2);
isHoldingPlates = true;
assignedTable.CleanUpDishes();
assignedTable.servicing = false;
assignedTable = null;
GainExp(gameStateController.baseExp);
assignmentType = AssignmentType.None;
busy = false;
}
private IEnumerator PickUpCheck() {
Debug.Log("TODO: Yay animation");
yield return new WaitForSeconds(1);
assignedTable.PickUpCheck();
GainExp(gameStateController.baseExp);
GainPay(assignedTable.GetPay(), assignedTable.GetTip());
assignedTable.servicing = false;
assignedTable = null;
assignmentType = AssignmentType.None;
busy = false;
}
void InteractWithTable() {
// Set animation and timeout for corresponding action from possibilities:
// If talent is leading employees, dump them at the table.
// Otherwise:
// TableState.Ready -> Table chooses between a food order and task
// TableState.WaitingOnOrder -> If the employee is holding the table's food, fulfills the order
// TableState.WaitingOnCheck -> Gather the check and empty the table of plates and guests.
assignedTable.servicing = true;
if (seatingParty != null) {
if (assignedTable.party == null && assignedTable.state == TableState.Empty) {
Debug.Log("TODO: Convert to Coroutine to take time seating a party");
assignedTable.AssignParty(seatingParty);
GainExp(gameStateController.baseExp);
seatingParty = null;
}
} else if (assignedTable.state != TableState.Empty) {
switch(assignedTable.state) {
case TableState.WaitingOnOrder:
// Coroutine should set assignedTable.servicing=false, assignedTable=null, assignmentType=None.
if (!isHoldingPlates && seatingParty == null && heldTickets.Count == 0) {
StartCoroutine("DropOffFood");
return;
}
break;
case TableState.WaitingOnCheck:
// Coroutine should set assignedTable.servicing=false, assignedTable=null, assignmentType=None.
StartCoroutine("PickUpCheck");
return;
case TableState.ReadyToOrder:
// Coroutine should set assignedTable.servicing=false, assignedTable=null, assignmentType=None.
if (!isHoldingPlates && seatingParty == null && heldFood.Count == 0) {
StartCoroutine("PickUpTicket");
return;
}
break;
case TableState.Plates:
// Coroutine should set assignedTable.servicing=false, assignedTable=null, assignmentType=None.
if (seatingParty == null && heldFood.Count == 0 && heldTickets.Count == 0) {
StartCoroutine("PickUpDishes");
return;
}
break;
default:
Debug.Log("TODO: Sound for un-interactable table, maybe");
break;
}
}
assignedTable.servicing = false;
assignmentType = AssignmentType.None;
assignedTable = null;
busy = false;
}
void InteractWithBar() {
// Drop off any held tickets from customers.
if (heldTickets.Count > 0) {
StartCoroutine("DropOffTickets");
return;
}
assignmentType = AssignmentType.None;
busy = false;
}
void InteractWithOrder() {
// Pick up an order at the waypoint.
// Should fail if the employee is holding anything other an another order.
if (assignedOrder.order != null && !isHoldingPlates && heldTickets.Count == 0 && seatingParty == null) {
StartCoroutine("PickUpFood");
return;
}
assignmentType = AssignmentType.None;
busy = false;
}
void InteractWithDishes() {
// Drop off any held dishes at the waypoint.
// Does nothing else.
if (isHoldingPlates) {
Debug.Log("TODO: Make a dish noise?");
GainExp(gameStateController.baseExp);
}
isHoldingPlates = false;
busy = false;
}
// If the front desk has a party queued, grab the party.
// Fails if busy or ineligible.
void InteractWithFrontDesk() {
if (isHoldingPlates || heldFood.Count > 0 || heldTickets.Count > 0 || seatingParty != null) {
Debug.Log("TODO: Play sound for failed queue interaction");
} else if (gameStateController.frontDeskQueue.Count == 0) {
Debug.Log("TODO: Play sound for empty queue");
} else {
Debug.Log("TODO: Parameterize front desk interact for particular party");
Party candidateParty = gameStateController.frontDeskQueue.Peek();
if (gameStateController.ValidateParty(candidateParty)) {
seatingParty = gameStateController.frontDeskQueue.Dequeue();
} else {
Debug.Log("TODO: Party grab failure sound");
}
}
busy = false;
}
// Update is called once per frame
void Update()
{
// This is true on the frame at which the employee reaches the waypoint.
if (!isAtWaypoint && aiLerp.reachedDestination) {
isAtWaypoint = true;
if (assignmentType == AssignmentType.Table && assignedTable != null) {
Debug.Log("I reached the table!");
InteractWithTable();
} else if (assignmentType == AssignmentType.Bar) {
Debug.Log("I reached the bar to drop off a ticket!");
InteractWithBar();
} else if (assignmentType == AssignmentType.Order) {
Debug.Log("I reached the bar to pick up an order!");
InteractWithOrder();
} else if (assignmentType == AssignmentType.Dishes) {
Debug.Log("I reached the dishes!");
InteractWithDishes();
} else if (assignmentType == AssignmentType.FrontDesk) {
Debug.Log("I reached the front desk!");
InteractWithFrontDesk();
}
}
// If the employee is available, pop the top of the queue and set it as a destination.
if (!busy && todo.Count > 0) {
Destination dest = todo.Dequeue();
NewDestination(dest.waypoint, dest.assignmentType, dest.assignedTable, dest.order);
}
// If another employee is servicing the assigned table, wait for them to finish.
if (assignedTable != null &&
assignedTable.servicing &&
Vector2.Distance(transform.position, assignedTable.waypoint.transform.position) <= maxServiceWaitDistance) {
aiLerp.canMove = false;
} else {
aiLerp.canMove = true;
}
}
private void LateUpdate() {
if (aiLerp.canMove) {
animator.SetInteger("hSpeed", (int)aiLerp.velocity.x);
animator.SetInteger("vSpeed", (int)aiLerp.velocity.y);
} else {
animator.SetInteger("hSpeed", 0);
animator.SetInteger("vSpeed", 0);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 17314c1a90889c042942aa23b294f835
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,37 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TalentListController : MonoBehaviour
{
[SerializeField] List<TalentTabController> talentTabs;
void updateTab(int tabIndex, bool active) {
if (tabIndex < 0 || tabIndex > talentTabs.Count) {
return;
}
if (GameData.IsPlayerUnlocked((Employee)tabIndex)) {
talentTabs[tabIndex].setPanelActive(active);
}
}
public void setActiveTab(int tabIndex) {
for (int i = 0; i < talentTabs.Count; i++) {
updateTab(i, i == tabIndex);
}
}
// Start is called before the first frame update
void Start() {
Debug.Log("TODO: Load a specific set in demo mode regardless of unlock status");
for (int i = 0; i < talentTabs.Count; i++) {
talentTabs[i].gameObject.SetActive(GameData.IsPlayerUnlocked((Employee)i));
}
}
// Update is called once per frame
void Update()
{
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 55524743610d27d40b6cbc71411bacbf
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TalentPanelController : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c8150f5d93e364a42ab7dc29e23e59af
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,54 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using TMPro;
public class TalentTabController : MonoBehaviour, IPointerDownHandler
{
[SerializeField] TalentPanelController panel;
[SerializeField] int tabIndex = -1;
[SerializeField] TextMeshProUGUI textName;
[SerializeField] TextMeshProUGUI textEnergy;
[SerializeField] TextMeshProUGUI textStatus;
[SerializeField] TextMeshProUGUI textTips;
[HideInInspector] GameStateController gameStateController;
public void OnPointerDown(PointerEventData eventData) {
gameStateController.HandleSelect(tabIndex);
}
public void setPanelActive(bool active) {
panel.gameObject.SetActive(active);
}
private void Awake() {
// All pop-up panels start inactive.
if (panel) {
panel.gameObject.SetActive(false);
}
}
// Start is called before the first frame update
void Start()
{
gameStateController = GameObject.FindGameObjectWithTag("GameStateController").GetComponent<GameStateController>();
// Load name and level from GameData.
textName.SetText(((Employee)tabIndex).ToString() + " LV" + GameData.GLOBAL.employeeStats[tabIndex].level);
Debug.Log("TODO: Load talent image and whatnot into tab from GameData");
}
private string GetTalentStatus() {
// TODO: Implement from talentState and Talent controller (maybe)
return "Somewhere";
}
private void LateUpdate() {
// Load current stats from TalentState.
textEnergy.SetText(gameStateController.talentState[tabIndex].energy.ToString());
textStatus.SetText(GetTalentStatus());
textTips.SetText("$" + gameStateController.talentState[tabIndex].tips.ToString());
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d421b28363a2eed4988c7725c29d4178
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: