Exemple #1
0
    void Start()
    {
        bindID = group ? NFGUID.Zero : mLoginModule.mRoleID;

        //register callback
        mkernelModule.RegisterClassCallBack(Player.ThisName, OnClassPlayerEventHandler);

        //generally speaking, this object will be created after the player login (be created)
        //as a result, we must add the data when the UI object creating to show the data at the UI.

        NFIProperty xProperty = mkernelModule.FindProperty(bindID, propertyName);

        if (xProperty != null)
        {
            mkernelModule.RegisterPropertyCallback(bindID, propertyName, PropertyEventHandler);
            mkernelModule.RegisterGroupPropertyCallback(propertyName, PropertyEventHandler);

            NFIProperty property = mkernelModule.FindProperty(bindID, propertyName);
            if (property != null)
            {
                NFDataList.TData data = property.GetData();
                PropertyEventHandler(bindID, propertyName, null, data, 0);
            }
        }
        else
        {
            Debug.LogError("there have not a property named: " + propertyName + "  " + this.transform.parent.parent.name + "/" + this.transform.parent.name + "/" + this.gameObject.name);
        }

        /*
         *      switch (xProperty.GetType())
         *      {
         *              case NFDataList.VARIANT_TYPE.VTYPE_INT:
         *
         *
         *      }
         */



        if (type == ViewType.ORIGINAL)
        {
            Text xText = gameObject.GetComponent <Text> ();
            if (xText != null)
            {
                if (xText.text == "0" || xText.text.Length <= 0)
                {
                    //xText.enabled = false;
                }
            }
        }
    }
Exemple #2
0
    void Start()
    {
        // tell the scroller that this script will be its delegate
        _data = new List <NFRecordRowData>();

        mkernelModule.RegisterClassCallBack(NFrame.Player.ThisName, OnClassPlayerEventHandler);

        //generally speaking, this object will be created after the player login (be created)
        //as a result, we must add the data when the UI object creating to show the data at the UI.
        if (!group)
        {
            xGUID = mLoginModule.mRoleID;
        }
        else
        {
            xGUID = new NFGUID();
        }
        {
            NFIRecord xRecord = mkernelModule.FindRecord(mLoginModule.mRoleID, recordName);
            if (xRecord != null)
            {
                mkernelModule.RegisterRecordCallback(mLoginModule.mRoleID, recordName, RecordEventHandler);
                for (int i = 0; i < xRecord.GetRows(); ++i)
                {
                    if (xRecord.IsUsed(i))
                    {
                        RecordEventHandler(mLoginModule.mRoleID, recordName, NFIRecord.ERecordOptype.Add, i, 0, null, null);
                    }
                }
            }
            else
            {
                Debug.LogError("no this record " + recordName);
            }
        }

        // load in a large set of data
        //LoadData();
    }