Esempio n. 1
0
        // Use this for initialization
        void Start()
        {
            mMaxHP      = DataConfigure.Hero.HP;
            mHP         = mMaxHP;
            mAttackRate = DataConfigure.Hero.ATTACK_RATE;
            mSpeed      = DataConfigure.Hero.SPEED;
            mSpeedForce = DataConfigure.Hero.SPEED_FORCE;
            //mAttackInterval     = CaculateIntervalBetweenAttack();
            //mAttackTimeCount    = mAttackInterval;

            mPlayerAnimator    = transform.GetComponent <Animator>();
            mPlayerAudioSource = transform.GetComponent <AudioSource>();
            mPlayerRigidbody   = transform.GetComponent <Rigidbody>();

            mJoystick = transform.Find(DataConfigure.PATH_PLAYER_JOYSTICK).GetComponent <ScrollCircle>();

            mIsRunID = DataConfigure.IS_RUN_ID;

            mStone             = transform.Find("Stone");
            mStoneHitOffset[0] = DataConfigure.Hero.OFFSET_ATTACK_HIT;
            mStoneHitOffset[1] = DataConfigure.Hero.OFFSET_SKILL1_HIT;
            mStoneHitOffset[2] = DataConfigure.Hero.OFFSET_SKILL2_HIT;
            mStoneHitOffset[3] = DataConfigure.Hero.OFFSET_SKILL3_HIT;

            mAttack = new Skill(mPlayerAnimator, "AttackTrigger", 1f);
            mSkill1 = new Skill(mPlayerAnimator, "Skill1Trigger", 4f);
            mSkill2 = new Skill(mPlayerAnimator, "Skill2Trigger", 6f);
            mSkill3 = new Skill(mPlayerAnimator, "Skill3Trigger", 12f);
        }