Exemplo n.º 1
0
        public void InitializeByParams(object[] param)
        {
            CommandParam data = param[0] as CommandParam;

            UIBillboardController _prefab = null;

            AdvKeyContent ADVKeys = AdvKeyContent.GetCurrentInstance();

            if (ADVKeys != null)
            {
                _prefab = ADVKeys.GetBillboardPrefabByKey(data.image);
                if (_prefab != null)
                {
                    if (!string.IsNullOrEmpty(data.name))
                    {
                        useBody = data.name;
                    }

                    if (!string.IsNullOrEmpty(data.arg2))
                    {
                        string[] splite = data.arg2.Split('|');
                        useEquips = new List <string>();
                        foreach (var item in splite)
                        {
                            useEquips.Add(item);
                        }
                    }
                }
                else if (!string.IsNullOrEmpty(data.image))
                {
                    AdvUtility.LogWarning("找不到Billboard prefab檔:" + data.image + " , 於 行數 " + (this.itemId - 3));
                    if (Application.isPlaying)
                    {
                        //_diceSprite = AdvManager.Instance.DefaultDiceSprite;
                    }
                }
            }

            targetPrefab       = _prefab;
            display            = StageExtend.GetDisplayTypeByCommand(data.command);
            spriteDistance     = StageExtend.GetBbDistanceByString(data.arg1);
            toPosition         = StageExtend.GetBbPositionByString(data.target);
            hideWhich          = StageExtend.GetBbHideByString(data.target);
            useDefaultSettings = true;
        }
Exemplo n.º 2
0
        public void InitializeByParams(object[] param)
        {
            CommandParam data = param[0] as CommandParam;

            Sprite           _sprite = null;
            DicedSpriteAtlas _atlas;
            DicedSprite      _diceSprite = null;

            AdvKeyContent ADVKeys = AdvKeyContent.GetCurrentInstance();

            if (ADVKeys != null)
            {
                //尋找立繪圖區(DiceAtlas)
                _atlas = ADVKeys.GetDiceAtlasByKey(data.image);
                if (_atlas != null)
                {
                    spriteAtlas = _atlas;
                    _diceSprite = ADVKeys.GetDiceBillboardByKeyContain("Normal", _atlas);

                    if (_diceSprite == null)
                    {
                        AdvUtility.LogWarning("找不到Billboard檔:" + data.image + " , 於 行數 " + (this.itemId - 3));
                        if (Application.isPlaying)
                        {
                            //_diceSprite = FungusExtendEditorConfig.Instance.DefaultDiceSprite;
                        }
                    }
                }
                else if (!string.IsNullOrEmpty(data.image))
                {
                    //可能是使用怪物圖
                    _sprite = ADVKeys.GetEnemyByKey(data.image);

                    if (_sprite == null)
                    {
                        AdvUtility.LogWarning("找不到Billboard檔:" + data.image + " , 於 行數 " + (this.itemId - 3));
                        if (Application.isPlaying)
                        {
                            //_diceSprite = AdvManager.Instance.DefaultDiceSprite;
                        }
                    }
                }

                /*
                 * _diceSprite = ADVKeys.GetDiceBillboardByKey(data.billboardKey);  // ex: Lica_Normal
                 * if(_diceSprite == null && !string.IsNullOrEmpty(data.billboardKey)) {
                 *  AdvUtility.LogWarning("找不到Billboard檔:" + data.billboardKey + " , 於 行數 " + (this.itemId - 3));
                 *  _diceSprite = AdvManager.Instance.DefaultDiceSprite;
                 * }
                 */

                /* // 舊版 UI 型 立繪
                 * //尋找立繪圖區
                 * _sprite = ADVKeys.GetBillboardByKey(data.billboardKey);
                 * if(_sprite == null){
                 * //可能使用怪物圖區,尋找怪物圖區
                 *  _sprite = ADVKeys.GetEnemyByKey(data.billboardKey);
                 * }
                 * //兩者皆沒有,替換為香菇
                 * if(_sprite == null && !string.IsNullOrEmpty(data.billboardKey)){
                 *
                 *  AdvUtility.LogWarning("找不到Billboard檔:" + data.billboardKey + " , 於 行數 " + (this.itemId - 3));
                 *  _sprite = AdvManager.Instance.DefaultSprite;
                 * }
                 */
            }

            spriteBillboard        = _sprite;
            spriteDynamicBillboard = _diceSprite;
            display        = StageExtend.GetDisplayTypeByCommand(data.command);
            spriteDistance = StageExtend.GetBbDistanceByString(data.arg1);
            toPosition     = StageExtend.GetBbPositionByString(data.target);
            hideWhich      = StageExtend.GetBbHideByString(data.target);
            //flipFace = flipFace;
            useDefaultSettings = true;
            //fadeDuration = fadeDuration;
            //moveDuration = moveDuration;
            //shiftOffset = shiftOffset;
            //move = move;
            //shiftIntoPlace = shiftIntoPlace;
            //waitUntilFinished = waitUntilFinished;
        }