少年修仙传客户端代码仓库
hch
3 天以前 600733c8f592cb9e65f2b7a3e110ac1d686e6bfe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Thursday, December 28, 2017
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
 
namespace vnxbqy.UI
{
 
    public class StoryDialogueBubble : DialogueBubble
    {
        float m_Delay = 0f;
        bool delayOver = false;
 
        string content = string.Empty;
        new Transform target;
        new Camera camera;
 
        public static void StoryShow(string _content, Transform _target, Camera _camera, float _delay = 0f)
        {
            var bubble = DialogueBubblePool.Require(Pattern.Story);
            bubble.transform.SetParentEx(WindowCenter.Instance.uiRoot.bossShowCanvas.transform, Vector3.zero, Vector3.zero, Vector3.one);
            bubble.SetActive(true);
 
            var storyBubble = bubble as StoryDialogueBubble;
            if (storyBubble)
            {
                storyBubble.DelayShow(_content, _target, _camera, _delay);
            }
        }
 
        public void DelayShow(string _content, Transform _target, Camera _camera, float _delay)
        {
            content = _content;
            target = _target;
            camera = _camera;
 
            delayOver = false;
 
            m_Delay = Time.time + _delay;
            if (m_Delay > 0f)
            {
                this.transform.localScale = Vector3.zero;
            }
        }
 
        protected override void LateUpdate()
        {
            base.LateUpdate();
 
            if (!delayOver && Time.time > m_Delay)
            {
                delayOver = true;
                this.transform.localScale = Vector3.one;
 
                base.Show(content, target, camera);
            }
 
        }
 
    }
 
}