Пример #1
0
        /// <summary>
        /// 绘制
        /// </summary>
        /// <param name="e"></param>
        private void DrawAll(PaintEventArgs e)
        {
            Graphics g = e.Graphics;

            //for(int time = 0; time < 2000; time += 25)
            //{
            //    DrawBlack.Draw_Black(g, time / 2000);
            //    Thread.Sleep(25);
            //}

            for (int time = 0; time < 4400; time += 5)
            {
                Thread.Sleep(25);
                g.Clear(Color.AliceBlue);

                DrawArc.Draw_Arc(g, time);
            }

            for (int time = 0; time < 5000; time += 5)
            {
                Thread.Sleep(25);
                g.Clear(Color.AliceBlue);

                DrawCake.Draw_Cake(g, time);

                if (time > 1350)
                {
                    DrawWords.Draw_HAPPYBIRTHDAY_ChangeColor(g, time);
                }

                DrawMorse.Draw_Morse(g, Color.Black);
            }
        }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     drawArc   = GetComponent <DrawArc> ();
     rigidbody = GetComponent <Rigidbody>();
     maxVel    = 50f;
     minVel    = 10f;
 }
Пример #3
0
    void combinedCurrentArc(int _index)
    {
        currentArc.start = currentArc.start;
        currentArc.end   = listArc[_index].end;
        DrawArc _temp = listArc[_index];

        listArc.RemoveAt(_index);
        Destroy(_temp.gameObject);
    }
Пример #4
0
    void addCurrentArc(int _index)
    {
        GameObject _newArc = Instantiate(pfArc) as GameObject;

        currentArc        = _newArc.GetComponent <DrawArc>();
        currentArc.radius = radiusShield;
        currentArc.start  = _index;
        currentArc.end    = _index + 1;
    }
Пример #5
0
 void Update()
 {
     if (isOver)
     {
         return;
     }
     if (Input.GetMouseButton(0))
     {
         //Debug.Log("OnMouseDown");
         if (isDraw == false)
         {
             isDraw = true;
             int _index = hero.GetCurrentValue();
             int _exist = CheckExist(_index);
             if (_exist < 0)
             {
                 addCurrentArc(_index);
             }
             else
             {
                 getCurrentArc(_exist);
             }
         }
         else
         {
             int _index = hero.GetCurrentValue();
             int _exist = CheckExist(_index);
             if (_exist >= 0)
             {
                 combinedCurrentArc(_exist);
             }
             else if (_exist == -2)
             {
                 if (_index == 0)
                 {
                     currentArc.end = _index;
                 }
                 else
                 {
                     currentArc.end = _index;
                 }
             }
         }
     }
     else
     {
         if (isDraw)
         {
             isDraw = false;
             listArc.Add(currentArc);
             currentArc = null;
         }
     }
 }
Пример #6
0
    public void OnCreepTriger(Creep _creep)
    {
        float _distance = Vector3.Distance(_creep.transform.position, GameConstants.posCenter);

        if (Mathf.Abs(_distance - radiusShield) <= 0.1f)
        {
            for (int i = 0; i < listArc.Count; i++)
            {
                if (listArc[i].CheckCollision(_creep.index))
                {
                    SpawnController.instance.UnSpawnCreep(_creep.gameObject);
                    DrawArc _temp = listArc[i];
                    listArc.RemoveAt(i);
                    Destroy(_temp.gameObject);
                    score++;
                    return;
                }
            }
        }
        else
        {
            if (Mathf.Abs(_distance - hero.radius) <= 0.1f)
            {
                SpawnController.instance.UnSpawnCreep(_creep.gameObject);
                if (isOver == false)
                {
                    DrawCircles _temp = listCircle[0];
                    listCircle.RemoveAt(0);
                    Destroy(_temp.gameObject);
                    if (listCircle.Count == 0)
                    {
                        OnGameOver();
                    }
                }
                return;
            }
        }
    }
Пример #7
0
 void getCurrentArc(int _index)
 {
     currentArc = listArc[_index];
     listArc.RemoveAt(_index);
 }