Exemplo n.º 1
0
 private void Awake()
 {
     if (Instance)
     {
         DestroyImmediate(this);
         return;
     }
     instance = this;
     GetCameraSizes();
 }
Exemplo n.º 2
0
 private void initItem(Item i, Vector3 initialPos)
 {
     //TODO: Polymorphie beutzen ansonsten unnötig, doppelter code
     Debug.Log("add item");
     Debug.Log(i.name);
     if (i.type.Equals("Switch") || i.type.Equals("Dimmer"))
     {
         GameObject         newSwitch = Instantiate(switchPrefab, initialPos, Quaternion.identity);
         PositioningManager pm        = newSwitch.GetComponent <PositioningManager>();
         OnSelectSwitch     oss       = newSwitch.GetComponent <OnSelectSwitch>();
         oss.ItemUrl = i.link;
         pm.ObjectAnchorStoreName = i.name;
         itemObjects.Add(i.name, newSwitch);
         newSwitch.BroadcastMessage("OnUpdate", i.state);
     }
     else if (i.type.Equals("Rollershutter"))
     {
         GameObject         newRollerShutter = Instantiate(rollershutterPrefab, initialPos, Quaternion.identity);
         PositioningManager pm  = newRollerShutter.GetComponent <PositioningManager>();
         BasicItemHandler   bih = newRollerShutter.GetComponent <BasicItemHandler>();
         bih.ItemUrl = i.link;
         pm.ObjectAnchorStoreName = i.name;
         itemObjects.Add(i.name, newRollerShutter);
         newRollerShutter.BroadcastMessage("OnUpdate", i.state);
     }
     else if (i.type.Equals("Color"))
     {
         GameObject         newColor = Instantiate(ColorPrefab, initialPos, Quaternion.identity);
         PositioningManager pm       = newColor.GetComponent <PositioningManager>();
         BasicItemHandler   bih      = newColor.GetComponent <BasicItemHandler>();
         bih.ItemUrl = i.link;
         pm.ObjectAnchorStoreName = i.name;
         itemObjects.Add(i.name, newColor);
         newColor.BroadcastMessage("OnUpdate", i.state);
     }
 }