示例#1
0
    void handleMaterialProperties()
    {
        currentMaterialsPage = 0;

        //before we add new materials clear out the list
        materialNames.Clear();

        //if the hit object has a renderer, get the material
        if (_selectedObject.GetComponent <Renderer>())
        {
            //if there is more than one material loop and add
            for (int i = 0; i < _selectedObject.GetComponent <Renderer>().materials.Length; i++)
            {
                materialNames.Add(_selectedObject.GetComponent <Renderer>().materials[i].name);
            }
        }

        //get all the materials in the children
        //--TODO: Do this on GLTF serialization
        Renderer[] renderers = _selectedObject.GetComponentsInChildren <Renderer>();
        foreach (Renderer renderer in renderers)
        {
            materialNames.Add(renderer.material.name);
        }

        removeLastMaterialPage();

        //get only unique instances of the material names
        materialNames = materialNames.Distinct().ToList();

        //create "chunks" groups of 4 to display the object
        chunkedMaterialList = ListExtensions.ChunkBy(materialNames, 4);
        showMaterialPage(0);
    }
示例#2
0
    void Start()
    {
        _stateManagerMutatorRef = GameObject.FindObjectOfType(typeof(stateManager)) as stateManager;

        //create "chunks" groups of 4 to display the object
        chunkedList = ListExtensions.ChunkBy(propController.propObjects, 4);
        showPropObjectPage(0);
    }
示例#3
0
        private AtomUsers GetAtomUsers(List <InfoList> list)
        {
            var groups = ListExtensions.ChunkBy(list, 5);

            var atomUsers = new AtomUsers {
                Users = new List <AtomUser>()
            };

            foreach (var group in groups)
            {
                var result    = userClient.DownloadString($"{API}/atom/users?userIds={string.Join(",", group.Select(x => x.friendUserId))}");
                var tempUsers = new XMLSerializer().Deserialize <AtomUsers>(result);
                atomUsers.Users = atomUsers.Users.Concat(tempUsers.Users).ToList();
            }

            return(atomUsers);
        }
示例#4
0
 void Start()
 {
     //create "chunks" groups of 4 to display the object
     chunkedList = ListExtensions.ChunkBy(propManager.propObjects, 4);
     showPropObjectPage(0);
 }