university add courses for basic school

This commit is contained in:
2024-05-23 22:18:20 +03:00
parent 02f5da669f
commit 83917edcc6
14 changed files with 374 additions and 112 deletions
+8 -3
View File
@@ -18,7 +18,7 @@ public class Player : BaseCharacter
private List<EducationInfoSO> _completedCourses = new();
public EducationInfoSO ActiveCourse { get; set; }
public EducationSkill Education { get; set; }
private int _educationPoints = 0;
private ContainerItem _containerItem;
private string _locationName;
@@ -160,8 +160,13 @@ public class Player : BaseCharacter
ActiveCourse.PlayerProgress += time.Hours;
if (ActiveCourse.PlayerProgress >= ActiveCourse.Duration)
{
Education++;
print($"Congratulation player finish curse {ActiveCourse.Description} and his education now {Education.ToString()}");
_educationPoints++;
if(_educationPoints == 2)
{
Education++;
print($"Congratulation player finish {Education - 1} and his education now {Education}");
}
_completedCourses.Add(ActiveCourse);
ActiveCourse = null;
}
}
+1 -1
View File
@@ -15,7 +15,7 @@ public class Bed : BaseInteractableObject
private void OnAnimationFinished()
{
GameManager.Instance.UI.ShowTimeSliderDialog("Go to sleep", "Sleep until", OnCancel, OnConfirm);
GameManager.Instance.UI.ShowTimeSliderDialog("Sleep", "Wake up in", OnCancel, OnConfirm);
}
private void OnCancel()
{
@@ -1,6 +1,5 @@
using Assets.Scripts.Interfaces;
using System;
using Unity.VisualScripting;
using UnityEngine;
public class SecretaryDesk : BaseInteractableObject
@@ -23,7 +22,7 @@ public class SecretaryDesk : BaseInteractableObject
GameManager.Instance.UI.ShowTabOptionsDialog(_dialogSO, null, OnConfirm);
break;
case RadialMenuActions.Learn:
GameManager.Instance.UI.ShowTimeSliderDialog("Learn", "learn until", OnCancel, OnLearnConfirm);
GameManager.Instance.UI.ShowTimeSliderDialog("Learn", $"learn {_player.ActiveCourse.name} in next", OnCancel, OnLearnConfirm);
break;
}
}
@@ -34,10 +33,12 @@ public class SecretaryDesk : BaseInteractableObject
GameManager.Instance.Time.OnFastForwardEnd += OnFastForwardEnd;
_player.Learn(time);
}
private void OnCancel()
{
OnFastForwardEnd();
}
private void OnFastForwardEnd()
{
_player.SetPlayerActing(PlayerStates.Awake);
@@ -16,3 +16,4 @@ MonoBehaviour:
Icon: {fileID: 21300000, guid: aef64b4574ccbc74897f2d9cd98cdf12, type: 3}
OptionsList:
- {fileID: 11400000, guid: b2f41f944cd1f3f4f82130491c97d5da, type: 2}
- {fileID: 11400000, guid: e6b1a370027e47b4baf047386f663e02, type: 2}
@@ -0,0 +1,20 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3ba71c02cddb93d408c7c1b2f9846099, type: 3}
m_Name: Literarure
m_EditorClassIdentifier:
Icon: {fileID: 21300000, guid: 03db7f2d5bccf674c95ce74426db7fbb, type: 3}
Description: 'Literature '
Duration: 5
EnrollPrice: 10
Skill: 0
PlayerProgress: 0
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b2f41f944cd1f3f4f82130491c97d5da
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: b2f41f944cd1f3f4f82130491c97d5da
guid: e6b1a370027e47b4baf047386f663e02
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
+3 -1
View File
@@ -10,6 +10,8 @@ public class TimeSliderUI : MonoBehaviour
[SerializeField]
private TextMeshProUGUI _description;
[SerializeField]
private TextMeshProUGUI _timeText;
[SerializeField]
private Button _btnCancel;
[SerializeField]
private Button _btnOk;
@@ -55,7 +57,7 @@ public class TimeSliderUI : MonoBehaviour
if (gameObject.activeSelf)
{
_time = TimeSpan.FromHours(time);
_description.text = $"{_time.Hours} hours";
_timeText.text = $"{_time.Hours} hours";
}
}