Exemplo n.º 1
0
        public void InformBubblePosition(Bubble _b)
        {
            foreach (Bubble bubble in Childs)
            {
                if (_b != bubble)
                {
                    Task <Boolean> escape = new TaskFactory().StartNew <Boolean>(() => {
                        if (!bubble.InMargin(_b))
                        {
                            return(false);
                        }

                        BubbleMover mover = new BubbleMover(bubble, bubble.GetEscapeDirection(_b.CentralPoint), escape_move_number, start_sleep_time, sleep_increment);
                        while (mover.Move())
                        {
                            InformBubblePosition(bubble);
                            //Task t = new TaskFactory().StartNew(() => InformBubblePosition(bubble));
                        }
                        return(true);

                        /*
                         * bool will_run = bubble.WillRun(_b);
                         * if (will_run) {
                         *  //StopTasks(bubble);
                         * bubble.EscapeWithOutCheck(_b);
                         * };
                         *
                         * return will_run; */
                    });
                    /* escape.ContinueWith((antecedent) => { if (antecedent.Result) { InformBubblePosition(bubble); } });*/
                    // Childs[bubble].Add(escape);
                }
            }
        }
    // Start is called before the first frame update
    void Start()
    {
        bubbleTrans = bubbleObj.GetComponent <Transform>();
        bubbleMover = bubbleObj.GetComponent <BubbleMover>();

        nowSize = minSize;
    }
Exemplo n.º 3
0
 private void Start()
 {
     SetNewBubbleColorAndFVX();
     bubbleMover = GetComponent <BubbleMover>();
 }