void Awake()
 {
     sectionRendering = GameObject.Find("IngameScene").GetComponent <SectionRendering>();
     sceneEventSystem = sectionRendering.GetComponent <SceneEventSystem>();
     player           = sceneEventSystem.Player;
     playerRayCast    = player.GetComponent <PlayerRayCast>();
     playerProperty   = player.GetComponent <PlayerProperty>();
     floorEntrance    = GameObject.Find("FloorEntrance");
 }
    void OnEnable()
    {
        sectionRendering = sceneEventSystem.GetComponent <SectionRendering>();
        sectionRendering.FloorInit(sectionList, doorList);
        Transform zombies = GameObject.Find("1FZombies").transform;

        if (currentFloorUI.GetComponent <Text>().text != "1F")
        {
            currentFloorUI.UIupdate("1F");
        }
        for (int i = 0; i < zombies.childCount; i++)
        {
            if (zombies.GetChild(i).gameObject.activeInHierarchy)
            {
                zombies.GetChild(i).GetComponent <Enemy>().StartFSM();
            }
        }
    }
    void OnEnable()
    {
        Transform zombies = GameObject.Find("2FZombies").transform;

        waitTime         = new WaitForFixedUpdate();
        sectionRendering = sceneEventSystem.GetComponent <SectionRendering>();
        sectionRendering.FloorInit(sectionList, doorList);
        currentFloorUI.UIupdate("2F");

        for (int i = 0; i < zombies.childCount; i++)
        {
            if (zombies.GetChild(i).gameObject.activeInHierarchy)
            {
                zombies.GetChild(i).GetComponent <Enemy>().StartFSM();
            }
        }

        if (!IsBroadcasted)
        {
            StartCoroutine(MovedZombieDirect());
        }
    }
Beispiel #4
0
 public void FloorInit()
 {
     sectionRendering = sceneEventSystem.GetComponent <SectionRendering>();
     sectionRendering.FloorInit(sectionList, doorList);
 }