public override void LoadAsset(AssetInfo assetInfo)
        {
            base.LoadAsset(assetInfo);

            this.assetInfo = assetInfo;

            var ta = this.Assets.LoadAsset<TextureAtlas>("Content/" + this.assetInfo.FileName);

            if (this.entity.FindComponent<Sprite>() == null)
            {
                this.entity.AddComponent(new SpriteRenderer(DefaultLayers.Alpha));
            }
            else
            {
                this.entity.RemoveComponent<Sprite>();
            }

            this.entity.AddComponent(new Sprite(ta.Texture));

            this.entity.FindComponent<SpritesheetRectanglesRenderer>().Rectangles = ta.SpriteRectangles.Values;

            this.entity.RefreshDependencies();

            this.Reset();
        }
        public override void LoadAsset(AssetInfo assetInfo)
        {
            base.LoadAsset(assetInfo);

            var spriteFont = this.Assets.LoadAsset<SpriteFont>("Content/" + this.assetInfo.FileName);

            if (this.entity.FindComponent<Sprite>() == null)
            {
                this.entity.AddComponent(new SpriteRenderer(DefaultLayers.Alpha));
            }
            else
            {
                this.entity.RemoveComponent<Sprite>();
            }

            this.entity.AddComponent(new Sprite(spriteFont.FontTexture));

            this.entity.FindComponent<SpritesheetRectanglesRenderer>().Rectangles = spriteFont.Glyphs;

            this.entity.RefreshDependencies();

            this.tbSample.Height = spriteFont.Glyphs[0].Height;
            this.tbSample.FontPath = spriteFont.AssetPath;

            this.Reset();
        }
        private void m_browseButton_Click(object sender, RoutedEventArgs e)
        {
            if (null != m_asset)
            {
                var asset = m_asset;
                m_asset = null;
                DataContext = null;
                m_img.Source = null;
            }

            OpenFileDialog dlg = new OpenFileDialog();
            dlg.Multiselect = false;
            dlg.CheckFileExists = true;
            dlg.CheckPathExists = true;
            bool? result = dlg.ShowDialog(this);
            if (result.HasValue && result.Value)
            {
                m_fileTextBox.Text = dlg.FileName;
                m_asset = MediaAnalyzer.AnalyzeAssetFile(m_fileTextBox.Text);
                DataContext = m_asset;
                using (MemoryStream ms = new MemoryStream(m_asset.ThumbnailImageBytes))
                {
                    BitmapImage img = new BitmapImage();
                    img.BeginInit();
                    img.CacheOption = BitmapCacheOption.OnLoad;
                    img.StreamSource = ms;
                    img.EndInit();
                    m_img.Source = img;
                }
            }
        }
 public SoundEffectLoaderScene(AssetInfo assetInfo)
     : base(assetInfo)
 {
     var path = "Content/" + assetInfo.FileName;
     this.sound = new SoundInfo(path);
     this.uiColor = Color.White;
 }
        public override void LoadAsset(AssetInfo assetInfo)
        {
            base.LoadAsset(assetInfo);

            this.entity.RemoveComponent<Sprite>();
            this.entity.AddComponent(new Sprite("Content/" + assetInfo.FileName));
            this.entity.RefreshDependencies();

            this.Reset();
        }
Esempio n. 6
0
 protected void OnEnable()
 {
     Imvu.Login().Then(
         userModel => Load( userModel )
     ).Then(
         assetInfo => {
             this.assetInfo = assetInfo;
         }
     ).Catch(
         err => Debug.LogError( err )
     );
 }
Esempio n. 7
0
 void Start()
 {
     Imvu.Login().Then(
         userModel => Load(userModel)
     ).Then(
         assetInfo => {
             this.assetInfo = assetInfo;
             ui.SetActive(true);
         }
     ).Catch(
         err => Debug.LogError(err)
     );
 }
 public Texture2DLoaderScene(AssetInfo assetInfo)
     : base(assetInfo)
 {
     this.entity = new Entity()
         .AddComponent(new Sprite("Content/" + assetInfo.FileName))
         .AddComponent(new SpriteRenderer(DefaultLayers.Alpha))
         .AddComponent(new Transform2D()
         {
             Origin = Vector2.One / 2,
             X = WaveServices.Platform.ScreenWidth / 2,
             Y = WaveServices.Platform.ScreenHeight / 2
         })
         .AddComponent(new TouchGestures()
         {
             EnabledGestures = SupportedGesture.Translation
         })
         .AddComponent(new RectangleCollider())
         .AddComponent(new BorderDrawable2D());
 }
        public override void LoadAsset(AssetInfo assetInfo)
        {
            base.LoadAsset(assetInfo);

            this.soundInstance.Stop();
            this.soundInstance = null;
            this.bank.Remove(this.sound);

            var path = "Content/" + assetInfo.FileName;

            if ((this.sound != null) && (this.sound.SoundEffect != null))
            {
                this.sound.SoundEffect.Unload();
                WaveServices.Assets.Global.UnloadAsset(path);
            }

            this.sound = new SoundInfo(path);
            this.bank.Add(this.sound);

            this.UpdateSoundInfoTextBlock();

            this.soundInstance = WaveServices.SoundPlayer.Play(this.sound, 1, false);
        }
Esempio n. 10
0
 public EditorSettings(AssetInfo assetInfo) :
     base(assetInfo)
 {
 }
Esempio n. 11
0
 public LightmapSettings(AssetInfo assetInfo) :
     base(assetInfo)
 {
 }
Esempio n. 12
0
 public ASTCImporter(AssetInfo assetInfo) :
     base(assetInfo)
 {
 }
