Exemplo n.º 1
0
    public void EnteredRoom(EntryData data) // ToDo: Get info from AWAREPOINT, assign it to viarable "newInfo"
    {
        if (data.Type == "Person")
        {
            bool existing = false;

            foreach (GameObject p in persons)
            {
                if (p.GetComponent <PersonInfo>().GetPersonName().Equals(data.Name))
                {
                    existing = true;
                }
            }
            bool pending = persons[PendingPersonIdx].GetComponent <PersonInfo>().GetPersonName().Equals("");
            //Debug.Log("pending idx:" + PendingPersonIdx + "equals to null:" + pending);
            if (!existing && pending)
            {
                newInfo.ID    = data.ID;
                newInfo.name  = data.Name;
                newInfo.title = data.JobTitle;
                persons[PendingPersonIdx].GetComponent <PersonInfo>().SetBadgeInfo(newInfo);
                //Debug.Log(persons[PendingPersonIdx].name + "has been assigned Name: " + data.Name);
                if (persons[PendingPersonIdx].GetComponent <PersonInfo>().GetJobTitle().Equals("Patient"))
                {
                    //Debug.Log("patient name:" + data.Name + ", set line path to 0.");
                    LinePath linepath = persons[PendingPersonIdx].GetComponent <LinePath>();
                    linepath.enabled = true;
                    linepath.ResetLength();
                }
                trackintInterface.pendingAlarm = false;
            }
        }

        /*if (Input.GetKeyDown (KeyCode.Alpha8)) {
         *
         *      }
         *      if (Input.GetKeyDown (KeyCode.Alpha9)) {
         *              newInfo.name = "Nancy S";
         *              newInfo.title = "Nurse";
         *              return true;
         *      }
         *      if (Input.GetKeyDown (KeyCode.P)) {
         *              newInfo.name = "Peter Parker";
         *              newInfo.title = "Patient";
         *              return true;
         *      }*/
    }