Gameclient #9
@@ -10,7 +10,7 @@ public class Station : IInteractable
|
||||
public PlayerRole? ReqRole { get; set; }
|
||||
public float InteractionRange { get; set; }
|
||||
protected GameObject interfaceInstance;
|
||||
public GameObject Interface; // Prefab pro interakci (napø. UI pro úkol nebo sabotáže)
|
||||
public GameObject Interface { get; set; } // Prefab pro interakci (napø. UI pro úkol nebo sabotáže)
|
||||
|
||||
public virtual void Interact(PlayerRole role)
|
||||
{
|
||||
@@ -21,7 +21,7 @@ public class Station : IInteractable
|
||||
}
|
||||
else
|
||||
{
|
||||
interfaceInstance = UnityEngine.Object.Instantiate(Interface); // Zobrazí interakèní UI
|
||||
interfaceInstance = UnityEngine.Object.Instantiate(Interface); // Zobrazí interakèní UI
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public class Station : IInteractable
|
||||
}
|
||||
public class TaskStation : Station
|
||||
{
|
||||
public string TaskID { get; set; } // Unikátní ID úkolu pro server
|
||||
public string TaskID { get; set; } // Unikátní ID úkolu pro server
|
||||
private GameClient _gameClient;
|
||||
public TaskStation(Position pos, float interactionRange, GameClient gameClient, string taskID) : base(pos, interactionRange)
|
||||
{
|
||||
@@ -57,7 +57,7 @@ public class TaskStation : Station
|
||||
}
|
||||
private void ResumeTask()
|
||||
{
|
||||
interfaceInstance.SetActive(true); // Zobrazí interakèní UI
|
||||
interfaceInstance.SetActive(true); // Zobrazí interakèní UI
|
||||
}
|
||||
private void OnTaskCompleted(ITask task)
|
||||
{
|
||||
@@ -69,12 +69,12 @@ public class TaskStation : Station
|
||||
{
|
||||
if (task.IsCompleted)
|
||||
{
|
||||
UnityEngine.Object.Destroy(interfaceInstance); // Znièí interakèní UI
|
||||
UnityEngine.Object.Destroy(interfaceInstance); // Znièí interakèní UI
|
||||
Debug.Log($"Task {task.TaskName} completed and sent to server.");
|
||||
}
|
||||
else
|
||||
{
|
||||
interfaceInstance.SetActive(false); // Skryje interakèní UI
|
||||
interfaceInstance.SetActive(false); // Skryje interakèní UI
|
||||
Debug.Log($"Task {task.TaskName} was not completed, but exited.");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user