Ejemplo n.º 1
0
    public void Move()
    {
        for (int i = 0; i < char_ui_elems.Count; i++)
        {
            CharInfoHolder char_info_holder = char_ui_elems[i].GetComponent <CharInfoHolder>();

            if (char_info_holder == null)
            {
                throw new System.Exception(char_ui_elems[i].name + " UI element does not have CharInfoHolder component defined");
            }

            SODict curr_char_info = GetSingleElem.Get(curr_char) as SODict;

            if (curr_char_info == char_info_holder.char_info)
            {
                // Enable / Show the Image
                image.enabled = true;

                // This RectTransform
                RectTransform curr_rect_transform = GetComponent <RectTransform>();

                // Move to chosen char RectTransform
                curr_rect_transform.position = char_info_holder.gameObject.GetComponent <RectTransform>().position;
            }
        }
    }
Ejemplo n.º 2
0
    public void UpdateMesh()
    {
        SODict curr_char_info = GetSingleElem.Get(curr_char) as SODict;

        GameObject char_model = planes_ref_holder.GetCharModelByRef(curr_char_info);

        MeshRenderer char_model_mesh_renderer = char_model.GetComponentInChildren <MeshRenderer>();
        MeshFilter   char_model_mesh_filter   = char_model.GetComponentInChildren <MeshFilter>();

        planes_ref_holder.CopyCharModel(transform.gameObject, char_model_mesh_renderer, char_model_mesh_filter);
    }