Exemple #1
0
    private Vector2 getBirthPosition(Dialog.TailPosition tailPosition, Single ratio = 1f)
    {
        switch (tailPosition)
        {
        case Dialog.TailPosition.LowerRight:
        case Dialog.TailPosition.LowerLeft:
        case Dialog.TailPosition.LowerRightForce:
        case Dialog.TailPosition.LowerLeftForce:
            return(new Vector2(this.dialog.Size.x / 2f * ratio, this.dialog.Size.y * ratio));

        case Dialog.TailPosition.UpperRight:
        case Dialog.TailPosition.UpperLeft:
        case Dialog.TailPosition.UpperRightForce:
        case Dialog.TailPosition.UpperLeftForce:
            return(new Vector2(this.dialog.Size.x / 2f * ratio, 0f));
        }
        return(new Vector2(this.dialog.Size.x / 2f * ratio, this.dialog.Size.y / 2f * ratio));
    }
Exemple #2
0
    private Single getCenterValue(Dialog.TailPosition tailPosition, Single ratio = 1f)
    {
        switch (tailPosition)
        {
        case Dialog.TailPosition.LowerRight:
        case Dialog.TailPosition.LowerLeft:
        case Dialog.TailPosition.LowerCenter:
        case Dialog.TailPosition.LowerRightForce:
        case Dialog.TailPosition.LowerLeftForce:
            return((this.dialog.ClipSize.y / 2f - Dialog.DialogYPadding / 2f) * (1f - ratio));

        case Dialog.TailPosition.UpperRight:
        case Dialog.TailPosition.UpperLeft:
        case Dialog.TailPosition.UpperCenter:
        case Dialog.TailPosition.UpperRightForce:
        case Dialog.TailPosition.UpperLeftForce:
            return(-(this.dialog.ClipSize.y / 2f - Dialog.DialogYPadding / 2f) * (1f - ratio));
        }
        return(0f);
    }
Exemple #3
0
    public Dialog AttachDialog(String phrase, Int32 width, Int32 lineCount, Dialog.TailPosition tailPos, Dialog.WindowStyle style, Vector2 pos, Dialog.CaptionType captionType = Dialog.CaptionType.None)
    {
        Dialog dialogFromPool = this.GetDialogFromPool();

        if (dialogFromPool != (UnityEngine.Object)null)
        {
            dialogFromPool.Reset();
            dialogFromPool.Width      = (Single)width;
            dialogFromPool.LineNumber = (Single)lineCount;
            dialogFromPool.Style      = style;
            dialogFromPool.Tail       = tailPos;
            dialogFromPool.Position   = pos;
            dialogFromPool.Id         = DialogManager.UIDialogId;
            dialogFromPool.Caption    = FF9TextTool.GetDialogCaptionText(captionType);
            dialogFromPool.Phrase     = phrase;
            dialogFromPool.Show();
            if (!this.isActivate)
            {
                this.ActivateDialogScene();
            }
        }
        return(dialogFromPool);
    }