Exemplo n.º 1
0
 public static void CoinSetdown(float num)
 {
     for (int i = 1; i <= (int)num * 3; i++)
     {
         HGObjectPool.GetIns().Depool(CoinQueue.Dequeue());
     }
 }
Exemplo n.º 2
0
    public void Environ_Init()
    {
        posX   = 0;
        passed = 0;
        CharacterEntity.GetComponent <HGCharacter>().ResetScore();
        while (HGBlock.BlockQueue.Count > 0)
        {
            HGObjectPool.GetIns().Depool(HGBlock.BlockQueue.Dequeue());
        }
        while (HGBlock.CoinQueue.Count > 0)
        {
            HGObjectPool.GetIns().Depool(HGBlock.CoinQueue.Dequeue());
        }
        GameObject objTemp = HGObjectPool.GetIns().Enpool(HGBlock.getBlock(HGBlockType.Mode_Start) as GameObject);

        objTemp.GetComponent <Transform>().position = new Vector3(posX++ *width, 0f, 0f);
        objTemp.transform.SetParent(EnvironEntity.transform);
        HGBlock.BlockQueue.Enqueue(objTemp);
        GameObject objTemp2 = HGBlock.getBlock(HGBlockType.Mode_Flypee) as GameObject;

        while (posX <= 2)
        {
            GameObject objTemp1 = HGObjectPool.GetIns().Enpool(objTemp2);
            objTemp1.GetComponent <Transform>().position = new Vector3(posX++ *width, 0f, 0f);
            HGBlock.FlypeeSetup(ref objTemp1, blank);
            objTemp1.transform.SetParent(EnvironEntity.transform);
            HGBlock.BlockQueue.Enqueue(objTemp1);
        }
    }
Exemplo n.º 3
0
    public static void CoinSetup(float posx, float posy, float num)
    {
        GameObject coin = HGAssetBundleLoader.GetIns().GetBundle("prefabs").LoadAsset("Coins_.prefab") as GameObject;
        GameObject coinT;

        for (int i = -1; i <= -2 + num; i++)
        {
            coinT = HGObjectPool.GetIns().Enpool(coin);
            coinT.transform.position = new Vector3(posx + HGEnvironment.width / (3 * num) * i, posy + (float)ra.Next(50, 150) / 100 * HGEnvironment.blank / 2);
            coinT.transform.SetParent(GameObject.FindWithTag("Environment_").transform);
            coinT.transform.GetChild(0).gameObject.GetComponent <Renderer>().enabled = true;
            CoinQueue.Enqueue(coinT);
        }
        for (int i = 1; i <= num; i++)
        {
            coinT = HGObjectPool.GetIns().Enpool(coin);
            HGObjectPool.GetIns().Depool(coinT);
        }
    }
Exemplo n.º 4
0
    public void Environ_Update()
    {
        passed++;
        if (passed <= 1)
        {
            return;
        }
        HGObjectPool.GetIns().Depool(HGBlock.BlockQueue.Dequeue());
        GameObject objTemp1 = HGObjectPool.GetIns().Enpool(HGBlock.getBlock(HGBlockType.Mode_Flypee) as GameObject);

        objTemp1.GetComponent <Transform>().position = new Vector3(posX++ *width, 0f, 0f);
        HGBlock.FlypeeSetup(ref objTemp1, blank);
        objTemp1.transform.SetParent(EnvironEntity.transform);
        HGBlock.BlockQueue.Enqueue(objTemp1);
        if (passed <= 2)
        {
            return;
        }
        HGBlock.CoinSetdown(3);
    }
Exemplo n.º 5
0
 void HGm_back()
 {
     HGBlock.Clear();
     HGObjectPool.GetIns().Clear();
     SceneManager.LoadScene(0);
 }