Esempio n. 13
0
    public static void BuildAllAssetBundles(int style = 0, AssetInfo assetInfos = null, string _buildPath = null)
    {
        if (!string.IsNullOrEmpty(_buildPath))
        {
            sourcePath = _buildPath;
        }
        else
        {
            sourcePath = Path.Combine(Application.persistentDataPath, "AllPackage");
        }
        target    = Path.Combine(Application.persistentDataPath, "files");
        dllTarget = Path.Combine(target, "PlatformLobbyCode");
        if (!Directory.Exists(sourcePath))
        {
            Directory.CreateDirectory(sourcePath);
        }
        if (!Directory.Exists(target))
        {
            Directory.CreateDirectory(target);
        }
        if (!Directory.Exists(dllTarget))
        {
            Directory.CreateDirectory(dllTarget);
        }

#if UNITY_IPHONE
        BuildPipeline.BuildAssetBundles(sourcePath, BuildAssetBundleOptions.ChunkBasedCompression, BuildTarget.iOS);
#else
        BuildPipeline.BuildAssetBundles(sourcePath, BuildAssetBundleOptions.ChunkBasedCompression, BuildTarget.Android);
#endif
        Debug.Log("打包成功");
        AssetManager.TryEncyptAssetBundle(sourcePath);
#if UNITY_EDITOR_WIN || UNITY_EDITOR_OSX
        Debug.Log("sourcePath::" + sourcePath);
        Debug.Log("target::" + target);
        num = 0;

        #region 使用分文件夹打资源

        CopyFile("particleeffects", "PlatformLobby");//特殊资源,本来是特效文件夹下的 需要单独下载 因为一些原因 直接放平台文件夹下 直接开始就下载好

        //大厅资源 自动拷贝平台文件夹 资源
        string           stylePrePath = string.Format("{0}/CreatAssetBundle/PlatformLobby/", Application.dataPath);
        DirectoryInfo    folder       = new DirectoryInfo(stylePrePath);
        FileSystemInfo[] files        = folder.GetDirectories();
        for (int i = 0; i < files.Length; i++)
        {
            CopyFile(files[i].Name.ToLower(), "PlatformLobby");
        }

        #region 其他资源 文件夹名必须和bundle名一样
        if (assetInfos == null)
        {
            if (_assetInfos == null)
            {
                _assetInfos = new AssetInfo(Application.dataPath, "Assets", false);
            }
            assetInfos = _assetInfos;
            EditorTool.ReadAssetsInChildren(assetInfos);
        }

        string[] bundles = AssetDatabase.GetAllAssetBundleNames();
        for (int i = 0; i < assetInfos.ChildAssetInfo.Count; i++)
        {
            if (assetInfos.ChildAssetInfo[i].AssetName == "CreatAssetBundle")
            {
                List <AssetInfo> infos = assetInfos.ChildAssetInfo[i].ChildAssetInfo;
                AssetInfo        info  = null;
                for (int q = 0; q < bundles.Length; q++)
                {
                    info = infos.Find((AssetInfo data) =>
                    {
                        return(data.AssetName.ToLower() == bundles[q]);
                    });
                    if (info != null)
                    {
                        CopyFile(bundles[q], info.AssetName);
                    }
                    info = null;
                }
                break;
            }
        }
        #endregion

        #endregion

        //string[] bundles = AssetDatabase.GetAllAssetBundleNames();
        //for (int q = 0; q < bundles.Length; q++)
        //{
        //    CopyFile(bundles[q], "PlatformLobby");
        //}
        Debug.Log("复制完成,总共复制 " + num + " 个文件");
#endif
    }
        public override void ParseConfig(string xml)
        {
            if (string.IsNullOrEmpty(xml))
            {
                Logger.ErrorFormat("SpeedConfig is Empty");
                return;
            }
            ClearData();
            var cfg = XmlConfigParser <CharacterStateConfig> .Load(xml);

            if (null == cfg)
            {
                Logger.ErrorFormat("character speed is illegal content:{0}", xml);
                return;
            }

            foreach (var v in cfg.SpeedCoefficients)
            {
                int id = CharacterStateConfigHelper.GenerateId(v.PostureState, v.MovementState);
                _coefficients.Add(id, new SpeedCoefficient
                                  (
                                      v.Coefficient.Front, v.Coefficient.Rear, v.Coefficient.Left, v.Coefficient.Right,
                                      v.Coefficient.LeftFront, v.Coefficient.LeftRear, v.Coefficient.RightFront, v.Coefficient.RightRear
                                  ));
                _influencedByWeapon.Add(id, v.InfluencedByWeapon);
            }
            foreach (var v in cfg.PostureTransitions)
            {
                int id = CharacterStateConfigHelper.GenerateId(v.StateOne, v.StateTwo);
                _postureTransitionTime.Add(id, v.Duration);
            }
            foreach (var v in cfg.MovementTransitions)
            {
                int id = CharacterStateConfigHelper.GenerateId(v.StateOne, v.StateTwo);
                _movementTransitionTime.Add(id, v.Duration);
            }

            _jumpAcceleration       = cfg.JumpAcceleration;
            _diveSpeed              = cfg.DiveSpeed;
            _swimSpeed              = cfg.SwimSpeed;
            _standardAnimationSpeed = cfg.StandardAnimationSpeed;
            _horizontalSpeed        = cfg.SightShiftHorizontalSpeed;
            _horizontalLimit        = cfg.SightShiftHorizontalLimit;
            _verticalSpeed          = cfg.SightShiftVerticalSpeed;
            _verticalLimitMax       = cfg.SightShiftVerticalLimitMax;
            _verticalLimitMin       = cfg.SightShiftVerticalLimitMin;
            _verticalPeriodTimeMax  = cfg.SightShiftVerticalPeriodTimeMax;
            _verticalPeriodTimeMin  = cfg.SightShiftVerticalPeriodTimeMin;

            AirMoveCurveAssetInfo = new AssetInfo(cfg.JumpCurveInfo.BundleName, cfg.JumpCurveInfo.AssetName);

            _skyMoveConfig = new CharacterSkyMoveConfig()
            {
                SkyGravity       = cfg.SkyGravity,
                SkyYawSpeed      = cfg.SkyYawSpeed,
                SkyPitchSpeed    = cfg.SkyPitchSpeed,
                SkyRollSpeed     = cfg.SkyRollSpeed,
                SkyRollBackSpeed = cfg.SkyRollBackSpeed,
                SkyAcceleration  = cfg.SkyAcceleration,

                MaxGlidingRollAngle                 = cfg.MaxGlidingRollAngle,
                MaxGlidingPitchUpAngle              = cfg.MaxGlidingPitchUpAngle,
                GlidinRollVelocityDamper            = cfg.GlidingRollVelocityDamper,
                MaxGlidingGravityVelocity           = cfg.MaxGlidingGravityVelocity,
                MaxGlidingPitchUpVerticalVelocity   = cfg.MaxGlidingPitchUpVerticalVelocity,
                MaxGlidingPitchDownVerticalVelocity = cfg.MaxGlidingPitchDownVerticalVelocity,
                GlidingAirResistance                = cfg.GlidingAirResistance,
                GlidingAirKeyInputResistance        = cfg.GlidingAirKeyInputResistance,

                ParachuteTime                         = cfg.ParachuteTime,
                MinParachuteHeight                    = cfg.MinParachuteHeight,
                ParachuteIdlePitchAngle               = cfg.ParachuteIdlePitchAngle,
                MaxParachutePitchDownAngle            = cfg.MaxParachutePitchDownAngle,
                MaxParachutePitchUpAngle              = cfg.MaxParachutePitchUpAngle,
                MaxParachuteRollAngle                 = cfg.MaxParachuteRollAngle,
                MaxParachuteGravityVelocity           = cfg.MaxParachuteGravityVelocity,
                ParachuteGravityDamper                = cfg.ParachuteGravityDamper,
                ParachuteHorizontalDamper             = cfg.ParachuteHorizontalDamper,
                MaxParachutePitchUpVerticalVelocity   = cfg.MaxParachutePitchUpVerticalVelocity,
                MaxParachutePitchDownVerticalVelocity = cfg.MaxParachutePitchDownVerticalVelocity,
                ParachuteSwingAcceleration            = cfg.ParachuteSwingAcceleration,
                ParachuteSwingDeacceleration          = cfg.ParachuteSwingDeacceleration,
                ParachuteSwingAirResistance           = cfg.ParachuteSwingAirResistance,
                MaxParachuteSwingVelocity             = cfg.MaxParachuteSwingVelocity,

                SkyLandDeacceleration = cfg.SkyLandDeacceleration
            };
            _skyMoveConfig.ValidateConfiguartion();

            _steepConfig = new SteepConfig()
            {
                DownSteepAngles = cfg.DownSteepAngle,
                DownSteepBuffs  = cfg.DownSteepBuff,
                UpSteepAngles   = cfg.UpSteepAngle,
                UpSteepBuffs    = cfg.UpSteepBuff,
            };

            _longLayerWeightTransitionTime  = cfg.LongLayerWeightTransitionTime;
            _holsterTransitionTime          = cfg.HolsterTransitionTime;
            _attackTransitionTime           = cfg.AttackTransitionTime;
            _shortLayerWeightTransitionTime = cfg.ShortLayerWeightTransitionTime;
            _zeroLayerWeightTransitionTime  = cfg.ZeroLayerWeightTransitionTime;

            _beginSlowDownInWater = cfg.BeginSlowDownInWater;
            _stopSlowDownInWater  = cfg.StopSlowDownInWater;

            _steepAverRatio        = cfg.SteepAverRatio;
            _steepLimitSprintBegin = cfg.SteepLimitBegin;
            _steepLimitSprintStop  = cfg.SteepLimitStop;
            _steepLimitRunBegin    = cfg.SteepLimitRunBegin;
            _steepLimitRunStop     = cfg.SteepLimitRunStop;
            //_maxSlopeNum = cfg.MaxSlopeNum;

            _headFollowRotateMax    = cfg.HeadFollowRotateMaxH;
            _headFollowRotateMin    = cfg.HeadFollowRotateMinH;
            _heckRotHorizontalIndex = cfg.NeckRotHorizontalIndex;
            _verticalHeadRotMax     = cfg.HeadFollowRotateMaxV;
            _verticalHeadRotMin     = cfg.HeadFollowRotateMinV;
            _neckRotVerticalIndex   = cfg.NeckRotVerticalIndex;
            _headRotSpeed           = cfg.HeadRotSpeed;
            _noHeadRotStartAngle    = cfg.NoHeadRotStartAngle;

            _handRotMax = cfg.HandFollowRotateMax;
            _handRotMin = cfg.HandFollowRotateMin;

            PeekXTransition   = cfg.PeekXTransition;
            PeekYTransition   = cfg.PeekYTransition;
            PeekDegreeP1      = cfg.PeekDegreeP1;
            SightPeekDegree   = cfg.SightPeekDegree;
            _landSlowDownTime = cfg.LandSlowDownTime;
        }
