コード例 #1
0
ファイル: StartupScript.cs プロジェクト: benneb2/nball
    IEnumerator WaitForRequest(WWW www)
    {
        yield return(www);

        // check for errors
        if (www.error == null)
        {
            Debug.Log("WWW Ok! - result: " + www.data);
            GameList = new List <GameClass>();
            string[] games = www.data.Split('\n');
            foreach (string game in games)
            {
                string[] game_data = game.Split(';');
                if (game_data.Length == 3)
                {
                    //Debug.Log("Game between:Home " + game_data[0] + " and " + game_data[1] + " margin is " + game_data[2]);
                    GameClass tempgame = new GameClass(game_data[0], game_data[1], int.Parse(game_data[2]));
                    GameList.Add(tempgame);
                }
            }
            MainPlane mainplane = (MainPlane)GameObject.Find("PlaneMain").GetComponent <MainPlane>();
            mainplane.addGames(GameList);
        }
        else
        {
            Debug.Log("WWW Error: " + www.error);
        }
    }
コード例 #2
0
    private IEnumerator Step()
    {
        yield return(new WaitForSeconds(2));

        currentPlane              = Instantiate(mainPlane, mainPlane.transform.position, Quaternion.identity);
        currentPlane.OnDeadEvent += OnMainPlaneDead;
    }
コード例 #3
0
 private void Init()
 {
     mainPlane = Resources.Load <MainPlane>("Prefabs/Plane");
     //boss = Resources.Load<GameObject>("Prefabs/Enemys/Boss");
     data     = Resources.Load <PlayerData>("PlayerData");
     maxScore = data.maxScore;
 }
コード例 #4
0
    void Init()
    {
        mainPlane = Resources.Load <MainPlane>("Prefabs/MainPlane");
        bossPlane = Resources.Load <Boss>("Prefabs/Boss");
        date      = Resources.Load <PlayerData>("PlayerData");

        maxScore = date.maxScore;
    }
コード例 #5
0
    private IEnumerator RebornPlayer()
    {
        yield return(new WaitForSeconds(2));

        CurrentAirPlane              = Instantiate(mainPlane, mainPlane.transform.position, Quaternion.identity);
        GameManager.Instance.Player  = CurrentAirPlane;
        CurrentAirPlane.OnDeadEvent += OnMainPlaneDead;
    }
コード例 #6
0
    private IEnumerator Decorate()
    {
        //几时生成
        yield return(new WaitForSeconds(2));

        //生成什么
        CurrentPlane              = Instantiate(mainPlane, mainPlane.transform.position, Quaternion.identity);
        CurrentPlane.OnDeadEvent += OnMainPlaneDead;
    }
コード例 #7
0
    void OnCollisionEnter2D(Collision2D other)
    {
        MainPlane player = other.collider.GetComponent <MainPlane>();

        if (player != null)
        {
            player.ChangeHealth(hurt);
            Debug.Log("player health" + player.health);
        }
        Destroy(gameObject);
    }
コード例 #8
0
    private void Update()
    {
        trans.Translate(Vector3.left * Time.deltaTime * speed);
        MonsterBullet();

        if (LevelDirector.Instance.currentPlane == null)
        {
            return;
        }
        mainPlane = LevelDirector.Instance.currentPlane;
        Fire();
    }
コード例 #9
0
    private void Init()
    {
        mainPlane  = Resources.Load <MainPlane>("Prefab/MainPlane");
        mainEnemy  = Resources.Load <MainEnemy>("Prefab/Enemys/Enemy");
        bossPlane  = Resources.Load <MainBoss>("Prefab/Enemys/Boss");
        tankPrefab = Resources.Load <TankEnemy>("Prefab/Enemys/Tank");



        dataVolume = Resources.Load <GameData>("GameData");
        data       = Resources.Load <PlayerData>("PlayerData");
        maxScore   = data.maxScore;
    }
コード例 #10
0
    void OnTriggerEnter2D(Collider2D other)
    {
        MainPlane controller = other.GetComponent <MainPlane>();

        if (controller != null)
        {
            if (controller.firelevel < 7)
            {
                controller.firelevel++;
            }
            controller.PlaySound(collectedClip);
            Destroy(gameObject);
        }
    }
コード例 #11
0
    private IEnumerator Decorate()
    {
        yield return(new WaitForSeconds(2));

        CurrentAirPlane = Instantiate(mainPlane, mainPlane.transform.position, Quaternion.identity);
        Instantiate(mainEnemy, mainEnemy.transform.position, Quaternion.identity);
        GameManager.Instance.Player  = CurrentAirPlane;
        CurrentAirPlane.OnDeadEvent += OnMainPlaneDead;
        yield return(new WaitForSeconds(10));

        Instantiate(tankPrefab, tankPrefab.transform.position, Quaternion.identity);

        yield return(new WaitForSeconds(10));

        Instantiate(bossPlane, bossPlane.transform.position, Quaternion.identity);
    }
コード例 #12
0
ファイル: Tank.cs プロジェクト: 913883232/Plane
 void Update()
 {
     minX = ScreenXY.MinX - 1;
     Move();
     if (LevelDirector.Instance.currentPlane == null)
     {
         return;
     }
     mainplane  = LevelDirector.Instance.currentPlane;
     fireTimer += Time.deltaTime;
     if (fireTimer > rateTimer)
     {
         Fire();
         fireTimer = 0;
     }
     BarrelRotate();
 }
コード例 #13
0
    private void Update()
    {
        Move();

        if (GameManager.Instance.Player == null)
        {
            return;
        }
        mainPlane = GameManager.Instance.Player;

        fireTimer += Time.deltaTime;
        if (fireTimer > fireRate)
        {
            Fire();
            fireTimer = 0f;
        }
        BarrelRotate();
    }
コード例 #14
0
ファイル: Weapon.cs プロジェクト: city0409/MainPlane
 private void Awake()
 {
     mainPlane = GetComponent <MainPlane>();
 }