예제 #1
0
    /// <summary>
    /// 获取两个阵营之间的关系。
    /// </summary>
    /// <param name="first">阵营一。</param>
    /// <param name="second">阵营二。</param>
    /// <returns>阵营间关系。</returns>
    public static RelationType GetRelation(CampType first, CampType second)
    {
        if (first > second)
        {
            CampType temp = first;
            first  = second;
            second = temp;
        }

        RelationType relationType;

        if (campPairToRelation.TryGetValue(new CampPair(first, second), out relationType))
        {
            return(relationType);
        }

        Log.Warning("Unknown relation between '{0}' and '{1}'.", first.ToString(), second.ToString());
        return(RelationType.Unknown);
    }
예제 #2
0
        private void PlayMovie(int _turnIndex, CampType _campType, Color _textColor, Sprite _campSprite, bool _isNext)
        {
            _textColor       = new Color(_textColor.r, _textColor.g, _textColor.b, 200 / 255.0f);
            turnText.text    = String.Concat("Around ", _turnIndex.ToString());
            turnImage.sprite = _campSprite;
            playerText.text  = _campType.ToString();
            playerText.color = _textColor;

            doTweenSequence = DOTween.Sequence();
            doTweenSequence.Append(DOTween.To(() => backageImage.anchoredPosition,
                                              x => backageImage.anchoredPosition    = x, Vector2.zero, 0.75f));
            doTweenSequence.Append(DOTween.To(() => @group.alpha, x => @group.alpha = x, 1, 0.5f));
            doTweenSequence.AppendCallback(() =>
            {
                @group.interactable   = true;
                @group.blocksRaycasts = true;
            });
            doTweenSequence.AppendInterval(2);
            doTweenSequence.Append(DOTween.To(() => backageImage.anchoredPosition,
                                              x => backageImage.anchoredPosition  = x, new Vector2(1929.7f, 0), 0.75f));
            doTweenSequence.Join(DOTween.To(() => @group.alpha, x => @group.alpha = x, 0, 0.2f));
            doTweenSequence.AppendCallback(() =>
            {
                @group.interactable   = false;
                @group.blocksRaycasts = false;
            });
            doTweenSequence.AppendInterval(0.35f);
            doTweenSequence.AppendCallback(() =>
            {
                backageImage.anchoredPosition = new Vector2(-1929.7f, 0);
                if (_isNext)
                {
                    StartNextRoundTurn();
                }
                else
                {
                    LoadInfo.Instance.gameCursor.isExecute = true;
                }
            });
        }
예제 #3
0
        int CreateEffect(CampType casterCampType, IntVector2 effectPos, short effectId, int targetUnitId, short effectAngler, short param1, short param2)
        {
            UnityEngine.Debug.Log("創建技能效果 " + casterCampType.ToString() + " " + effectPos.ToString() + " " + effectAngler + " " + param1 + " " + param2);
            GDSKit.SkillEffect effectConfig = GDSKit.SkillEffect.GetInstance(effectId);

            SkillEffectBase createEffect = null;

            switch ((SkillEffectType)effectConfig.type)
            {
            case SkillEffectType.ChgAttr:
                createEffect = new SkillAttrChgEffect();
                break;

            default:
                throw new System.NotImplementedException("未实现的技能效果类型 " + effectConfig.type);
            }
            mEffectDic[createEffect.iD] = createEffect;
            createEffect.SetInfo(effectConfig, effectPos, targetUnitId, effectAngler, param1, param2, casterCampType);
            createEffect.BeginWork();
            BattleFiled.Instance.OnCreateEffect(effectId, effectPos);
            return(createEffect.iD);
        }
예제 #4
0
        /// <summary>
        /// 获取两个阵营之间的关系。
        /// </summary>
        /// <param name="first">阵营一。</param>
        /// <param name="second">阵营二。</param>
        /// <returns>阵营间关系。</returns>
        public static RelationType GetRelation(CampType first, CampType second)
        {
            //第一阵营一定小于或等于第二阵营
            if (first > second)
            {
                CampType temp = first;
                first  = second;
                second = temp;
            }

            RelationType relationType;

            if (s_CampPairToRelation.TryGetValue(((int)first << 4) + (int)second, out relationType))
            {
                return(relationType);
            }

            HotLog.Warning("Unknown relation between '{0}' and '{1}'.", first.ToString(), second.ToString());
            return(RelationType.Unknown);
        }