Esempio n. 15
0
 public InputManager(AssetInfo assetInfo) :
     base(assetInfo)
 {
 }
Esempio n. 16
0
		public TextureImporter(AssetInfo assetInfo) :
			base(assetInfo)
		{
		}
Esempio n. 17
0
 public Font(AssetInfo assetInfo) :
     base(assetInfo)
 {
 }
Esempio n. 18
0
        private bool SetUsbDefaultJobValues(string elementName, DataPair <string> itemValue, JediDevice device, AssetInfo assetInfo, string fieldChanged, PluginExecutionData data)
        {
            string activityUrn = "urn:hp:imaging:con:service:usb:UsbService:DefaultJob";
            string endpoint    = "usb";

            Func <WebServiceTicket, WebServiceTicket> change = n =>
            {
                n.FindElement(elementName).SetValue(itemValue.Key);
                return(n);
            };

            return(UpdateField(change, device, itemValue, activityUrn, endpoint, assetInfo, fieldChanged, data));
        }
Esempio n. 19
0
 public RenderSettings(AssetInfo assetInfo) :
     base(assetInfo)
 {
 }
Esempio n. 20
0
 public Transform(AssetInfo assetInfo) :
     base(assetInfo)
 {
     Father = new PPtr <Transform>(AssetsFile);
 }
Esempio n. 21
0
 public BuildSettings(AssetInfo assetInfo) :
     base(assetInfo)
 {
 }
Esempio n. 22
0
 protected Collider(AssetInfo assetInfo) :
     base(assetInfo)
 {
 }
Esempio n. 23
0
 public BlendTree(AssetInfo assetsInfo) :
     base(assetsInfo)
 {
 }
