Partiially working Timeslot-change and Heat Reciever on Targets
This commit is contained in:
@@ -18,8 +18,9 @@ public class FillDopdownWithScenes : MonoBehaviour
|
||||
dropdown.ClearOptions();
|
||||
|
||||
List<string> sceneNames = new List<string>();
|
||||
//sceneNames.Add("none");
|
||||
|
||||
for (int i = 0; i < SceneManager.sceneCountInBuildSettings; i++)
|
||||
for (int i = 1; i < SceneManager.sceneCountInBuildSettings; i++)
|
||||
{
|
||||
string path = SceneUtility.GetScenePathByBuildIndex(i);
|
||||
string name = System.IO.Path.GetFileNameWithoutExtension(path);
|
||||
|
||||
@@ -66,7 +66,7 @@ public class FlushAndLoad : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleSceneIdReady(string id, List<GameObject> doors)
|
||||
private void HandleSceneIdReady(string id, List<GameObject> doors, List<RecieveHeat> targets)
|
||||
{
|
||||
sceneId = id;
|
||||
if (id == "Room1")
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class RecieveHeat : MonoBehaviour
|
||||
{
|
||||
private float heatLevel;
|
||||
private Material myMat;
|
||||
private void Start()
|
||||
{
|
||||
myMat = GetComponent<Renderer>().material;
|
||||
}
|
||||
|
||||
public void SetHeat(float heat)
|
||||
{
|
||||
if (heat > 255) return;
|
||||
heatLevel = heat;
|
||||
myMat.color = new Color(heatLevel,0,0);
|
||||
}
|
||||
|
||||
public void AddHeat(float heat)
|
||||
{
|
||||
heatLevel += heat;
|
||||
myMat.color = new Color(heatLevel, 0, 0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 60276d638c326f64e8ef8d871e7bb6fa
|
||||
@@ -10,10 +10,12 @@ public class ReplaySceneLoader : MonoBehaviour
|
||||
private int currentScene;
|
||||
public void LoadSceneAdditive(int sceneIndex)
|
||||
{
|
||||
sceneIndex += 1;
|
||||
if(SceneManager.loadedSceneCount > 1)
|
||||
{
|
||||
SceneManager.UnloadSceneAsync(currentScene);
|
||||
}
|
||||
//if (sceneIndex == 0) return;
|
||||
SceneManager.LoadSceneAsync(sceneIndex, LoadSceneMode.Additive);
|
||||
currentScene = sceneIndex;
|
||||
|
||||
|
||||
@@ -14,8 +14,9 @@ public class RoomManager : MonoBehaviour
|
||||
public List<GameObject> furnitures;
|
||||
public List<GameObject> portals;
|
||||
public List<GameObject> enemies;
|
||||
public List<RecieveHeat> targets;
|
||||
|
||||
public static event Action<string, List<GameObject>> OnSceneIdReady; // um das Replay erst auszulösen, wenn die SceneId da ist, die nun über die RoomPrefs festgelegt wird.
|
||||
public static event Action<string, List<GameObject>, List<RecieveHeat>> OnSceneIdReady; // um das Replay erst auszulösen, wenn die SceneId da ist, die nun über die RoomPrefs festgelegt wird.
|
||||
GhostRecorderBatch ghostRecorder;
|
||||
|
||||
public void Awake()
|
||||
@@ -48,7 +49,7 @@ public class RoomManager : MonoBehaviour
|
||||
foreach (GameObject enemy in enemies) enemy.SetActive(true);
|
||||
}
|
||||
sceneId = myRoom.sceneId;
|
||||
OnSceneIdReady?.Invoke(sceneId, doors);
|
||||
OnSceneIdReady?.Invoke(sceneId, doors, targets);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user