コード例 #1
0
    public void ApplyMod(PowerupManager.PowerUps mod)
    {
        switch (mod)
        {
        case PowerupManager.PowerUps.BIGBALLS:
            transform.localScale = new Vector3(3, 3, 3);
            m_ActiveMods.Add(new Pair <PowerupManager.PowerUps, int>(PowerupManager.PowerUps.BIGBALLS, 0));
            ++m_SizeModsInUse;
            break;

        case PowerupManager.PowerUps.SMALLBALLS:
            transform.localScale = new Vector3(1.5f, 1.5f, 1.5f);
            m_ActiveMods.Add(new Pair <PowerupManager.PowerUps, int>(PowerupManager.PowerUps.SMALLBALLS, 0));
            ++m_SizeModsInUse;
            break;

        case PowerupManager.PowerUps.CLUSTERBALLS:
            GameObject.Instantiate(gameObject).transform.position = transform.position;
            GameObject.Instantiate(gameObject).transform.position = transform.position;
            break;

        case PowerupManager.PowerUps.BOUNCYBALLS:
            GetComponent <SphereCollider>().material = m_BouncyBallMat;
            ++m_BounceModsInUse;
            break;

        case PowerupManager.PowerUps.UNBOUNCYBALLS:
            GetComponent <SphereCollider>().material = m_UnbouncyBallMat;
            ++m_BounceModsInUse;
            break;
        }
    }
コード例 #2
0
 public void SetDisplayActive(PowerupManager.PowerUps nextPower)
 {
     m_BaseMask.transform.localPosition = m_UpperMaskPos;
     foreach (GameObject spr in m_PowerUpSprites)
     {
         spr.SetActive(false);
     }
     m_PowerUpSprites[(int)nextPower].SetActive(true);
 }
コード例 #3
0
    public void DisplayPower(PowerupManager.PowerUps power)
    {
        m_Base.SetActive(true);

        foreach (GameObject sym in m_PowerSymbols)
        {
            sym.SetActive(false);
        }

        m_PowerSymbols[(int)power].SetActive(true);
    }
コード例 #4
0
 public void StartRechargeAnim(int rechargeTime, PowerupManager.PowerUps nextPower)
 {
     m_RechargeTime  = rechargeTime;
     m_RechargeTimer = 0;
     foreach (GameObject spr in m_PowerUpSprites)
     {
         spr.SetActive(false);
     }
     m_PowerUpSprites[(int)nextPower].SetActive(true);
     m_recharging = true;
 }
コード例 #5
0
    public void AnnouncePower(PowerupManager.PowerUps power)
    {
        int colSel = (int)(Random.Range(0.0f, 0.999f) * m_PossibleTextCols.Length);

        m_tMesh.color = m_PossibleTextCols [colSel];
        m_AnnounceText.transform.localPosition = Vector3.zero;
        string announcement = "";
        int    choice;

        switch (power)
        {
        case PowerupManager.PowerUps.BIGBALLS:
            choice       = (int)(Random.Range(0.0f, 0.999f) * m_BigBallAnnounces.Length);
            announcement = m_BigBallAnnounces [choice];
            break;

        case PowerupManager.PowerUps.SMALLBALLS:
            choice       = (int)(Random.Range(0.0f, 0.999f) * m_SmallBallAnnounces.Length);
            announcement = m_SmallBallAnnounces [choice];
            break;

        case PowerupManager.PowerUps.CLUSTERBALLS:
            choice       = (int)(Random.Range(0.0f, 0.999f) * m_ClusterBallAnnounces.Length);
            announcement = m_ClusterBallAnnounces[choice];
            break;

        case PowerupManager.PowerUps.FLIPPERSWAP:
            choice       = (int)(Random.Range(0.0f, 0.999f) * m_FlipperSwapAnnounces.Length);
            announcement = m_FlipperSwapAnnounces[choice];
            break;

        case PowerupManager.PowerUps.SLOMO:
            choice       = (int)(Random.Range(0.0f, 0.999f) * m_SloMoAnnounces.Length);
            announcement = m_SloMoAnnounces[choice];
            break;

        case PowerupManager.PowerUps.BOUNCYBALLS:
            choice       = (int)(Random.Range(0.0f, 0.999f) * m_BouncyBallAnnounces.Length);
            announcement = m_BouncyBallAnnounces[choice];
            break;

        case PowerupManager.PowerUps.UNBOUNCYBALLS:
            choice       = (int)(Random.Range(0.0f, 0.999f) * m_UnbouncyBallsAnnounces.Length);
            announcement = m_UnbouncyBallsAnnounces[choice];
            break;
        }
        m_tMesh.text = announcement;



        m_AnnounceText.SetActive(true);
        m_TextActive = true;
    }