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

            AdvKeyContent bgKeys = AdvKeyContent.GetCurrentInstance();

            if (string.Equals(data.command, "CgOff", System.StringComparison.OrdinalIgnoreCase))
            {
                display = BackgroundDisplayType.HideAll;
                return;
            }
            if (bgKeys != null)
            {
                spriteCG = bgKeys.GetDiceCGByKey(data.image);
                if (spriteCG == null)
                {
                    if (!string.IsNullOrEmpty(data.image))
                    {
                        AdvUtility.LogWarning("找不到CG檔:" + data.image + " , 於 行數 " + (this.itemId - 3));
                    }
                }
                else
                {
                    atlasCG = spriteCG.AtlasAsset;
                }
            }
        }
Ejemplo 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;
        }
Ejemplo n.º 3
0
 public DicedSpriteSerializer(SerializedObject serializedObject)
 {
     this.serializedObject = serializedObject;
     target    = serializedObject.targetObject as DicedSpriteAtlas;
     atlasPath = AssetDatabase.GetAssetPath(target);
 }