Esempio n. 24
0
        /// <summary>
        /// This ensures that items in sell orders appear in the list of the player's assets.
        /// It is called just after new asset XML from the API has been processed but before
        /// the update is applied to the database.
        /// </summary>
        public static void ProcessSellOrders(EMMADataSet.AssetsDataTable assetData, AssetList changes,
            long ownerID)
        {
            List<int> itemIDs = new List<int>();
            itemIDs.Add(0);
            List<long> stationIDs = new List<long>();
            stationIDs.Add(0);
            List<AssetAccessParams> accessParams = new List<AssetAccessParams>();
            accessParams.Add(new AssetAccessParams(ownerID));
            // Get active sell orders
            OrdersList sellOrders = Orders.LoadOrders(accessParams, itemIDs, stationIDs, 999, "Sell");
            EMMADataSet.AssetsRow changedAsset = null;
            // Note that modifiedAssets is indexed first by itemID and second by stationID
            Dictionary<int, Dictionary<long, AssetInfo>> modifiedAssets = new Dictionary<int, Dictionary<long, AssetInfo>>();

            foreach (Order sellOrder in sellOrders)
            {
                bool foundMatch = false;
                long assetID = 0;

                // If there is already an asset row with a state of 'ForSaleViaMarket' in the same location,
                // and with the same item type then check quantity.
                // If it matches then just set to processed and move on.
                // If it does not then record the difference in quantities and go to the next order.
                // If we can't find a match then add a new asset row and record the items gained.
                if (Assets.AssetExists(assetData, ownerID, sellOrder.StationID, sellOrder.ItemID,
                    (int)AssetStatus.States.ForSaleViaMarket, false, 0, false, false, true, true,
                    true, 0, ref assetID))
                {
                    foundMatch = true;
                }
                else
                {
                    DataRow[] data =
                        assetData.Select("ItemID = " + sellOrder.ItemID + " AND OwnerID = " +
                        ownerID.ToString() + " AND LocationID = " + sellOrder.StationID +
                        " AND Status = " + (int)AssetStatus.States.ForSaleViaMarket);
                    if (data != null && data.Length > 0)
                    {
                        foundMatch = true;
                        assetID = ((EMMADataSet.AssetsRow)data[0]).ID;
                    }
                }

                if (foundMatch)
                {
                    changedAsset = assetData.FindByID(assetID);
                    if (changedAsset.Quantity != sellOrder.RemainingVol)
                    {
                        // If the quantities do not match then store how many units we are removing
                        // from the stack, the most likely cause is more than one sell order for
                        // this item in this location and if we know how many units we've removed
                        // We can make sure that the other order(s) quantity matches up.
                        Dictionary<long, AssetInfo> itemDeltaVol = new Dictionary<long, AssetInfo>();
                        if (modifiedAssets.ContainsKey(sellOrder.ItemID))
                        {
                            itemDeltaVol = modifiedAssets[sellOrder.ItemID];
                        }
                        else
                        {
                            modifiedAssets.Add(sellOrder.ItemID, itemDeltaVol);
                        }
                        if (itemDeltaVol.ContainsKey(sellOrder.StationID))
                        {
                            AssetInfo info = itemDeltaVol[sellOrder.StationID];
                            info.quantity += sellOrder.RemainingVol - changedAsset.Quantity;
                            itemDeltaVol[sellOrder.StationID] = info;
                            changedAsset.Quantity += sellOrder.RemainingVol;
                        }
                        else
                        {
                            AssetInfo info = new AssetInfo();
                            info.quantity = sellOrder.RemainingVol - changedAsset.Quantity;
                            info.assetID = changedAsset.ID;
                            itemDeltaVol.Add(sellOrder.StationID, info);
                            changedAsset.Quantity = sellOrder.RemainingVol;
                        }
                    }
                    changedAsset.Processed = true;
                    // Also set it to processed in the database.
                    SetProcessedFlag(changedAsset.ID, true);
                }

                // We havn't managed to match the order to an existing 'ForSaleViaMarket' stack in
                // the database or in memory.
                // As such, we need to create a new one.
                if (!foundMatch)
                {
                    // Create the new asset row..
                    changedAsset = assetData.NewAssetsRow();
                    changedAsset.AutoConExclude = true;
                    changedAsset.ContainerID = 0;
                    changedAsset.CorpAsset = false;
                    // Set cost to zero for now, it will be worked out later when gains/losses are reconciled.
                    changedAsset.Cost = 0;
                    changedAsset.CostCalc = false;
                    changedAsset.IsContainer = false;
                    changedAsset.ItemID = sellOrder.ItemID;
                    changedAsset.EveItemID = 0;
                    changedAsset.LocationID = sellOrder.StationID;
                    changedAsset.OwnerID = sellOrder.OwnerID;
                    changedAsset.Processed = true;
                    changedAsset.Quantity = sellOrder.RemainingVol;
                    changedAsset.RegionID = sellOrder.RegionID;
                    changedAsset.ReprocExclude = true;
                    changedAsset.SystemID = sellOrder.SystemID;
                    changedAsset.BoughtViaContract = false;
                    changedAsset.Status = (int)AssetStatus.States.ForSaleViaMarket;

                    assetData.AddAssetsRow(changedAsset);

                    // Store the changes we are making to quantities
                    Dictionary<long, AssetInfo> itemDeltaVol = new Dictionary<long, AssetInfo>();
                    if (modifiedAssets.ContainsKey(sellOrder.ItemID))
                    {
                        itemDeltaVol = modifiedAssets[sellOrder.ItemID];
                    }
                    else
                    {
                        modifiedAssets.Add(sellOrder.ItemID, itemDeltaVol);
                    }
                    if (itemDeltaVol.ContainsKey(sellOrder.StationID))
                    {
                        AssetInfo info = itemDeltaVol[sellOrder.StationID];
                        info.quantity += sellOrder.RemainingVol;
                        itemDeltaVol[sellOrder.StationID] = info;
                    }
                    else
                    {
                        AssetInfo info = new AssetInfo();
                        info.quantity = sellOrder.RemainingVol;
                        info.assetID = changedAsset.ID;
                        itemDeltaVol.Add(sellOrder.StationID, info);
                    }
                }

            }

            // Once we've finished processing all the orders, store the overall quantity changes.
            Dictionary<int, Dictionary<long, AssetInfo>>.Enumerator enumerator = modifiedAssets.GetEnumerator();
            while (enumerator.MoveNext())
            {
                Dictionary<long, AssetInfo>.Enumerator enumerator2 = enumerator.Current.Value.GetEnumerator();
                while(enumerator2.MoveNext())
                {
                    Asset change = new Asset();
                    change.ID = enumerator2.Current.Value.assetID;
                    change.ItemID = enumerator.Current.Key;
                    change.LocationID = enumerator2.Current.Key;
                    change.Quantity = enumerator2.Current.Value.quantity;
                    change.StatusID = (int)AssetStatus.States.ForSaleViaMarket;
                    change.IsContainer = false;
                    change.Container = null;
                    change.AutoConExclude = true;
                    change.OwnerID = ownerID;
                    change.UnitBuyPrice = 0;
                    change.UnitBuyPricePrecalculated = false;

                    changes.Add(change);
                }
            }
        }
Esempio n. 25
0
        /// <summary>
        /// Interface function to update and log device fields.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="ChangeValue"></param>
        /// <param name="device"></param>
        /// <param name="data"></param>
        /// <param name="urn"></param>
        /// <param name="endpoint"></param>
        /// <param name="assetInfo"></param>
        /// <param name="activity"></param>
        /// <param name="pluginExecutionData"></param>
        /// <returns>Success bool</returns>
        public bool UpdateField <T>(Func <WebServiceTicket, WebServiceTicket> changeValue, JediDevice device, DataPair <T> data, string urn, string endpoint, AssetInfo assetInfo, string fieldChanged, PluginExecutionData pluginData)
        {
            bool success;

            if (data.Value)
            {
                DeviceConfigResultLog log = new DeviceConfigResultLog(pluginData, assetInfo.AssetId);
                try
                {
                    WebServiceTicket tic = device.WebServices.GetDeviceTicket(endpoint, urn);
                    changeValue(tic);
                    device.WebServices.PutDeviceTicket(endpoint, urn, tic);
                    success = true;
                }
                catch (Exception ex)
                {
                    Logger.LogError($"Failed to set field {fieldChanged}, {ex.Message}");
                    _failedSettings.AppendLine($"Failed to set field {fieldChanged}, {ex.Message}");
                    success = false;
                }
                log.FieldChanged   = fieldChanged;
                log.Result         = success ? "Passed" : "Failed";
                log.Value          = data.Key.ToString();
                log.ControlChanged = "Scan To USB Default";


                ExecutionServices.DataLogger.Submit(log);
            }
            else
            {
                success = true;
            }
            return(success);
        }
 public SpriteFontLoaderScene(AssetInfo assetInfo)
     : base(assetInfo)
 {
 }
