Beispiel #1
0
    public string getStringHearInformation()
    {
        string str = "";

        foreach (GameObject obj in soundsInHearing)
        {
            str += SEPARATOR;
            str += "\nPosition: " + obj.transform.position;
            HearingProperties auxHearingProperties = obj.GetComponent <HearingProperties>();
            if (auxHearingProperties != null)
            {
                str += "\n" + auxHearingProperties.getHearingStatus();
            }
            else
            {
                str += "\nSound Type: " + HearingAttribute.unknownSound;
                str += "\nVolume: " + 0.0f;
            }
            str += "\n";
        }
        foreach (GameObject obj in knowObjInHearing)
        {
            str += SEPARATOR;
            str += "\nID: " + uIDD.getID(obj);
            HearingProperties auxHearingProperties = obj.GetComponent <HearingProperties>();
            if (auxHearingProperties != null)
            {
                str += "\n" + auxHearingProperties.getHearingStatus();
            }
            else
            {
                str += "\nSound Type: " + HearingAttribute.unknownSound;
                str += "\nVolume: " + 0.0f;
            }
            str += "\n";
        }
        return(str);
    }
Beispiel #2
0
    private string buildPropertiesString(GameObject gO)
    {
        string          sensesProperty     = "";
        string          especificProperty  = "";
        string          emotionProperty    = "";
        SmellProperties auxSmellProperties = gO.GetComponent <SmellProperties>();

        if (auxSmellProperties != null)
        {
            sensesProperty += auxSmellProperties.getSmellStatus();
        }

        TasteProperties auxTasteProperties = gO.GetComponent <TasteProperties>();

        if (auxTasteProperties != null)
        {
            sensesProperty += "\n" + auxTasteProperties.getTasteStatus();
        }

        HearingProperties auxHearingProperties = gO.GetComponent <HearingProperties>();

        if (auxHearingProperties != null)
        {
            sensesProperty += "\n" + auxHearingProperties.getHearingStatus();
        }

        TouchProperties auxTouchProperties = gO.GetComponent <TouchProperties>();

        if (auxTouchProperties != null)
        {
            sensesProperty += "\n" + auxTouchProperties.getTouchStatus();
        }

        VisionProperties auxVisionProperties = gO.GetComponent <VisionProperties>();

        if (auxVisionProperties != null)
        {
            sensesProperty += "\n" + auxVisionProperties.getVisionStatus();
        }
        EmotionStatus auxEmotionStatus = gO.GetComponent <EmotionStatus>();

        if (auxEmotionStatus != null)
        {
            emotionProperty = auxEmotionStatus.getEmotion().ToString();
        }
        Status auxStatus = gO.GetComponent <Status>();

        if (auxStatus != null)
        {
            especificProperty = auxStatus.getStringStatus();
        }



        string auxText = "ID: " + gO.GetInstanceID() + "\n" + gO.tag + ": " + gO.name +
                         "\nPosition: " + gO.transform.position;

        if (!sensesProperty.Equals("None"))
        {
            auxText += "\n" + sensesProperty;
        }
        if (emotionProperty.Equals(""))
        {
            emotionProperty = "None";
        }
        if (especificProperty.Equals(""))
        {
            especificProperty = "None";
        }
        auxText += "\nStatus: " + especificProperty;
        auxText += "\nEmotion: " + emotionProperty;

        return(auxText);
    }