Ejemplo n.º 1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "Player")
     {
         if (!done)
         {
             MyRoomData otherData = other.gameObject.GetComponent <RoomObject>().data;
             if (CheckPersonnelCount(otherData))
             {
                 foreach (GameObject person in personObjects)
                 {
                     MyPersonData personData = person.GetComponent <PersonPrefab>().data;
                     if (otherData.id == personData.id)
                     {
                         person.transform.SetParent(activePanel, false);
                     }
                 }
                 menuController.ShowPersonnelPanel();
             }
             else
             {
                 menuController.HidePersonnelPanel();
             }
             roomName.text = otherData.room_name;
             roomDesc.text = otherData.room_desc;
             menuController.ShowRoomInfo();
             done = true;
         }
     }
     else if (other.gameObject.tag == "GroundFloor")
     {
         if (groundF)
         {
             var newMask = oldMask & ~(1 << 13);
             newMask             = newMask & ~(1 << 9);
             newMask             = newMask | (1 << 8);
             newMask             = newMask | (1 << 12);
             miniMap.cullingMask = newMask;
             groundF             = false;
             ShowFurniture("Basement");
         }
         else
         {
             var newMask = oldMask & ~(1 << 8);
             newMask             = newMask & ~(1 << 12);
             newMask             = newMask | (1 << 9);
             newMask             = newMask | (1 << 13);
             miniMap.cullingMask = newMask;
             groundF             = true;
             ShowFurniture("Ground");
         }
     }
     else if (other.gameObject.tag == "SecondFloor")
     {
         if (secondF)
         {
             var newMask = oldMask & ~(1 << 10);
             newMask             = newMask & ~(1 << 14);
             newMask             = newMask | (1 << 9);
             newMask             = newMask | (1 << 13);
             miniMap.cullingMask = newMask;
             groundF             = true;
             secondF             = false;
             ShowFurniture("Ground");
         }
         else
         {
             var newMask = oldMask & ~(1 << 13);
             newMask             = newMask & ~(1 << 9);
             newMask             = newMask | (1 << 10);
             newMask             = newMask | (1 << 14);
             miniMap.cullingMask = newMask;
             groundF             = false;
             secondF             = true;
             ShowFurniture("Second");
         }
     }
     else if (other.gameObject.tag == "Entrance")
     {
         var newMask = oldMask & ~(1 << 8);
         newMask             = newMask & ~(1 << 12);
         newMask             = newMask | (1 << 9);
         newMask             = newMask | (1 << 13);
         miniMap.cullingMask = newMask;
         groundF             = true;
         ShowFurniture("Ground");
     }
 }
Ejemplo n.º 2
0
 public void Setup(MyPersonData data)
 {
     this.data     = data;
     fullname.text = "<u>" + data.first_name + " " + data.last_name + "</u>" + "\n" + data.job_position;
 }