Esempio n. 27
0
        /// <summary>
        /// Execution Entry point
        /// Individual function differences separated into delagate methods.
        /// </summary>
        /// <param name="device"></param>
        /// <param name="assetInfo"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        public bool ExecuteJob(JediDevice device, AssetInfo assetInfo, PluginExecutionData data)
        {
            Type type   = typeof(ScanUsbSettingData);
            bool result = true;
            Dictionary <string, object> properties = new Dictionary <string, object>();

            foreach (PropertyInfo prop in type.GetProperties().Where(x => x.PropertyType == typeof(DataPair <string>)))
            {
                properties.Add(prop.Name, prop.GetValue(this));
            }
            foreach (var propertyInfo in typeof(ScanSettings).GetProperties())
            {
                properties.Add(propertyInfo.Name, propertyInfo.GetValue(ScanSettingsData));
            }
            foreach (var propertyInfo in typeof(FileSettings).GetProperties())
            {
                properties.Add(propertyInfo.Name, propertyInfo.GetValue(FileSettingsData));
            }

            if (!assetInfo.Attributes.HasFlag(AssetAttributes.Scanner))
            {
                _failedSettings.AppendLine("Device has no Scanner capability, skipping Scan USB Settings");

                DeviceConfigResultLog log =
                    new DeviceConfigResultLog(data, assetInfo.AssetId)
                {
                    FieldChanged   = "Scan USB Settings",
                    Result         = "Skipped",
                    Value          = "NA",
                    ControlChanged = "Scan USB Default"
                };

                ExecutionServices.DataLogger.Submit(log);
                return(false);
            }

            foreach (var item in properties)
            {
                switch (item.Key)
                {
                case "EnableScanToUsb":
                    result &= SetUsbDefaultValues("UsbServiceEnabled", (DataPair <string>)item.Value, device, assetInfo, "Enable Scan to USB", data);
                    break;

                case "OriginalSize":
                    result &= SetUsbDefaultJobValues("ScanMediaSize", (DataPair <string>)item.Value, device, assetInfo, "Scan Media Size", data);
                    break;

                case "OriginalSides":
                    result &= SetUsbDefaultJobValues("ScanPlexMode", (DataPair <string>)item.Value, device, assetInfo, "Original Side", data);
                    break;

                case "Optimize":
                    result &= SetUsbDefaultJobValues("ScanMode", (DataPair <string>)item.Value, device, assetInfo, "Optimize", data);
                    break;

                case "Orientation":
                    result &= SetUsbDefaultJobValues("OriginalContentOrientation", (DataPair <string>)item.Value, device, assetInfo, "Orientation", data);
                    break;

                case "ImagePreview":
                    result &= SetUsbDefaultJobValues("ImagePreview", (DataPair <string>)item.Value, device, assetInfo, "Image Preview", data);
                    break;

                case "Cleanup":
                    result &= SetUsbDefaultJobValues("BackgroundRemoval", (DataPair <string>)item.Value, device, assetInfo, "Cleanup", data);
                    break;

                case "Sharpness":
                    result &= SetUsbDefaultJobValues("Sharpness", (DataPair <string>)item.Value, device, assetInfo, "Sharpness", data);
                    break;

                case "Darkness":
                    result &= SetUsbDefaultJobValues("Exposure", (DataPair <string>)item.Value, device, assetInfo, "Darkness", data);
                    break;

                case "Contrast":
                    result &= SetUsbDefaultJobValues("Contrast", (DataPair <string>)item.Value, device, assetInfo, "Contrast", data);
                    break;

                case "FileName":
                    result &= SetUsbDefaultJobValues("FileName", (DataPair <string>)item.Value, device, assetInfo, "File Name", data);
                    break;

                case "FileNamePrefix":
                    result &= SetUsbDefaultJobValues("FileNamePrefix", (DataPair <string>)item.Value, device, assetInfo, "File Name Prefix", data);
                    break;

                case "FileNameSuffix":
                    result &= SetUsbDefaultJobValues("FileNameSuffix", (DataPair <string>)item.Value, device, assetInfo, "File Name Suffix", data);
                    break;

                case "FileType":
                    result &= SetUsbDefaultJobValues("DSFileType", (DataPair <string>)item.Value, device, assetInfo, "File Type", data);
                    break;

                case "Resolution":
                    result &= SetUsbDefaultJobValues("DSImageResolution", (DataPair <string>)item.Value, device, assetInfo, "File Resolution", data);
                    break;

                case "FileColor":
                    result &= SetUsbDefaultJobValues("DSColorPreference", (DataPair <string>)item.Value, device, assetInfo, "Color", data);
                    break;

                case "FileSize":
                    result &= SetUsbDefaultJobValues("DSAttachmentSize", (DataPair <string>)item.Value, device, assetInfo, "File Size", data);
                    break;

                case "FileNumbering":
                    result &= SetUsbDefaultJobValues("AttachmentFileNameFormat", (DataPair <string>)item.Value, device, assetInfo, "File Numbering", data);
                    break;
                }
            }

            return(result);
        }
Esempio n. 28
0
 public MovieTexture(AssetInfo assetInfo) :
     base(assetInfo)
 {
 }
Esempio n. 29
0
 public Flare(AssetInfo assetInfo) :
     base(assetInfo)
 {
 }
Esempio n. 30
0
 public AnimationClip(AssetInfo assetInfo) :
     base(assetInfo)
 {
 }
Esempio n. 31
0
 public NavMeshAgent(AssetInfo assetInfo) :
     base(assetInfo)
 {
 }
Esempio n. 32
0
 public void Set(int id, AssetInfo asset)
 {
     Id    = id;
     Asset = asset;
 }
Esempio n. 33
0
 public MonoBehaviour(AssetInfo assetInfo) :
     base(assetInfo)
 {
 }
Esempio n. 34
0
 public object Serdes(object existing, AssetInfo config, AssetMapping mapping, ISerializer s)
 => Serdes(existing as CharacterSheet, config, mapping, s);
 /// <summary>
 /// Initializes a new instance of the <see cref="BaseLoaderScene" /> class.
 /// </summary>
 /// <param name="assetInfo">The asset info.</param>
 public BaseLoaderScene(AssetInfo assetInfo)
 {
     this.assetInfo = assetInfo;
 }
 public TextureAtlasLoaderScene(AssetInfo assetInfo)
     : base(assetInfo)
 {
 }
Esempio n. 37
0
    public bool HandleEvent(int id, object param1, object param2)
    {
        switch (id)
        {
            case EventDef.ResLoadFinish:
                RequestInfo info = param1 as RequestInfo;
                if (info != null)
                {
                    if (info.Asset != null)
                    {

                        AssetInfo asset = new AssetInfo();
                        asset.isKeepInMemory = info.isKeepInMemory;
                        asset.asset = info.Asset;
                        if (!mDicAaaet.ContainsKey(info.assetName))
                        {
                            mDicAaaet.Add(info.assetName, asset);
                        }

                        for (int i = 0; i < info.linsteners.Count;i++ )
                        {
                            if (info.linsteners[i] != null)
                            {
                                info.linsteners[i].Finish(info.Asset);
                            }
                        }
                        AddAssetToName(info.assetName);
                    }
                }
                else
                {
                    for (int i = 0; i < info.linsteners.Count; i++)
                    {
                        if (info.linsteners[i] != null)
                        {
                            info.linsteners[i].Failure();
                        }
                    }
                }
                return false;
        }
        return false;
    }
    private void OnFinishedLoadingHandler()
    {
        shadowEastAssetInfo         = Database.Instance.GetEntry<AssetInfo>("ASSET_SHADOW_EAST");
        shadowNorthAssetInfo        = Database.Instance.GetEntry<AssetInfo>("ASSET_SHADOW_NORTH");
        shadowNorthEastAssetInfo    = Database.Instance.GetEntry<AssetInfo>("ASSET_SHADOW_NORTH_EAST");
        shadowNorthWestAssetInfo    = Database.Instance.GetEntry<AssetInfo>("ASSET_SHADOW_NORTH_WEST");
        shadowSouthAssetInfo        = Database.Instance.GetEntry<AssetInfo>("ASSET_SHADOW_SOUTH");
        shadowSouthEastAssetInfo    = Database.Instance.GetEntry<AssetInfo>("ASSET_SHADOW_SOUTH_EAST");
        shadowSouthWestAssetInfo    = Database.Instance.GetEntry<AssetInfo>("ASSET_SHADOW_SOUTH_WEST");
        shadowWestAssetInfo         = Database.Instance.GetEntry<AssetInfo>("ASSET_SHADOW_WEST");

        InitHeights();
        InitMapObjects();
        InitShadows();
    }
