Пример #1
0
        private Asset CreateAssetWrapper(AssetType type)
        {
            Asset asset;

            switch (type)
            {
            case AssetType.Notecard:
                asset = new AssetNotecard();
                break;

            case AssetType.LSLText:
                asset = new AssetScriptText();
                break;

            case AssetType.LSLBytecode:
                asset = new AssetScriptBinary();
                break;

            case AssetType.Texture:
                asset = new AssetTexture();
                break;

            case AssetType.Object:
                asset = new AssetPrim();
                break;

            case AssetType.Clothing:
                asset = new AssetClothing();
                break;

            case AssetType.Bodypart:
                asset = new AssetBodypart();
                break;

            default:
                Client.Log("Unimplemented asset type: " + type, Helpers.LogLevel.Error);
                return(null);
            }

            return(asset);
        }
Пример #2
0
        //Separate thread
        private void Assets_OnAssetReceived(AssetDownload transfer, Asset asset)
        {
            if (transfer.ID != transferID) return;

            string notecardContent;

            if (!transfer.Success)
            {
                notecardContent = "Unable to download notecard.";
                BeginInvoke(new OnSetNotecardText(SetNotecardText), new object[] { notecardContent, true });
                return;
            }

            receivedAsset = (AssetNotecard)asset;
            notecardContent = Helpers.FieldToUTF8String(transfer.AssetData);
            BeginInvoke(new OnSetNotecardText(SetNotecardText), new object[] { notecardContent, false });
        }
Пример #3
0
        private Asset CreateAssetWrapper(AssetType type)
        {
            Asset asset;

            switch (type)
            {
                case AssetType.Notecard:
                    asset = new AssetNotecard();
                    break;
                case AssetType.LSLText:
                    asset = new AssetScriptText();
                    break;
                case AssetType.LSLBytecode:
                    asset = new AssetScriptBinary();
                    break;
                case AssetType.Texture:
                    asset = new AssetTexture();
                    break;
                case AssetType.Primitive:
                    asset = new AssetPrim();
                    break;
                case AssetType.Clothing:
                    asset = new AssetClothing();
                    break;
                case AssetType.Bodypart:
                    asset = new AssetBodypart();
                    break;
                default:
                    Client.Log("Unimplemented asset type: " + type, Helpers.LogLevel.Error);
                    return null;
            }

            return asset;
        }