ui environment changes, fix multiple inits
This commit is contained in:
@@ -24,6 +24,7 @@ public abstract class BaseCharacter : MonoBehaviour
|
||||
{
|
||||
_animator = GetComponentInChildren<Animator>();
|
||||
_characterDescriptor = GetComponentInChildren<CharacterDescriptor>();
|
||||
if (_characterDescriptor == null) throw new Exception("Character descriptor not found");
|
||||
_characterSex = _characterDescriptor.Sex;
|
||||
SetPlayerAnimation(AnimationStates.Walking);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,9 @@ public class CharacterDescriptor : MonoBehaviour
|
||||
|
||||
private void OnAnimatorMove()
|
||||
{
|
||||
transform.parent.position = _navMeshAgent.nextPosition;
|
||||
if (_navMeshAgent != null)
|
||||
{
|
||||
transform.parent.position = _navMeshAgent.nextPosition;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
{
|
||||
Task = task;
|
||||
TagretObject = gameObject;
|
||||
Status = TaskStatus.Waiting;
|
||||
Status = TaskStatus.None;
|
||||
}
|
||||
|
||||
public void UpdateStatus(TaskStatus status)
|
||||
|
||||
@@ -6,7 +6,7 @@ public enum EducationSkill { NotEducated, School, HightSchool, University };
|
||||
public enum PlayerStates { Awake, Sleeping, Eating, Working }
|
||||
public enum StatsId { Money, RentAccount, Food, Energy, BankAccount, Job, LocationName }
|
||||
public enum Tasks { Move, Interact, Rotate };
|
||||
public enum TaskStatus { Waiting, InProgress, Complete };
|
||||
public enum TaskStatus { None,Waiting, InProgress, Complete };
|
||||
public enum InteractionStatus { None, Complete, WaitForChoose, InProgress, FarFromPlayer };
|
||||
public enum AnimationStates
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ public class CashierDesk : BaseInteractableObject
|
||||
|
||||
protected override void PrepareMenuActions()
|
||||
{
|
||||
_playerJob = _jobsInfoList.Where(x => x.JobPosition == _player.JobPosition).FirstOrDefault();
|
||||
_playerJob = _jobsInfoList.FirstOrDefault(x => x.JobPosition == _player.JobPosition);
|
||||
if (_playerJob != null)
|
||||
_menuActions[RadialMenuActions.Work].IsEnabled = true;
|
||||
|
||||
|
||||
@@ -35,34 +35,33 @@ public class GameManager : MonoBehaviour
|
||||
_timeSystem = new TimeSystem();
|
||||
_gameMouseHandler = new InGameMouseHandler(_cameraSystem.MainCamera);
|
||||
}
|
||||
else
|
||||
Destroy(gameObject);
|
||||
}
|
||||
private void OnEnable()
|
||||
{
|
||||
_inputSystem.Enable();
|
||||
Instance._inputSystem.Enable();
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
_inputSystem.Disable();
|
||||
Instance._inputSystem.Disable();
|
||||
}
|
||||
|
||||
public void Pause()
|
||||
{
|
||||
_isPause = true;
|
||||
Instance._isPause = true;
|
||||
}
|
||||
|
||||
internal void Resume()
|
||||
{
|
||||
_isPause = false;
|
||||
Instance._isPause = false;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (!_isPause)
|
||||
if (!Instance._isPause)
|
||||
{
|
||||
_gameMouseHandler.Update();
|
||||
_timeSystem.UpdateTime();
|
||||
Instance._gameMouseHandler.Update();
|
||||
Instance._timeSystem.UpdateTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,6 @@ public class SceneManager
|
||||
_spawnLocationName = spawnLocationName;
|
||||
|
||||
UnityEngine.SceneManagement.SceneManager.LoadScene(sceneName);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void SceneManager_sceneLoaded(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1)
|
||||
|
||||
@@ -15,5 +15,5 @@ MonoBehaviour:
|
||||
Icon: {fileID: 0}
|
||||
Description: Manager
|
||||
Salary: 9
|
||||
JobPosition: 0
|
||||
MinimumEducationSkill: 0
|
||||
JobPosition: 4
|
||||
MinimumEducationSkill: 2
|
||||
|
||||
@@ -15,5 +15,5 @@ MonoBehaviour:
|
||||
Icon: {fileID: 0}
|
||||
Description: Manager assistaint
|
||||
Salary: 6
|
||||
JobPosition: 0
|
||||
MinimumEducationSkill: 0
|
||||
JobPosition: 3
|
||||
MinimumEducationSkill: 1
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class StartUp : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
GameManager.Instance.Scene.Change("City",string.Empty);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a2308c7357aa6fe46b0c1dc06cab6865
|
||||
Reference in New Issue
Block a user