Exemple #1
0
    void Update()
    {
        if (start == true)
        {
            count++;
            if (count >= 80)
            {
                count = 0;

                if (DF == null)
                {
                    Debug.LogWarning("DF is NUll!");
                    return;
                }
                tral++;
                UFO d = DF.GetUFO(round);
                if (Manager == null)
                {
                    Debug.LogWarning("Manager is NULL!");
                }
                Manager.PlayUFO(d);
                if (tral == 10)
                {
                    round++;
                    tral = 0;
                }
            }
        }
    }
Exemple #2
0
    public List <GameObject> GetUFOs(int round, ActionType type)
    {
        List <GameObject> ufos = new List <GameObject>();
        var count = GetUFOCount(round);

        for (int i = 0; i < count; ++i)
        {
            var index = random.Next(3);
            var obj   = factory.GetUFO(colors[index], type);
            obj.transform.position = GetRandomPosition();

            var ufo = obj.GetComponent <UFO>();
            ufo.score   = GetScore(round, index);
            ufo.visible = true;

            var speed     = GetSpeed(round);
            var direction = GetRandomDirection(type);
            if (type == ActionType.Kinematics)
            {
                KinematicsAction action = KinematicsAction.GetAction(direction, speed);
                actionManager.AddAction(obj, action);
            }
            else
            {
                PhysicsAction action = PhysicsAction.GetAction(direction, speed);
                actionManager.AddAction(obj, action);
            }

            ufos.Add(obj);
        }
        return(ufos);
    }
Exemple #3
0
 public void LaunchUFO()
 {
     if (count - leaveSeconds == 1)
     {
         count = leaveSeconds;
         GameObject ufo = ufoFactory.GetUFO(round);
         Debug.Log(ufo);
         ufos.Add(ufo);
         actionManager.addRandomAction(ufo);
     }
 }
Exemple #4
0
 public void LoadResources()
 {
     UFOList.Enqueue(UFOfactory.GetUFO(round));
 }