Ejemplo n.º 1
0
        Task addTask(char ch, int count)
        {
            TaskList tl = new TaskList();

            tl.push(new TaskWait(0.15f));
            Task add = new TweenTask(delegate {
                VoxelChar vc = _create.create(ch);
                if (vc != null)
                {
                    vc.gameObject.SetActive(true);

                    vc.setLayer(this.gameObject.layer);
                    vc.gameObject.transform.SetParent(this.transform);

                    vc.gameObject.transform.localScale    = Vector3.one;
                    vc.gameObject.transform.localPosition = getOffset(count, chars_.Count);                    //ew Vector3(chars_.Count * _offset, 0, 0);
                    chars_.Add(vc);
                    vc.setMainColor(_maincolor);
                    vc.setLightColor(_lightColor);
                    vc.gameObject.transform.eulerAngles = new Vector3(-270, 0, 0);
                    return(TweenRotation.Begin(vc.gameObject, 0.15f, Quaternion.Euler(new Vector3(0, 0, 0))));
                }
                return(null);
            });



            tl.push(add);
            return(tl);
        }
Ejemplo n.º 2
0
        private Task move(Vector3 to, float time)
        {
            TweenTask tt = new TweenTask(delegate {
                Tween tween  = TweenRotation.Begin(this.gameObject, time, Quaternion.Euler(to));
                tween.method = _method;
                return(tween);
            });

            return(tt);
        }
Ejemplo n.º 3
0
        Task removeTask(int i)
        {
            Task task = new TweenTask(delegate {
                chars_[i].gameObject.transform.eulerAngles = new Vector3(0, 0, 0);
                return(TweenRotation.Begin(chars_[i].gameObject, 0.15f, Quaternion.Euler(new Vector3(270, 0, 0))));
            });

            TaskManager.PushBack(task, delegate {
                chars_[i].gameObject.SetActive(false);
            });

            return(task);
        }
Ejemplo n.º 4
0
        public Task openTask()
        {
            if (_text == ' ' || _fontColor == _bgColor)
            {
                Task task = new Task();
                TaskManager.PushBack(task, delegate { open(); });
                return(task);
            }
            TweenTask tt = new TweenTask(delegate {
                this.transform.localEulerAngles = new Vector3(0, 179, 0);
                return(TweenRotation.Begin(this.gameObject, 0.3f, Quaternion.Euler(new Vector3(0, 0, 0))));
            });

            return(tt);
        }
Ejemplo n.º 5
0
        Task changeTask(int i, char ch, int count)
        {
            TaskList tl = new TaskList();

            Task remove = new TweenTask(delegate {
                chars_[i].gameObject.transform.eulerAngles = new Vector3(0, 0, 0);
                return(TweenRotation.Begin(chars_[i].gameObject, 0.15f, Quaternion.Euler(new Vector3(270, 0, 0))));
            });

            TaskManager.PushBack(remove, delegate {
                chars_[i].gameObject.SetActive(false);
            });
            tl.push(remove);



            Task add = new TweenTask(delegate {
                VoxelChar vc = _create.create(ch);
                if (vc != null)
                {
                    vc.gameObject.SetActive(true);
                    vc.setLayer(this.gameObject.layer);
                    vc.setMainColor(_maincolor);
                    vc.setLightColor(_lightColor);
                    vc.gameObject.transform.SetParent(this.transform);

                    vc.gameObject.transform.localScale    = Vector3.one;
                    vc.gameObject.transform.localPosition = this.getOffset(count, i);
                    chars_[i] = vc;
                    vc.gameObject.transform.eulerAngles = new Vector3(-270, 0, 0);
                    return(TweenRotation.Begin(vc.gameObject, 0.15f, Quaternion.Euler(new Vector3(0, 0, 0))));
                }
                return(null);
            });



            tl.push(add);


            return(tl);
        }