Newer
Older
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using System.IO;
using UnityEngine.Video;//streaming
using UnityEngine.Networking;
//using static StreamingAssetLoader;
//using static CheckServer;
//using static CommunicationEvents;
using static UIconfig;
public class MainPlayerMode_Ctrl : MonoBehaviour
{
Stefan Richter
committed
//public int myUI_ID;
public GameObject myself_GObj;
//public GameObject parent_GObj;
//public int backUI_ID;
//public int optionsUI_ID;
//public int failedUI_ID;
public GameObject FirstPerson_GObj;
public GameObject FirstPersonOldInpOrig_GObj;
public GameObject ThirdPerson_Shoulder_GObj;
public GameObject ThirdPerson_dampedCam_GObj;
public GameObject ThirdPerson_manualCam_GObj;
public GameObject Escaperoom_GObj;
public GameObject Sidescroller_GObj;
Stefan Richter
committed
public GameObject Moorhuhn_GObj;
public GameObject NoInput_GObj;
//public GameObject Position_ofActivePlayer;
public GameObject Camera_ofActivePlayer;
Stefan Richter
committed
private int GpMode_before = -99;
void Start()
{
Update2();
}
private void Update()
{
if (InputDisable)
{
if (GpMode_before!= -100)
{
//Camera_ofActivePlayer.SetActive(false);
//Camera_ofActivePlayer.SetActive(true);
ClearUIC();
GpMode_before = -100;
}
}
if (!InputDisable && GpMode_before != UIconfig.GameplayMode)
//print(UIconfig.GameplayMode);
}
}
private void Update2(){
//Todo Eventbased
ClearUIC();
print("Active_Gameplaymode: "+ UIconfig.GameplayMode);
switch (UIconfig.GameplayMode)
{
case 0:
Moorhuhn_GObj.SetActive(true);
Escaperoom_GObj.SetActive(true);
ThirdPerson_manualCam_GObj.SetActive(true);
UIconfig.interactingRangeMode = InteractingRangeMode.fromObserverView;
ThirdPerson_dampedCam_GObj.SetActive(true);
UIconfig.interactingRangeMode = InteractingRangeMode.fromObserverView;
FirstPerson_GObj.SetActive(true);
FirstPersonOldInpOrig_GObj.SetActive(true);
ThirdPerson_Shoulder_GObj.SetActive(true);
UIconfig.interactingRangeMode = InteractingRangeMode.fromObserverView;
Stefan Richter
committed
case 8:
Sidescroller_GObj.SetActive(true);
Stefan Richter
committed
break;
default:
break;
}
GpMode_before = UIconfig.GameplayMode;
}
/// <summary>
/// Deactivates all Pages.
/// </summary>
private void ClearUIC()
{
for (int i = 0; i < myself_GObj.transform.childCount; i++)
{
myself_GObj.transform.GetChild(i).gameObject.SetActive(false);
}
}
}