Пример #1
0
    //private float lastPos;

    // Use this for initialization
    void Awake()
    {
        mInstance   = this;
        flashSprite = flash.GetComponent <Image>();
        cameraShake = Camera.main.GetComponent <CameraShake>();

        //lastPos = main.transform.position.x;
    }
Пример #2
0
    private void SetAllInfo(RectTransform rt, PBulletin Info)
    {
        if (Info == null)
        {
            return;
        }
        TweenColor txtmain  = rt.transform.Find("txt/TXT").GetComponent <TweenColor>();
        var        txtother = rt.transform.Find("txt/TXT2");
        Text       Title1   = txtmain?.GetComponent <Text>();
        Text       Title2   = txtother?.GetComponent <Text>();

        if (Title1 != null)
        {
            Util.SetText(Title1, Info.title);
        }
        if (Title2 != null && txtother != null)
        {
            txtother.gameObject.SetActive(!string.IsNullOrEmpty(Info.subTitle));
            Util.SetText(Title2, Info.subTitle);
        }

        GameObject SelectOn = rt.transform.Find("selectbox")?.gameObject;
        Image      NewImg   = rt.transform.Find("new_img")?.GetComponent <Image>();
        bool       isshow   = moduleAnnouncement.NotClick.Exists(a => a == Info.id);

        NewImg.SafeSetActive(isshow);
        var select = Info.id == moduleAnnouncement.PInfo?.id;

        SelectOn?.gameObject.SetActive(select);

        if (select)
        {
            txtmain.Play();
        }
        else
        {
            txtmain.PlayReverse();
        }
    }