Пример #1
0
    private void insertSmellPos(GameObject go, DateTime dt)
    {
        CartesianPos    cPos = new CartesianPos(go.transform.position.x, go.transform.position.y, go.transform.position.z);
        SmellProperties auxSmellProperties = go.GetComponent <SmellProperties>();
        OdorComposition smellType          = new OdorComposition(0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f);

        if (auxSmellProperties != null)
        {
            smellType = auxSmellProperties.odorComposition;
        }
        RobotSmell rs = new RobotSmell(
            dt,                  // the event occurs now
            cPos,                // source position
            smellType);          // it is a putrid odor


        try                                    // Try to access a resource.
        {
            rs.insert();                       // using dotNetRDF library inserts the information in the triple store
        }
        catch (Exception e)
        {
            Debug.Log("System>>> " + e.Message);                  // change for your: LogError(e);     // Call a custom error logging procedure.
        }
    }
Пример #2
0
    public override void OnInspectorGUI()
    {
        SmellProperties smellProperties = (SmellProperties)target;

        DrawDefaultInspector();
        if (GUILayout.Button("Apply"))
        {
            //smellProperties.applyValues();
        }
    }
Пример #3
0
    public string getStringSmellInformation()
    {
        string str = "";

        foreach (GameObject obj in odorInSmell)
        {
            str += SEPARATOR;
            str += "\nPosition: " + obj.transform.position;
            SmellProperties auxSmellProperties = obj.GetComponent <SmellProperties>();
            if (auxSmellProperties != null)
            {
                str += "\n" + auxSmellProperties.getSmellStatus();
            }
            else
            {
                str += "Smell Type: " + OlfactoryAttribute.noSmell.ToString();
            }
            str += "\n";
        }
        foreach (GameObject obj in knowObjInSmell)
        {
            str += "\n-----------------------";
            str += "\nID: " + uIDD.getID(obj);
            SmellProperties auxSmellProperties = obj.GetComponent <SmellProperties>();
            if (auxSmellProperties != null)
            {
                str += "\n" + auxSmellProperties.getSmellStatus();
            }
            else
            {
                str += "Smell Type: None";
            }
            str += "\n";
        }
        return(str);
    }
Пример #4
0
    private void insertSmellID(GameObject go, DateTime dt)
    {
        SmellProperties    auxSmellProperties = go.GetComponent <SmellProperties>();
        OlfactoryAttribute smellType          = OlfactoryAttribute.noSmell;

        if (auxSmellProperties != null)
        {
            smellType = auxSmellProperties.getSmellType();
        }
        RobotSmell rs = new RobotSmell(
            dt,                   // the event occurs now
            uIDD.getID(go),       // source position
            smellType);           // it is a putrid odor


        try                                    // Try to access a resource.
        {
            rs.insert();                       // using dotNetRDF library inserts the information in the triple store
        }
        catch (Exception e)
        {
            Debug.Log("System>>> " + e.Message);                  // change for your: LogError(e);     // Call a custom error logging procedure.
        }
    }
Пример #5
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);
    }