private void SendUFO()
    {
        float position_x = 16;

        if (UFO_queqe.Count != 0)
        {
            GameObject UFO = UFO_queqe.Dequeue();
            UFO_notshot.Add(UFO);
            UFO.SetActive(true);
            float ran_y = Random.Range(1f, 4f);
            float ran_x = Random.Range(-1f, 1f) < 0 ? -1 : 1;
            UFO.GetComponent <DiskData>().direction = new Vector3(ran_x, ran_y, 0);
            Vector3 position = new Vector3(-UFO.GetComponent <DiskData>().direction.x *position_x, ran_y, 0);
            UFO.transform.position = position;
            float power = Random.Range(10f, 15f);
            float angle = Random.Range(15f, 28f);
            action_manager.playDisk(UFO, angle, power, isPhysical); //改变
        }

        for (int i = 0; i < UFO_notshot.Count; i++)
        {
            GameObject temp = UFO_notshot[i];
            if (temp.transform.position.y < -10 && temp.gameObject.activeSelf == true)
            {
                UFO_factory.FreeDisk(UFO_notshot[i]);
                UFO_notshot.Remove(UFO_notshot[i]);
                user_gui.ReduceBlood();
            }
        }
    }
示例#2
0
 public void PlayDisk()
 {
     MyActionManager.playDisk(user.round);
 }