Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     mHPProgressBar = BloodProgress.CreateBloodProgress(this.gameObject, new Vector3(0, 4, 0));
     if (mHPProgressBar != null)
     {
         mHPProgressBar.SetValue(mHP / mMaxHP);
         mHPProgressBar.SetText(mHP + "/" + mMaxHP);
     }
     mCharacter = gameObject.GetComponent <CharacterController>();
     mAnimation = gameObject.GetComponent <Animation>();
     mAnimation.Play("ZhanLi_TY");
 }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        mAnimation     = gameObject.GetComponent <Animation>();
        mCharacter     = gameObject.GetComponent <CharacterController>();
        mStartPosition = transform.position;
        mHPProgressBar = BloodProgress.CreateBloodProgress(this.gameObject, new Vector3(0, 5, 0));
        if (mHPProgressBar != null)
        {
            mHPProgressBar.SetValue(mHP / mMaxHP);
            mHPProgressBar.SetText(Mathf.Max(mHP, 0) + "/" + mMaxHP);
        }
        mWanderRadius = 15f;
        mChaseRadius  = 20f;
        mAttackRadius = 7f;
        mMaxDistance  = 30f;
        mResetTime    = 2f;

        mMoveSpeed = 300f;
        mState     = MonsterState.WALK;
        NPCInfoController.CreateInfoItem("大龙怪物", "whiteper", mMaxHP, this.gameObject);
    }