Example #1
0
    public string getStringVisionInformation()
    {
        string str = "";

        foreach (GameObject obj in objectsInFildOfVision)
        {
            if (!isHiddenObject(obj))
            {
                str += SEPARATOR;
                str += "\nID: " + uIDD.getID(obj);
                str += "\nName: " + obj.name;
                if (obj.GetComponent <VisionManager>() != null && obj.GetComponent <VisionManager>() == vision)
                {
                    str += "\nType: " + "SelfRobot";
                }
                else
                {
                    str += "\nType: " + obj.tag;
                }
                str += "\nPosition: " + obj.transform.position;
                VisionProperties auxVisionProperties = obj.GetComponent <VisionProperties>();
                if (auxVisionProperties != null)
                {
                    str += "\n" + auxVisionProperties.getVisionStatus();
                }
                else
                {
                    str += "\nRGB: 0, 0, 0";
                    str += "\nType: " + OntSenseCSharpAPI.Material.unknownMaterial;
                }
                Status auxStatus = obj.GetComponent <Status>();
                if (auxStatus != null)
                {
                    string aux = auxStatus.getStringStatus();
                    str += "\nStatus: " + aux;
                }
                else
                {
                    //str += "\nSatus: " + ObjectStatus.None;
                }
                EmotionStatus auxEmotionStatus = obj.GetComponent <EmotionStatus>();
                if (auxEmotionStatus != null)
                {
                    str += "\nEmotion: " + auxEmotionStatus.getEmotion().ToString();
                }
                str += "\n";
            }
        }
        return(str);
    }
Example #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);
    }