示例#1
0
    public void SetCharaClose(CharaShowData.EPosType posType)
    {
        CurrentShowDict[posType].CharaKey = "";
        CurrentShowDict[posType].State    = CharaShowData.EEffType.Close;
        switch (posType)
        {
        case CharaShowData.EPosType.Left:
            Anim_Left.SetInteger("State", (int)CharaShowData.EEffType.Close);
            break;

        case CharaShowData.EPosType.Right:
            Anim_Right.SetInteger("State", (int)CharaShowData.EEffType.Close);
            break;

        case CharaShowData.EPosType.Center:
            Anim_Center.SetInteger("State", (int)CharaShowData.EEffType.Close);
            break;
        }
    }
示例#2
0
    public IEnumerator SetCharaState(ShowCharaSet data, int expression, string charaName)
    {
        LastShowPos = data.PosType;
        var charaData = GlobalConfig.Instance.NovelsCharas.ToList().Find(o => o.Key == data.CharaKey);

        if (CurrentShowDict.ContainsKey(data.PosType))
        {
            CurrentShowDict[data.PosType].CharaKey   = data.CharaKey;
            CurrentShowDict[data.PosType].State      = data.State;
            CurrentShowDict[data.PosType].Expression = expression;
            CurrentShowDict[data.PosType].IsFlipX    = data.IsFlipX;
            if (string.IsNullOrEmpty(charaName))
            {
                if (charaData != null)
                {
                    CurrentShowDict[data.PosType].Name = charaData.Name;
                }
            }
            else
            {
                CurrentShowDict[data.PosType].Name = charaName;
            }
        }


        switch (data.PosType)
        {
        case CharaShowData.EPosType.Left:
            if (CurrentShowDict[CharaShowData.EPosType.Right].State == CharaShowData.EEffType.Show)
            {
                CurrentShowDict[CharaShowData.EPosType.Right].State = CharaShowData.EEffType.Dark;
                Anim_Right.SetInteger("State", (int)CharaShowData.EEffType.Dark);
            }
            Anim_Left.SetInteger("State", (int)data.State);

            break;

        case CharaShowData.EPosType.Right:
            if (CurrentShowDict[CharaShowData.EPosType.Left].State == CharaShowData.EEffType.Show)
            {
                CurrentShowDict[CharaShowData.EPosType.Left].State = CharaShowData.EEffType.Dark;
                Anim_Left.SetInteger("State", (int)CharaShowData.EEffType.Dark);
            }
            Anim_Right.SetInteger("State", (int)data.State);
            break;

        case CharaShowData.EPosType.Center:
            SetCharaClose(CharaShowData.EPosType.Left);
            SetCharaClose(CharaShowData.EPosType.Right);
            Anim_Center.SetInteger("State", (int)data.State);
            break;
        }

        //设置对话框位置
        if (CurrentDialogType == EDialogType.DialogBox)
        {
            if (data.PosType == CharaShowData.EPosType.Left)
            {
                ImageSwitch_DialogBg.SetImage(0);
            }
            else
            {
                ImageSwitch_DialogBg.SetImage(1);
            }
        }

        FreshSprite();
        yield return(new WaitForSeconds(0.3f));
    }