setting up character manager

This commit is contained in:
Amaan Shawkath
2023-07-08 17:06:32 +01:00
parent b592bfcf61
commit 92fd23b6f0
5 changed files with 112 additions and 0 deletions

8
Assets/Gameobjects.meta Normal file
View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 43937033b1689e64e8504a87a50f6832
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,48 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3948773691345320346
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6462895877521634942}
- component: {fileID: 1767811258655682326}
m_Layer: 0
m_Name: CharacterManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6462895877521634942
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3948773691345320346}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 365.75354, y: 364.61804, z: -637.4724}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1767811258655682326
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3948773691345320346}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: afced2bc2620add47923c6430dfb713e, type: 3}
m_Name:
m_EditorClassIdentifier:
m_characterDatas:
- {fileID: 11400000, guid: fe5c0edf44ede8146ac344d9538dafc6, type: 2}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: cdba23405af5bfc41aae17526e8cb01e
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,38 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using UnityEngine;
public class CharacterManager : MonoBehaviour
{
public static CharacterManager Instance;
[SerializeField] private List<CharacterData> m_characterDatas;
public ReadOnlyCollection<CharacterData> CharacterDatas => m_characterDatas.AsReadOnly();
private Dictionary<string, bool> m_interviewed = new Dictionary<string, bool>();
private void Awake()
{
if (Instance == null)
{
Instance = this;
}
else
{
Debug.LogWarning("There can only be one instance of the CharacterManager class");
}
}
// Returns if a character has been interviewed.
public bool CharacterInterviewed(string name)
{
return m_interviewed.ContainsKey(name);
}
// Stores a character as interviewed.
public void SetInterviewed(string name)
{
m_interviewed.Add(name, true);
}
}

View File

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