コード例 #1
0
 // Use this for initialization
 void Start()
 {
     SSRP_Metadata[] list = new SSRP_Metadata[] { new SSRP_Metadata("base_name", "base_type", "base_value"),
                                                  new SSRP_Metadata("met00_name", "met00_type", "met00_value"),
                                                  new SSRP_Metadata("met01_name", "met01_type", "met01_value"),
                                                  new SSRP_Metadata("met02_name", "met02_type", "met02_value") };
     importData(new SSRP_attribute(list));
 }
コード例 #2
0
    private void addChildren()
    {
        // data.metadatas = new SSRP_Metadata[] { };
        Vector2 newCanvasDimensions = new Vector2(0f, 0f);
        int     m = data.metadatas.Length;
        int     i = 0;

        /*
         * // for Debug purposes
         * string childDescription = "";
         * foreach(SSRP_Metadata childObj in data.metadatas)
         * {
         *  childDescription += childObj.description() + ", ";
         * }
         * Debug.LogFormat("AttributeController:  canLocateBaseGO:{1} and canRenderMeta:{2}, add {0} Children, metaData = [{3}]", m, canLocateBaseGO, canRenderChildData, childDescription);
         * // */



        if (canLocateBaseGO && canRenderChildData)
        {
            if (m == 0 || isClosed)
            {
                //newCanvasDimensions = childPrefab_canvas_init_dimension;
            }
            else
            {
                Vector3 newCanvasPosition = new Vector3(0f, 0f, 0f);
                Vector2 origin            = new Vector2(0f, 0f);
                Vector2 offset            = new Vector2(10f, 0f);
                Vector2 step = new Vector2(0f, -50f);
                Vector2 pos  = new Vector2(0f, 0f);

                // set start offset position for child-spawn based on human judgement and some actual dimensions
                offset = new Vector2(10f, -65f);


                // loop through list of Child data and generate their UI
                for (i = 0; i < m; i++)
                {
                    SSRP_Metadata metaData = data.metadatas[i];
                    pos = origin + offset + (step * i);

                    GameObject metaData_MVC;

                    metaData_MVC = (GameObject)Instantiate(metaDataGameObjectPrefab, pos, Quaternion.identity);
                    metaData_MVC.transform.SetParent(attributeViewGameObject.transform, false);
                    prefabChildList.Add(metaData_MVC);
                    SSRP_metaData_controller metaData_controller = metaData_MVC.GetComponent <SSRP_metaData_controller>();
                    metaData_controller.importData(metaData);
                }
                //set background dimensions
                // newCanvasDimensions = new Vector2(200f, (m + 1) * childPrefab_canvas_init_dimension.y);
            }
            //attribute_canvas.sizeDelta = newCanvasDimensions;
        }
    }
コード例 #3
0
    private void testDataGeneration()
    {
        SSRP_Metadata metaData_00 = new SSRP_Metadata("Faux_name", "faux_type", "faux value");
        SSRP_Metadata metaData_01 = new SSRP_Metadata("meta1", "int", "one");
        SSRP_Metadata metaData_02 = new SSRP_Metadata("meta2", "int", "two");
        SSRP_Metadata metaData_03 = new SSRP_Metadata("meta3", "int", "three");
        SSRP_Metadata metaData_04 = new SSRP_Metadata("meta4", "int", "four");

        SSRP_Metadata[] metaData_list = new SSRP_Metadata[] { metaData_00, metaData_01, metaData_02, metaData_03, metaData_04 };
        SSRP_attribute  testdata      = new SSRP_attribute("Faux_name", "faux_type", "faux value", metaData_list);

        importData(testdata);
    }
コード例 #4
0
    private void testDataGeneration()
    {
        SSRP_Metadata metaData_00 = new SSRP_Metadata("Faux_name", "faux_type", "faux value");
        SSRP_Metadata metaData_01 = new SSRP_Metadata("meta1", "int", "one");
        SSRP_Metadata metaData_02 = new SSRP_Metadata("meta2", "int", "two");
        SSRP_Metadata metaData_03 = new SSRP_Metadata("meta3", "int", "three");
        SSRP_Metadata metaData_04 = new SSRP_Metadata("meta4", "int", "four");

        SSRP_Metadata[] metaData_list = new SSRP_Metadata[] { metaData_00, metaData_01, metaData_02, metaData_03, metaData_04 };
        SSRP_attribute  test_att01    = new SSRP_attribute("att_1", "att_type", "att value", metaData_list);
        SSRP_attribute  test_att02    = new SSRP_attribute("att_2", "float", "344.324432543", metaData_list);
        SSRP_attribute  test_att03    = new SSRP_attribute("att_3", "bool", "false", metaData_list);
        SSRP_attribute  test_att04    = new SSRP_attribute("att_4", "int", "3", metaData_list);
        SSRP_attribute  test_att05    = new SSRP_attribute("att_5", "att_type", "att value", metaData_list);

        SSRP_attribute[]    attList  = new SSRP_attribute[] { test_att01, test_att02, test_att03, test_att04, test_att05 };
        SSRP_ContextElement testdata = new SSRP_ContextElement("34234324243", "sun", "true", attList);

        importData(testdata);
    }
コード例 #5
0
    public void importData(SSRP_Metadata meta)
    {
        _data = meta;

        refresh();
    }
コード例 #6
0
    public SSRP_Metadata fetchMeta(string _name)
    {
        SSRP_Metadata retObj = new SSRP_Metadata();

        return(retObj);
    }
コード例 #7
0
    public SSRP_Metadata fetchMeta(int _pos)
    {
        SSRP_Metadata retObj = new SSRP_Metadata();

        return(retObj);
    }
コード例 #8
0
 public int hasMeta(SSRP_Metadata meta)
 {
     return(-1);
 }
コード例 #9
0
 public bool remove_meta(SSRP_Metadata meta)
 {
     return(false);
 }
コード例 #10
0
    /*
     * public Vector2 GetCanvasDimension()
     * {
     *  //Vector2 dim = new Vector2();
     *  return attribute_canvas.sizeDelta;
     * }
     * // */

    public bool add_meta(SSRP_Metadata meta)
    {
        return(false);
    }