void YourOn() { if (Sub_CameraSwitcher == null) { Sub_CameraSwitcher = GameObject.FindObjectOfType <ModeSwitcher>(); } Sub_MainCamera = Sub_CameraSwitcher.BirdEyeCamera; }
/// <summary> /// Initializes a new instance of the <see cref="DigitalWatch.Watches.BasicWatch"/> class. /// </summary> /// <param name="watchDisplay">Watch display.</param> /// <param name="watchComponents">Watch components.</param> public BasicWatch(Display watchDisplay, WatchComponent[] watchComponents) { modeSwitcher = new SmartModeSwitcher <WatchComponent>(); modeSwitcher.AddModes(watchComponents); display = watchDisplay; InitDisplayListeners(); InitComponentListeners(watchComponents); modeSwitcher.GetCurrentMode().ForceScreenUpdate(); }
void YourOn() { if (Sub_CameraSwitcher == null) { Sub_CameraSwitcher = GameObject.FindObjectOfType <ModeSwitcher>(); Sub_WalkingCamera = Sub_CameraSwitcher.Walking_Camera; Sub_Comp_WalkingCamera = GameObject.FindObjectOfType <WalkingCamera>(); } }
void Start() { Sub_cameraSwitcher = GameObject.FindObjectOfType <ModeSwitcher>(); Sub_CenterOfRotation = Sub_cameraSwitcher.BirdEyeCamera.GetComponent <BirdEyeViewer>().CenterOfRotation.transform; if (GetComponent <Renderer>().material.HasProperty("_Color")) { OpaqueColor = new Color(GetComponent <Renderer>().material.color.r, GetComponent <Renderer>().material.color.g, GetComponent <Renderer>().material.color.b, 1); SemiTransparentColor = new Color(GetComponent <Renderer>().material.color.r, GetComponent <Renderer>().material.color.g, GetComponent <Renderer>().material.color.b, 0.5f); CompletelyTransparentColor = new Color(GetComponent <Renderer>().material.color.r, GetComponent <Renderer>().material.color.g, GetComponent <Renderer>().material.color.b, 0); } Comp_MeshFilter = GetComponent <MeshFilter>(); }
internal void CurrentMode_ShouldSwitchModeToPrimary_AfterFallbackTime(Action <ModeSwitcher> action) { // Arrange var fallbackTime = TimeSpan.FromSeconds(5); var switcher = new ModeSwitcher(fallbackTime); // Act action.Invoke(switcher); // Assert Assert.Equal(Mode.Fallback, switcher.CurrentMode); Thread.Sleep(fallbackTime.Add(TimeSpan.FromSeconds(1))); Assert.Equal(Mode.Primary, switcher.CurrentMode); }
public void Start() { modeSwitcher = eventsystem.GetComponent <ModeSwitcher>(); }
void Start() { Sub_cameraSwitcher = GameObject.FindObjectOfType <ModeSwitcher>(); Sub_FreeCamera = GameObject.FindObjectOfType <FreeCameraHandler>(); }
public void ChangeRoom() { #region Preventing Screen from Sleeping Screen.sleepTimeout = SleepTimeout.NeverSleep; #endregion #region Initializing Scene if (Furniture) { Destroy(Furniture.gameObject); } if (Environment) { Destroy(Environment.gameObject); } Furniture = new GameObject("Furniture"); Environment = new GameObject("Environment"); Environment.transform.parent = this.transform; RenderSettings.ambientLight = AmbientColor; // GameObject.FindObjectOfType<BirdEyeViewer>().camera.backgroundColor = AmbientColor; #endregion #region Initializing Variables floors = new List <GameObject>(); deviceList = new List <GameObject>(); deviceList_DeviceComponent = new List <Device>(); DictionaryOfIDDevicePair = new Dictionary <string, Device>(); #endregion #region Finding Refrence to Important Scripts Sub_CameraSwitcher = GameObject.FindObjectOfType <ModeSwitcher>(); #endregion #region Loading Furnitures switch (WhichRoomToLoad) { case 0: { textAsset = (TextAsset)Resources.Load("RoomFurnitureXML"); break; } default: { Debug.Log("Check WhihRoomToLoad value!"); break; } } // build objects according to information in the XML file ConfigureFurnituresWithString(textAsset.text); #endregion #region Loading Devices from XML. If It's the first time program runs, we load devices from a preloaded XML. If not we load from last saved XML. try { switch (WhichRoomToLoad) { case 0: { Configure(Application.persistentDataPath + "/Room0XML.xml"); break; } case 1: { Configure(Application.persistentDataPath + "/Room1XML.xml"); break; } case 2: { Configure(Application.persistentDataPath + "/Room2XML.xml"); break; } case 3: { Configure(Application.persistentDataPath + "/Room3XML.xml"); break; } case 4: { Configure(Application.persistentDataPath + "/Room4XML.xml"); break; } default: { Debug.Log("Check WhichRoomToLoad value!"); break; } } //Configure(Application.persistentDataPath + "/Room" + WhichRoomToLoad + "XML"); Debug.Log("Loaded from PersistentDataPath Folder"); } catch { switch (WhichRoomToLoad) { case 0: { textAsset = (TextAsset)Resources.Load("RoomXML"); break; } default: { Debug.Log("Check WhichRoomToLoad value!"); break; } } ConfigureWithString(textAsset.text); } #endregion #region Saving Devices XML XMLGenarator tempGenerator = new XMLGenarator(); #endregion #region [Test] Trying to Interpret Command XML try { ConfigCommandFile(); } catch { Debug.Log("Couldn't Parse Command XML"); } #endregion #region Calculating Floors mid position for BirdEyeCamera for (int f = 0; f < floors.Count; f++) { floorPosition += floors[f].transform.position; } floorPosition = floorPosition / (float)floors.Count; #endregion }