Esempio n. 39
0
        private void ApplyAssetBundleName(string externalResourcesPath, string shareResourcesPath, AssetInfo assetInfo)
        {
            if (assetInfo == null)
            {
                return;
            }

            if (!assetInfo.IsAssetBundle)
            {
                return;
            }

            if (assetInfo.AssetBundle == null)
            {
                return;
            }

            var assetPath = ExternalResources.GetAssetPathFromAssetInfo(externalResourcesPath, shareResourcesPath, assetInfo);

            assetManagement.SetAssetBundleName(assetPath, assetInfo.AssetBundle.AssetBundleName);
        }
 /// <summary>
 /// Loads the asset. This method is needed to recycle
 /// current scene if the type of the incoming asset is
 /// the same as the current one, as current screen layers
 /// doesn't allow to load a new scene of the same type.
 /// </summary>
 /// <param name="assetInfo">Asset info.</param>
 public virtual void LoadAsset(AssetInfo assetInfo)
 {
     this.assetInfo = assetInfo;
     this.UpdateAssetInfoText();
 }
Esempio n. 41
0
        public object Load(BinaryReader br, long streamLength, AssetKey key, AssetInfo config)
        {
            var td = new TilesetData();

            td.UseSmallGraphics = config.UseSmallGraphics ?? false;

            var validPassabilities = typeof(Passability).GetEnumValues().Cast <int>().ToList();
            var validLayers        = typeof(TileLayer).GetEnumValues().Cast <byte>().ToList();
            var validTypes         = typeof(TileType).GetEnumValues().Cast <byte>().ToList();

            int tileCount = (int)(streamLength / 8) + 2;

            td.Tiles.Add(new TileData
            {
                Layer       = TileLayer.Normal,
                Type        = TileType.Normal,
                Collision   = Passability.Passable,
                Flags       = 0,
                ImageNumber = 0xffff,
                FrameCount  = 1,
                Unk7        = 0
            });

            td.Tiles.Add(new TileData
            {
                Layer       = TileLayer.Normal,
                Type        = TileType.Normal,
                Collision   = Passability.Passable,
                Flags       = 0,
                ImageNumber = 0xffff,
                FrameCount  = 1,
                Unk7        = 0
            });

            for (int i = 2; i < tileCount; i++)
            {
                var t = new TileData {
                    TileNumber = i
                };

                byte firstByte = br.ReadByte();        // 0
                t.Layer = (TileLayer)(firstByte >> 4); // Upper nibble of first byte (0h)
                ApiUtil.Assert(validLayers.Contains((byte)t.Layer), "Unexpected tile layer found");

                t.Type = (TileType)(firstByte & 0xf); // Lower nibble of first byte (0l)
                ApiUtil.Assert(validTypes.Contains((byte)t.Type), "Unexpected tile type found");

                t.Collision = (Passability)br.ReadByte(); // 1
                ApiUtil.Assert(validPassabilities.Contains((int)t.Collision));

                t.Flags = (TileFlags)br.ReadUInt16(); // 2
                ApiUtil.Assert((t.Flags & TileFlags.UnusedMask) == 0, "Unused flags set");
                t.ImageNumber = br.ReadUInt16();      // 4
                t.FrameCount  = br.ReadByte();        // 6
                t.Unk7        = br.ReadByte();        // 7

                td.Tiles.Add(t);
            }

            return(td);
        }
        public MigrationConfiguration(XmlNode section)
        {
            //Convert the XmlNode to an XDocument (for LINQ).
            XDocument xmlDoc = XDocument.Parse(section.OuterXml);

            // **********************************
            // * V1 source connection.
            // **********************************
            var v1Source = from item in xmlDoc.Descendants("V1SourceConnection")
                           select new ConnectionInfo
                           {
                               Url = item.Element("Url").Value,
                               Username = string.IsNullOrEmpty(item.Element("Username").Value) ? string.Empty : item.Element("Username").Value,
                               Password = string.IsNullOrEmpty(item.Element("Password").Value) ? string.Empty : item.Element("Password").Value,
                               Project = string.IsNullOrEmpty(item.Element("Project").Value) ? string.Empty : item.Element("Project").Value,
                               AuthenticationType = string.IsNullOrEmpty(item.Attribute("authenticationType").Value) ? string.Empty : item.Attribute("authenticationType").Value
                           };
            if (v1Source.Count() == 0)
                throw new ConfigurationErrorsException("Missing V1SourceConnection information in application config file.");
            else
                V1SourceConnection = v1Source.First();

            // **********************************
            // * V1 target connection.
            // **********************************
            var v1Target = from item in xmlDoc.Descendants("V1TargetConnection")
                           select new ConnectionInfo
                           {
                               Url = item.Element("Url").Value,
                               Username = string.IsNullOrEmpty(item.Element("Username").Value) ? string.Empty : item.Element("Username").Value,
                               Password = string.IsNullOrEmpty(item.Element("Password").Value) ? string.Empty : item.Element("Password").Value,
                               Project = string.IsNullOrEmpty(item.Element("Project").Value) ? string.Empty : item.Element("Project").Value,
                               AuthenticationType = string.IsNullOrEmpty(item.Attribute("authenticationType").Value) ? string.Empty : item.Attribute("authenticationType").Value
                           };
            if (v1Target.Count() == 0)
                throw new ConfigurationErrorsException("Missing V1TargetConnection information in application config file.");
            else
                V1TargetConnection = v1Target.First();

            // **********************************
            // * V1 staging database.
            // **********************************
            var v1Database = from item in xmlDoc.Descendants("V1StagingDatabase")
                             select new StagingDatabaseInfo
                             {
                               Server = item.Element("Server").Value,
                               Database = item.Element("Database").Value,
                               Username = string.IsNullOrEmpty(item.Element("Username").Value) ? string.Empty : item.Element("Username").Value,
                               Password = string.IsNullOrEmpty(item.Element("Password").Value) ? string.Empty : item.Element("Password").Value,
                               TrustedConnection = System.Convert.ToBoolean(item.Attribute("trustedConnection").Value)
                             };
            if (v1Database.Count() == 0)
                throw new ConfigurationErrorsException("Missing V1StagingDatabase information in application config file.");
            else
                V1StagingDatabase = v1Database.First();

            // **********************************
            // * Rally source connection.
            // **********************************
            var rallySource = from item in xmlDoc.Descendants("RallySourceConnection")
                              select new RallyConnectionInfo
                              {
                                Url = item.Element("url").Value,
                                Username = string.IsNullOrEmpty(item.Element("username").Value) ? string.Empty : item.Element("username").Value,
                                Password = string.IsNullOrEmpty(item.Element("password").Value) ? string.Empty : item.Element("password").Value,
                                ExportFileDirectory = item.Element("exportFileDirectory").Value,
                                UserExportFilePrefix = item.Element("userExportFilePrefix").Value,
                                ProjectExportFilePrefix = item.Element("projectExportFilePrefix").Value,
                                ReleaseExportFilePrefix = item.Element("releaseExportFilePrefix").Value,
                                IterationExportFilePrefix = item.Element("iterationExportFilePrefix").Value,
                                EpicExportFilePrefix = item.Element("epicExportFilePrefix").Value,
                                StoryExportFilePrefix = item.Element("storyExportFilePrefix").Value,
                                DefectExportFilePrefix = item.Element("defectExportFilePrefix").Value,
                                TaskExportFilePrefix = item.Element("taskExportFilePrefix").Value,
                                TestExportFilePrefix = item.Element("testExportFilePrefix").Value,
                                RegressionTestExportFilePrefix = item.Element("regressiontestExportFilePrefix").Value,
                                TestStepExportFilePrefix = item.Element("teststepExportFilePrefix").Value,
                                ConversationExportFilePrefix = item.Element("conversationExportFilePrefix").Value,
                                OrphanedTestProject = item.Element("orphanedTestProject").Value
                              };
            RallySourceConnection = rallySource.First();

            // **********************************
            // * Jira Configuration.
            // **********************************
            var jiraConfig = from item in xmlDoc.Descendants("JiraConfiguration")
                           select new JiraConfigurationInfo
                           {
                               XmlFileName = item.Element("xmlFileName").Value,
                               ProjectName = item.Element("projectName").Value,
                               ProjectDescription = item.Element("projectDescription").Value,
                               DefaultSchedule = item.Element("defaultSchedule").Value,
                               JiraUrl = item.Element("jiraUrl").Value,
                               StoryIssueTypes = string.IsNullOrEmpty(item.Element("storyIssueTypes").Value) ? string.Empty : item.Element("storyIssueTypes").Value,
                               DefectIssueTypes = string.IsNullOrEmpty(item.Element("defectIssueTypes").Value) ? string.Empty : item.Element("defectIssueTypes").Value,
                               EpicIssueTypes = string.IsNullOrEmpty(item.Element("epicIssueTypes").Value) ? string.Empty : item.Element("epicIssueTypes").Value,
                               IssueIssueTypes = string.IsNullOrEmpty(item.Element("issueIssueTypes").Value) ? string.Empty : item.Element("issueIssueTypes").Value,
                               RequestIssueTypes = string.IsNullOrEmpty(item.Element("requestIssueTypes").Value) ? string.Empty : item.Element("requestIssueTypes").Value,
                               TaskIssueTypes = string.IsNullOrEmpty(item.Element("taskIssueTypes").Value) ? string.Empty : item.Element("taskIssueTypes").Value,
                               JiraTeamReference = string.IsNullOrEmpty(item.Element("jiraTeamReference").Value) ? string.Empty : item.Element("jiraTeamReference").Value,
                               JiraBacklogGroupReference = string.IsNullOrEmpty(item.Element("jiraBacklogGroupReference").Value) ? string.Empty : item.Element("jiraBacklogGroupReference").Value,
                               JiraBacklogGoalReference = string.IsNullOrEmpty(item.Element("jiraBacklogGoalReference").Value) ? string.Empty : item.Element("jiraBacklogGoalReference").Value
                           };
            if (jiraConfig.Count() == 0)
                throw new ConfigurationErrorsException("Missing JiraConfiguration information in application config file.");
            else
                JiraConfiguration = jiraConfig.First();

            // **********************************
            // * General configurations.
            // **********************************
            var v1Config = from item in xmlDoc.Descendants("configurations")
                           select new ConfigurationInfo
                           {
                               SourceConnectionToUse = item.Element("sourceConnectionToUse").Value,
                               PerformExport = System.Convert.ToBoolean(item.Element("performExport").Value),
                               PerformImport = System.Convert.ToBoolean(item.Element("performImport").Value),
                               PerformClose = System.Convert.ToBoolean(item.Element("performClose").Value),
                               PerformCleanup = System.Convert.ToBoolean(item.Element("performCleanup").Value),
                               MigrateTemplates = System.Convert.ToBoolean(item.Element("migrateTemplates").Value),
                               MigrateAttachmentBinaries = System.Convert.ToBoolean(item.Element("migrateAttachmentBinaries").Value),
                               MigrateProjectMembership = System.Convert.ToBoolean(item.Element("migrateProjectMembership").Value),
                               MigrateDuplicateSchedules = System.Convert.ToBoolean(item.Element("migrateDuplicateSchedules").Value),
                               UseNPIMasking = System.Convert.ToBoolean(item.Element("useNPIMasking").Value),
                               MergeRootProjects = System.Convert.ToBoolean(item.Element("mergeRootProjects").Value),
                               AddV1IDToTitles = System.Convert.ToBoolean(item.Element("addV1IDToTitles").Value),
                               PageSize = System.Convert.ToInt32(item.Element("pageSize").Value),
                               CustomV1IDField = string.IsNullOrEmpty(item.Element("customV1IDField").Value) ? string.Empty : item.Element("customV1IDField").Value,
                               ImportAttachmentsAsLinksURL = string.IsNullOrEmpty(item.Element("importAttachmentsAsLinksURL").Value) ? string.Empty : item.Element("importAttachmentsAsLinksURL").Value,
                               SetAllMembershipToRoot = System.Convert.ToBoolean(item.Element("setAllMembershipToRoot").Value),
                               SourceListTypeValue = string.IsNullOrEmpty(item.Element("sourceListTypeValue").Value) ? string.Empty : item.Element("sourceListTypeValue").Value,
                               MigrateUnauthoredConversationsAsAdmin = System.Convert.ToBoolean(item.Element("migrateUnauthoredConversationsAsAdmin").Value),
                               LogExceptions = System.Convert.ToBoolean(item.Element("logExceptions").Value)
                           };
            if (v1Config.Count() == 0)
                throw new ConfigurationErrorsException("Missing general configuration information in application config file.");
            else
                V1Configurations = v1Config.First();

            // **********************************
            // * Assets to migrate.
            // **********************************
            var assetData = from item in xmlDoc.Descendants("asset")
                            select item;
            if (assetData.Count() == 0)
                throw new ConfigurationErrorsException("Missing assets to migrate information in application config file.");

            foreach (var asset in assetData)
            {
                AssetInfo assetInfo = new AssetInfo();
                assetInfo.Name = asset.Attribute("name").Value;
                assetInfo.InternalName = asset.Attribute("internalName").Value;
                assetInfo.Enabled = System.Convert.ToBoolean(asset.Attribute("enabled").Value);
                assetInfo.DuplicateCheckField = asset.Attribute("duplicateCheckField").Value;
                assetInfo.EnableCustomFields = System.Convert.ToBoolean(asset.Attribute("enableCustomFields").Value);
                AssetsToMigrate.Add(assetInfo);
            }

            // **********************************
            // * List types to migrate.
            // **********************************
            var listTypeData = from item in xmlDoc.Descendants("listType")
                               select item;
            if (listTypeData.Count() == 0)
                throw new ConfigurationErrorsException("Missing list types to migrate information in application config file.");

            foreach (var listType in listTypeData)
            {
                ListTypeInfo listTypeInfo = new ListTypeInfo();
                listTypeInfo.Name = listType.Attribute("name").Value;
                listTypeInfo.Enabled = System.Convert.ToBoolean(listType.Attribute("enabled").Value);
                ListTypesToMigrate.Add(listTypeInfo);
            }

            // **********************************
            // * List Values
            // **********************************
            var listValueData = from item in xmlDoc.Descendants("listValue") select item;

            foreach (var listValue in listValueData)
            {
                ListValueInfo listValueInfo = new ListValueInfo();
                listValueInfo.AssetType = listValue.Attribute("assetType").Value;
                listValueInfo.FieldName = listValue.Attribute("fieldName").Value;
                listValueInfo.ListName = listValue.Attribute("listName").Value;
                listValueInfo.OldValue = listValue.Attribute("oldValue").Value;
                listValueInfo.NewValue = listValue.Attribute("newValue").Value;
                ListValues.Add(listValueInfo);
            }

            // **********************************
            // * Custom fields to migrate.
            // **********************************
            var customFieldData = from item in xmlDoc.Descendants("customField")
                                  select item;
            if (customFieldData.Count() == 0)
                throw new ConfigurationErrorsException("Missing custom fields to migrate information in application config file.");

            foreach (var customField in customFieldData)
            {
                CustomFieldInfo customFieldInfo = new CustomFieldInfo();
                customFieldInfo.SourceName = customField.Attribute("sourceName").Value;
                customFieldInfo.TargetName = customField.Attribute("targetName").Value;
                customFieldInfo.AssetType = customField.Attribute("assetType").Value;
                customFieldInfo.DataType = customField.Attribute("dataType").Value;
                customFieldInfo.RelationName = customField.Attribute("relationName").Value;
                CustomFieldsToMigrate.Add(customFieldInfo);
            }
        }
