Пример #1
0
    //二维码语音
    IEnumerator PlayVoiceIe()
    {
        int tTime    = 0;
        int index    = 0;
        int cTime    = 0;
        int cRunTime = 0;
        int count    = elist.Count;

        while (tTime <= 60)
        {
            if (cRunTime >= cTime)//此时语音已播完
            {
                animator.enabled = false;
                xiaoP.sprite     = UIAtlasManager.LoadSprite(UIAtlasName.UIQRCode, "1");
            }
            if (index < count && elist[index].Time == tTime.ToString())
            {
                animator.enabled = true;
                SDKManager.Instance.Speak(elist[index].TimeContent);
                cTime    = Convert.ToInt32(elist[index].WinTime);
                cRunTime = 0;
                index++;
            }
            yield return(new WaitForSeconds(1));

            cRunTime++;
            tTime++;
        }
        SDKManager.Instance.CustomQuit();
    }
Пример #2
0
 private void RestStartUpdate()
 {
     num1 = 3;
     num2 = 0;
     time_1.overrideSprite = UIAtlasManager.LoadSprite(UIAtlasName.UIMain, num1.ToString());
     time_2.overrideSprite = UIAtlasManager.LoadSprite(UIAtlasName.UIMain, num2.ToString());
     aciton = null;
     aciton = NormalUpdate;
 }
Пример #3
0
    //设置曲线值
    private void SetQuXImg()
    {
        Sprite sp     = quxian.sprite;
        int    random = 0;

        while (sp == quxian.sprite)
        {
            random = UnityEngine.Random.Range(1, 4);
            sp     = UIAtlasManager.LoadSprite(UIAtlasName.UIMain, "Bo-0" + random);
        }
        quxian.sprite = sp;
        SDKManager.Instance.randomQuXian = random;//就一种速度
    }
Пример #4
0
    //设置警察图片
    private void SetPoliceImg(bool isShoot)
    {
        string imgName = "";

        if (isShoot)
        {
            imgName = "police_shoot";
            police_img.transform.localPosition = new Vector3(53, 106, 0);
        }
        else
        {
            imgName = "police_idel";
            police_img.transform.localPosition = new Vector3(0, 116, 0);
        }
        police_img.sprite = UIAtlasManager.LoadSprite(UIAtlasName.UIMain, imgName);
        police_img.SetNativeSize();
    }
Пример #5
0
    private void NormalUpdate()
    {
        int number = 30 - Convert.ToInt32(num1 + "" + num2);

        PlayingAction(number);
        if (num2 == 0)
        {
            num2 = 9;
            num1--;
        }
        else
        {
            num2--;
        }
        if (num1 >= 0 && num2 >= 0)
        {
            time_1.overrideSprite = UIAtlasManager.LoadSprite(UIAtlasName.UIMain, num1.ToString());
            time_2.overrideSprite = UIAtlasManager.LoadSprite(UIAtlasName.UIMain, num2.ToString());
        }
    }
Пример #6
0
    //创建物体
    void CreateGameObject()
    {
        GameObject tempObj = null;
        GameEntity entity  = null;

        if (modelWheel && parentWheel)
        {
            Image  img;
            Text   duiImg;
            Text   duiImg2;
            Sprite sp = null;
            if (modelWheel && parentWheel)
            {
                for (int i = 0; i < 14; i++)
                {
                    float posX = i * 86;
                    if (i == 0)
                    {
                        tempObj = modelWheel;
                        tempObj.SetActive(true);
                    }
                    else
                    {
                        tempObj = CommTool.InstantiateObj(modelWheel, parentWheel, new Vector3(posX, 0, 0), Vector3.one * wheel, "wheels" + i);
                    }
                    tempObj.transform.GetComponent <Image>().overrideSprite = sp;
                    entity = new GameEntity(tempObj);
                    list.Add(entity);
                }
            }
            if (modelPang && parentPang)
            {
                tempPange = CommTool.InstantiateObj(modelPang, parentPang, Vector3.zero, Vector3.one * xiaoPang, "tempPange");
                img       = tempPange.GetComponent <Image>();
                duiImg2   = CommTool.GetCompentCustom <Text>(tempPange, "dui");
                tempPange.SetActive(false);
                string  img_name = "j-";
                string  new_name = string.Empty;
                Vector3 pos      = Vector3.zero;
                for (int i = 0; i < 4; i++)
                {
                    int num = i + 1;
                    new_name = img_name + num;
                    if (i == 0)
                    {
                        tempObj      = modelPang;
                        tempObj.name = new_name;
                        tempObj.SetActive(true);
                    }
                    else
                    {
                        pos.x   = i * 380;
                        tempObj = CommTool.InstantiateObj(modelPang, parentPang, pos, Vector3.one * xiaoPang, new_name);
                    }
                    sp = UIAtlasManager.LoadSprite(UIAtlasName.UIMain, new_name);
                    tempObj.transform.GetComponent <Image>().overrideSprite = sp;
                    duiImg = CommTool.GetCompentCustom <Text>(tempObj, "dui");
                    entity = new GameEntity(tempObj, img, sp, duiImg, duiImg2);
                    listPang.Add(entity);
                }

                for (int i = 0; i < 4; i++)
                {
                    if (i == 0)
                    {
                        listPang[i].last = listPang[3];
                    }
                    else
                    {
                        listPang[i].last = listPang[i - 1];
                    }
                }
            }
        }
    }