예제 #1
0
    void Start()
    {
        mStateMachineMng = GetComponent <NFAnimaStateMachine>();
        mBodyIdent       = GetComponent <NFBodyIdent>();
        mHeroMotor       = GetComponent <NFHeroMotor>();

        mUIModule    = NFPluginManager.Instance().FindModule <NFUIModule>();
        mLoginModule = NFPluginManager.Instance().FindModule <NFLoginModule>();

        mKernelModule = NFPluginManager.Instance().FindModule <NFIKernelModule>();

        mKernelModule.RegisterPropertyCallback(mBodyIdent.GetObjectID(), NFrame.Player.MOVE_SPEED, PropertyMoveSpeedHandler);
        mKernelModule.RegisterPropertyCallback(mBodyIdent.GetObjectID(), NFrame.Player.ATK_SPEED, PropertyAttackSpeedHandler);

        mHeroMotor.angularSpeed = 0f;
    }
예제 #2
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);

            PropertyEventHandler(bindID, propertyName, null, null);
        }
        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;
                }
            }
        }
    }
예제 #3
0
    // Use this for initialization
    public override void Init()
    {
        mHead.onClick.AddListener(OnBagClick);
        mBag.onClick.AddListener(OnBagClick);
        mHero.onClick.AddListener(OnHeroClick);
        mChat.onClick.AddListener(OnChatClick);
        mFriend.onClick.AddListener(OnFriendClick);

        setting.onClick.AddListener(OnSettingClick);
        s1Button.onClick.AddListener(OnS1Click);
        s2Button.onClick.AddListener(OnS2Click);
        s3Button.onClick.AddListener(OnS3Click);
        s4Button.onClick.AddListener(OnS4Click);


        mKernelModule.RegisterPropertyCallback(mLoginModule.mRoleID, NFrame.Player.ConfigID, OnConfigIDChange);
        mKernelModule.RegisterPropertyCallback(mLoginModule.mRoleID, NFrame.Player.HP, OnHPChange);
        mKernelModule.RegisterPropertyCallback(mLoginModule.mRoleID, NFrame.Player.MAXHP, OnHPChange);
    }
예제 #4
0
    void Start()
    {
        mAnima             = GetComponent <NFAnimatStateController>();
        mBodyIdent         = GetComponent <NFBodyIdent>();
        mAnimaStateMachine = GetComponent <NFAnimaStateMachine>();
        mHeroInput         = GetComponent <NFHeroInput>();
        mHeroSync          = GetComponent <NFHeroSync>();

        mxGUID        = mBodyIdent.GetObjectID();
        moveDirection = new Vector3();

        mKernelModule.RegisterPropertyCallback(mxGUID, NFrame.Player.MOVE_SPEED, PropertyEventHandler);
    }