Ejemplo n.º 1
0
 private void EmotionalAct()
 {
     for (int i = 0; i < RoomManager.Instance.RU.Length; i++)
     {
         GameObject gameObject = BrickManManager.Instance.Get(RoomManager.Instance.RU[i].seq);
         if (null != gameObject)
         {
             TPController component = gameObject.GetComponent <TPController>();
             if (null != component)
             {
                 string empty = string.Empty;
                 float  num   = (float)i / (float)RoomManager.Instance.RU.Length;
                 empty = ((num < 0.2f) ? grade1st[UnityEngine.Random.Range(0, grade1st.Length)] : ((!(num < 0.6f)) ? grade3rd[UnityEngine.Random.Range(0, grade3rd.Length)] : grade2nd[UnityEngine.Random.Range(0, grade2nd.Length)]));
                 component.EmotionalAct(empty);
             }
         }
     }
 }
Ejemplo n.º 2
0
    private void EmotionalAct()
    {
        int          num          = 0;
        TPController tPController = null;

        for (int i = 0; i < RoomManager.Instance.RU.Length; i++)
        {
            if (!RoomManager.Instance.RU[i].red)
            {
                GameObject gameObject = BrickManManager.Instance.Get(RoomManager.Instance.RU[i].seq);
                if (null != gameObject)
                {
                    TPController component = gameObject.GetComponent <TPController>();
                    if (null != component)
                    {
                        string ani = win[UnityEngine.Random.Range(0, win.Length)];
                        if (cvtEndCode == -1)
                        {
                            ani          = lose[UnityEngine.Random.Range(0, lose.Length)];
                            tPController = component;
                        }
                        else if (num == 0)
                        {
                            ani = winner[UnityEngine.Random.Range(0, winner.Length)];
                        }
                        num++;
                        component.EmotionalAct(ani);
                    }
                }
            }
        }
        num = 0;
        for (int j = 0; j < RoomManager.Instance.RU.Length; j++)
        {
            if (RoomManager.Instance.RU[j].red)
            {
                GameObject gameObject2 = BrickManManager.Instance.Get(RoomManager.Instance.RU[j].seq);
                if (null != gameObject2)
                {
                    TPController component2 = gameObject2.GetComponent <TPController>();
                    if (null != component2)
                    {
                        string ani2 = win[UnityEngine.Random.Range(0, win.Length)];
                        if (cvtEndCode == 1)
                        {
                            ani2         = lose[UnityEngine.Random.Range(0, lose.Length)];
                            tPController = component2;
                        }
                        else if (num == 0)
                        {
                            ani2 = winner[UnityEngine.Random.Range(0, winner.Length)];
                        }
                        num++;
                        component2.EmotionalAct(ani2);
                    }
                }
            }
        }
        if (null != tPController)
        {
            tPController.EmotionalAct(loser[UnityEngine.Random.Range(0, loser.Length)]);
        }
    }