Esempio n. 43
0
 public void Add(AssetInfo ai)
 {
     sortedAllAssetInfos.Add(ai);
     allAssetInfoMap.Add(ai.asset, ai);
 }
Esempio n. 44
0
 public bool Get(string path, out AssetInfo ai)
 {
     return(allAssetInfoMap.TryGetValue(path, out ai));
 }
Esempio n. 45
0
 public object Serdes(object existing, AssetInfo info, AssetMapping mapping, ISerializer s, IJsonUtil jsonUtil)
 => Serdes(existing as ListStringCollection, info, mapping, s, jsonUtil);
Esempio n. 46
0
        private AnimatorStateMachine(AssetInfo assetInfo, AnimatorController controller, int stateMachineIndex) :
            base(assetInfo, HideFlags.HideInHierarchy)
        {
            VirtualSerializedFile virtualFile = (VirtualSerializedFile)assetInfo.File;

            LayerConstant layer = controller.Controller.GetLayerByStateMachineIndex(stateMachineIndex);

            Name = controller.TOS[layer.Binding];

            StateMachineConstant stateMachine = controller.Controller.StateMachineArray[stateMachineIndex].Instance;

            int stateCount        = stateMachine.StateConstantArray.Count;
            int stateMachineCount = 0;
            int count             = stateCount + stateMachineCount;
            int side = (int)Math.Ceiling(Math.Sqrt(count));

            List <AnimatorState> states = new List <AnimatorState>();

            m_childStates = new ChildAnimatorState[stateCount];
            for (int y = 0, stateIndex = 0; y < side && stateIndex < stateCount; y++)
            {
                for (int x = 0; x < side && stateIndex < stateCount; x++, stateIndex++)
                {
                    Vector3f           position   = new Vector3f(x * StateOffset, y * StateOffset, 0.0f);
                    AnimatorState      state      = AnimatorState.CreateVirtualInstance(virtualFile, controller, stateMachineIndex, stateIndex, position);
                    ChildAnimatorState childState = new ChildAnimatorState(state, position);
                    m_childStates[stateIndex] = childState;
                    states.Add(state);
                }
            }
#warning TODO: child StateMachines
            m_childStateMachines = new ChildAnimatorStateMachine[stateMachineCount];

            // set destination state for transitions here because all states has become valid only now
            for (int i = 0; i < stateMachine.StateConstantArray.Count; i++)
            {
                AnimatorState state         = states[i];
                StateConstant stateConstant = stateMachine.StateConstantArray[i].Instance;
                PPtr <AnimatorStateTransition>[] transitions = new PPtr <AnimatorStateTransition> [stateConstant.TransitionConstantArray.Count];
                for (int j = 0; j < stateConstant.TransitionConstantArray.Count; j++)
                {
                    TransitionConstant transitionConstant         = stateConstant.TransitionConstantArray[j].Instance;
                    AnimatorStateTransition.Parameters parameters = new AnimatorStateTransition.Parameters
                    {
                        StateMachine = stateMachine,
                        States       = states,
                        TOS          = controller.TOS,
                        Transition   = transitionConstant,
                        Version      = controller.File.Version,
                    };
                    AnimatorStateTransition transition = AnimatorStateTransition.CreateVirtualInstance(virtualFile, parameters);
                    transitions[j] = transition.File.CreatePPtr(transition);
                }
                state.Transitions = transitions;
            }

            m_anyStateTransitions = new PPtr <AnimatorStateTransition> [stateMachine.AnyStateTransitionConstantArray.Count];
            for (int i = 0; i < stateMachine.AnyStateTransitionConstantArray.Count; i++)
            {
                TransitionConstant transitionConstant         = stateMachine.AnyStateTransitionConstantArray[i].Instance;
                AnimatorStateTransition.Parameters parameters = new AnimatorStateTransition.Parameters
                {
                    StateMachine = stateMachine,
                    States       = states,
                    TOS          = controller.TOS,
                    Transition   = transitionConstant,
                    Version      = controller.File.Version,
                };
                AnimatorStateTransition transition = AnimatorStateTransition.CreateVirtualInstance(virtualFile, parameters);
                m_anyStateTransitions[i] = transition.File.CreatePPtr(transition);
            }

            StateMachineConstant.Parameters stateParameters = new StateMachineConstant.Parameters
            {
                ID      = layer.Binding,
                States  = states,
                TOS     = controller.TOS,
                Version = controller.File.Version,
            };
            m_entryTransitions       = stateMachine.CreateEntryTransitions(virtualFile, stateParameters);
            m_stateMachineBehaviours = new PPtr <MonoBehaviour> [0];

            AnyStatePosition           = new Vector3f(0.0f, -StateOffset, 0.0f);
            EntryPosition              = new Vector3f(StateOffset, -StateOffset, 0.0f);
            ExitPosition               = new Vector3f(2.0f * StateOffset, -StateOffset, 0.0f);
            ParentStateMachinePosition = new Vector3f(0.0f, -2.0f * StateOffset, 0.0f);

            DefaultState = ChildStates.Count > 0 ? ChildStates[stateMachine.DefaultState].State : default;
        }
Esempio n. 47
0
 public GlobalEffectManager()
 {
     _assetBundles[GlobalGroundPropFlash] = new AssetInfo("effect/common", "GlobalGroundPropFlash".ToLower());
 }