示例#1
0
        public override void OnEnter()
        {
            BillboardOptions options = new BillboardOptions();

            options.billboardSprite    = spriteBillboard;
            options.billboardDiceAtlas = spriteAtlas;
            if (spriteDynamicBillboard == null && spriteAtlas != null)
            {
                spriteDynamicBillboard = spriteAtlas.GetSpriteContainName("Normal");
            }
            options.billboardDiceSprite = spriteDynamicBillboard;
            options.display             = display;
            options.fromPosition        = fromPosition;
            options.toPosition          = toPosition;
            options.toPositionShift     = positionShift;
            options.shiftAmount         = positionShiftAmount;
            options.toDistance          = spriteDistance;
            options.hideWhich           = hideWhich;
            options.flipFace            = flipFace;
            options.useDefaultSettings  = useDefaultSettings;
            options.fadeDuration        = fadeDuration;
            options.moveDuration        = moveDuration;
            options.shiftOffset         = shiftOffset;
            options.move              = move;
            options.shiftIntoPlace    = shiftIntoPlace;
            options.waitUntilFinished = waitUntilFinished;

            targetStage = AdvManager.Instance.advStage;
            targetStage.BillboardLayout.RunBillboardCommand(options, Continue); // 已在 callback 加上 Continue, 因此此指令執行完時直接 Continue
            //targetStage.RunBillboardCommand(options, Continue);
        }
示例#2
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;
        }
示例#3
0
        public override void OnEnter()
        {
            System.Action <GameObject> onSpawn = (obj) => {
                UIBillboardController copyController = obj.GetComponent <UIBillboardController>();
                if (copyController != null)
                {
                    copyController.SetInitDisplay(useEmoji, useBody, useEquips);
                }
            };

            BillboardOptions options = new BillboardOptions();

            options.display            = display;
            options.fromPosition       = fromPosition;
            options.toPosition         = toPosition;
            options.toPositionShift    = positionShift;
            options.shiftAmount        = positionShiftAmount;
            options.toDistance         = spriteDistance;
            options.hideWhich          = hideWhich;
            options.flipFace           = flipFace;
            options.useDefaultSettings = useDefaultSettings;
            options.fadeDuration       = fadeDuration;
            options.moveDuration       = moveDuration;
            options.shiftOffset        = shiftOffset;
            options.move              = move;
            options.shiftIntoPlace    = shiftIntoPlace;
            options.waitUntilFinished = waitUntilFinished;

            StageExtend   targetStage = AdvManager.Instance.advStage;
            RectTransform prefabRect  = null;

            if (targetPrefab != null)
            {
                prefabRect = targetPrefab.GetComponent <RectTransform>();
            }

            targetStage.BillboardGUILayout.RunBillboardGUIObjCommand(prefabRect, options, onSpawn, Continue); // 已在 callback 加上 Continue, 因此此指令執行完時直接 Continue
        }
示例#4
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;
        }