Fix some bugs
This commit is contained in:
@@ -250,7 +250,7 @@ public class CameraController : MonoBehaviour
|
||||
if (currentGuardManager != null)
|
||||
{
|
||||
DialogManager.Instance.StartDialog(currentGuardManager);
|
||||
talkButton.gameObject.SetActive(false);
|
||||
// talkButton.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,10 @@ public class CupShuffle : Singleton<CupShuffle>
|
||||
sorted[0].GetComponent<DoorManager>().mod = "#LEFT";
|
||||
sorted[1].GetComponent<DoorManager>().mod = "#CENTER";
|
||||
sorted[2].GetComponent<DoorManager>().mod = "#RIGHT";
|
||||
|
||||
LevelLoader.Instance.Doors[0] = sorted[0].GetComponent<DoorManager>();
|
||||
LevelLoader.Instance.Doors[1] = sorted[1].GetComponent<DoorManager>();
|
||||
LevelLoader.Instance.Doors[2] = sorted[2].GetComponent<DoorManager>();
|
||||
}
|
||||
|
||||
IEnumerator SwapSlots(int slotA, int slotB)
|
||||
|
||||
@@ -30,6 +30,15 @@ public class DoorManager : MonoBehaviour, IDescribable
|
||||
void Start()
|
||||
{
|
||||
indicatorLight = transform.FindChildRecursive("IndicatorLight").GetComponent<LightFlickerer>();
|
||||
|
||||
//trolley problerm indicatgor
|
||||
var oneDeath = transform.FindChildRecursive("ONEDEATH");
|
||||
var manyDeath = transform.FindChildRecursive("MANYDEATH");
|
||||
oneDeath.gameObject.SetActive(false);
|
||||
manyDeath.gameObject.SetActive(false);
|
||||
|
||||
|
||||
|
||||
if (mod == "BLUE")
|
||||
{
|
||||
// this.GetComponentInChildren<Renderer>().material = blueMaterial;
|
||||
@@ -40,6 +49,19 @@ public class DoorManager : MonoBehaviour, IDescribable
|
||||
// this.GetComponentInChildren<Renderer>().material = redMaterial;
|
||||
indicatorLight.initialColor = Color.red;
|
||||
}
|
||||
else if (mod == "GREEN")
|
||||
{
|
||||
// this.GetComponentInChildren<Renderer>().material = redMaterial;
|
||||
indicatorLight.initialColor = Color.green;
|
||||
}
|
||||
else if (mod == "#ONE")
|
||||
{
|
||||
oneDeath.gameObject.SetActive(true);
|
||||
}
|
||||
else if (mod == "#MANY")
|
||||
{
|
||||
manyDeath.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
focusLight = transform.FindChildRecursive("FocusLight").GetComponent<Light>();
|
||||
}
|
||||
@@ -55,7 +77,7 @@ public class DoorManager : MonoBehaviour, IDescribable
|
||||
{
|
||||
focusLight.intensity += Time.deltaTime * 100;
|
||||
}
|
||||
else if (isfocussed == 0 && focusLight.intensity > 30)
|
||||
else if (isfocussed == 0 && focusLight.intensity > 60)
|
||||
{
|
||||
focusLight.intensity -= Time.deltaTime * 100;
|
||||
}
|
||||
@@ -123,14 +145,14 @@ public class DoorManager : MonoBehaviour, IDescribable
|
||||
|
||||
public string GetUnknownDescription()
|
||||
{
|
||||
if (mod == "RED" || mod == "BLUE" || mod == "PLAIN")
|
||||
if (mod == "RED" || mod == "BLUE" || mod == "GREEN")
|
||||
{
|
||||
return $"the {mod} door";
|
||||
return $"the {mod.ToLower()} door";
|
||||
}
|
||||
|
||||
if (mod == "#LEFT" || mod == "#CENTER" || mod == "#RIGHT")
|
||||
{
|
||||
return $"the {mod.Replace("#","")} door";
|
||||
return $"the {mod.Replace("#","").ToLower()} door";
|
||||
}
|
||||
// add more modification here
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public class GuardManager : MonoBehaviour, IDescribable
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
if (mod == "SHORT")
|
||||
if (mod == "BLUE")
|
||||
{
|
||||
GetComponentInChildren<Renderer>().material = GuardMaterials.ByKey("OTHER");
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class GuardManager : MonoBehaviour, IDescribable
|
||||
{
|
||||
focusLight.intensity += Time.deltaTime * 100;
|
||||
}
|
||||
else if (isfocussed == 0 && focusLight.intensity > 30)
|
||||
else if (isfocussed == 0 && focusLight.intensity > 60)
|
||||
{
|
||||
focusLight.intensity -= Time.deltaTime * 100;
|
||||
}
|
||||
@@ -170,9 +170,9 @@ public class GuardManager : MonoBehaviour, IDescribable
|
||||
|
||||
public string GetUnknownDescription()
|
||||
{
|
||||
if (mod == "SHORT")
|
||||
if (mod == "BLUE")
|
||||
{
|
||||
return "the short guard";
|
||||
return "the blue guard";
|
||||
}
|
||||
else if (mod == "HAT")
|
||||
{
|
||||
@@ -188,7 +188,7 @@ public class GuardManager : MonoBehaviour, IDescribable
|
||||
}
|
||||
else
|
||||
{
|
||||
return "the plain guard";
|
||||
return "the red guard";
|
||||
}
|
||||
// add more modification here
|
||||
}
|
||||
|
||||
@@ -91,7 +91,12 @@ public class LevelLoader : Singleton<LevelLoader>
|
||||
for(int i = 0; i < data.guards.Count; i++)
|
||||
{
|
||||
var guardinstance = Instantiate(GuardPrefabs.ByKey(data.guards[i].type));
|
||||
guardinstance.transform.position = new Vector3(spacingGuards*(i+1), 0, -5);
|
||||
|
||||
//its late, i cant think straight
|
||||
var offset = i == data.guards.Count - 1 ? -2 : 2;
|
||||
offset = data.guards.Count == 1 ? 0 : offset;
|
||||
|
||||
guardinstance.transform.position = new Vector3(spacingGuards*(i+1)+offset, 0, -5);
|
||||
|
||||
var manager = guardinstance.GetComponent<GuardManager>();
|
||||
manager.type = data.guards[i].action;
|
||||
|
||||
@@ -28,8 +28,8 @@ public class StatusManager : Singleton<StatusManager>
|
||||
|
||||
public void PopulatePanels()
|
||||
{
|
||||
PopulatePanel(doorPanel, doorPrefab, LevelLoader.Instance.Doors.Cast<IDescribable>().ToList(),false, LevelLoader.Instance.GlobalModifier == "HIDE");
|
||||
PopulatePanel(guardPanel, guardPrefab, LevelLoader.Instance.Guards.Cast<IDescribable>().ToList(), false, false);
|
||||
PopulatePanel(doorPanel, doorPrefab, LevelLoader.Instance.Doors.Cast<IDescribable>().ToList().Shuffle(),false, LevelLoader.Instance.GlobalModifier == "HIDE");
|
||||
PopulatePanel(guardPanel, guardPrefab, LevelLoader.Instance.Guards.Cast<IDescribable>().ToList().Shuffle(), false, false);
|
||||
|
||||
PopulatePanel(doorPanelThoughts, doorPrefab, LevelLoader.Instance.Doors.Cast<IDescribable>().ToList(),true, LevelLoader.Instance.GlobalModifier == "HIDE");
|
||||
PopulatePanel(guardPanelThoughts, guardPrefab, LevelLoader.Instance.Guards.Cast<IDescribable>().ToList(), true, false);
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Utils
|
||||
{
|
||||
public static class ListExtensions
|
||||
{
|
||||
public static void Shuffle<T>(this List<T> list)
|
||||
public static List<T> Shuffle<T>(this List<T> list)
|
||||
{
|
||||
for (int i = list.Count - 1; i > 0; i--)
|
||||
{
|
||||
@@ -13,6 +13,8 @@ namespace Utils
|
||||
|
||||
(list[i], list[j]) = (list[j], list[i]);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public static T GetRandomAndRemove<T>(this List<T> list)
|
||||
|
||||
Reference in New Issue
Block a user