Exemplo n.º 1
0
        public PolyGridAsset(PolyAsset asset, Transform container)
        {
#if INCLUDE_POLY_TOOLKIT
            m_Asset      = asset;
            index        = asset.name; // PolyAsset.name is the GUID
            m_Container  = container;
            m_Complexity = 0L;
            foreach (var format in asset.formats)
            {
                m_Complexity = Math.Max(m_Complexity, format.formatComplexity.triangleCount);
            }
#endif
        }
Exemplo n.º 2
0
        public PolyGridAsset(PolyAsset asset, Transform container)
        {
#if INCLUDE_POLY_TOOLKIT
            m_Asset      = asset;
            m_Container  = container;
            m_Complexity = 0L;
            foreach (var format in asset.formats)
            {
                m_Complexity = Math.Max(m_Complexity, format.formatComplexity.triangleCount);
            }
#endif

            template = "PolyGridItem";
        }
Exemplo n.º 3
0
        // Callback invoked when an asset has just been imported.
        void ImportAssetCallback(PolyAsset asset, PolyStatusOr <PolyImportResult> result)
        {
            m_Importing = false;
            if (!result.Ok)
            {
                Debug.LogError("Failed to import asset. :( Reason: " + result.Status);
                return;
            }

            var importedAsset = result.Value.gameObject;

            importedAsset.transform.parent = m_Container;
            importedAsset.SetActive(false);
            m_Prefab      = importedAsset;
            m_Prefab.name = asset.displayName;

            if (modelImportCompleted != null)
            {
                modelImportCompleted(this, m_Prefab);
            }
        }