Esempio n. 1
0
    public void Set(GameData.EnemyType t, int count, float interval)
    {
        var idx = (int)t;

        remains[idx]   = count;
        intervals[idx] = interval;
    }
Esempio n. 2
0
    public void MakeMissile(GameData.EnemyType _type, Vector3 _startPos, Vector3 _targetPos)
    {
        var _info = GameData.Instance.GetEnemyInfo(_type);

        var prefab = Resources.Load <GameObject>(_info.prefab);
        var go     = Instantiate(prefab);
        var p      = go.GetComponent <EnemyMissile>();

        p.Set(_startPos, _targetPos, Random.Range(_info.minSpeed, _info.maxSpeed));
        p.HP = _info.HP;

        listEnemy.Add(go.GetComponent <Enemy>());
    }
Esempio n. 3
0
    public void MakeBoss(GameData.EnemyType _type)
    {
        var _info = GameData.Instance.GetEnemyInfo(_type);

        var startPos = new Vector3(0.0f, 4.0f, 0);
        var prefab   = Resources.Load <GameObject>(_info.prefab);
        var go       = Instantiate(prefab);
        var p        = go.GetComponent <Boss>();

        p.Set(startPos);
        p.HP = _info.HP;

        listEnemy.Add(go.GetComponent <Enemy>());
    }
Esempio n. 4
0
    public void MakeUFO(GameData.EnemyType _type)
    {
        var _info = GameData.Instance.GetEnemyInfo(_type);

        var startPos = new Vector3(Random.Range(-5.0f, 5.0f), Random.Range(3.5f, 4.5f), 0);
        var prefab   = Resources.Load <GameObject>(_info.prefab);
        var go       = Instantiate(prefab);
        var p        = go.GetComponent <UFO>();

        p.Set(startPos, Random.Range(_info.minSpeed, _info.maxSpeed), 4.0f);
        p.HP = _info.HP;

        listEnemy.Add(go.GetComponent <Enemy>());
    }