protected void InitMonstInfo() { //MonsterInfo.MonsterCharInfo monsterCharInfo; m_monsterInfo = GetComponent <MonsterInfo>(); m_monsterMove = GetComponent <MonsterMove>(); m_monsterMove.SetSpeed(m_monsterInfo.speed); }
void InitMonsterInfo() { MonsterInfo.MonsterCharInfo monsterCharInfo; if (StageDataManager.Inst.nowStage == StageDataManager.StageNameEnum.STAGE_1_1) { monsterCharInfo.level = 1; monsterCharInfo.maxHp = 300; monsterCharInfo.defensive = 10; monsterCharInfo.attack = 70; monsterCharInfo.attackDistance = 2.5f; monsterCharInfo.speed = 5.0f; m_monsterInfo = GetComponent <MonsterInfo>(); m_monsterInfo.SetInfo(monsterCharInfo); } else if (StageDataManager.Inst.nowStage == StageDataManager.StageNameEnum.STAGE_1_2) { monsterCharInfo.level = 1; monsterCharInfo.maxHp = 700; monsterCharInfo.defensive = 10; monsterCharInfo.attack = 150; monsterCharInfo.attackDistance = 2.5f; monsterCharInfo.speed = 5.0f; m_monsterInfo = GetComponent <MonsterInfo>(); m_monsterInfo.SetInfo(monsterCharInfo); } m_monsterMove = GetComponent <MonsterMove>(); m_monsterAttack = GetComponent <MonsterAttack>(); m_animFunction = transform.GetComponentInChildren <AnimFuntion>(); m_receiveDamage = GetComponent <ReceiveDamage>(); m_monsterHpBar = GetComponentInChildren <MonsterHpBar>(); m_monsterPosition = Monster_Position.Monster_Position_Ground; m_monsterMove.SetSpeed(m_monsterInfo.speed); m_bLive = true; }
/// <summary> /// 设置移动速度 /// </summary> /// <param name="speed">设置的速度</param> public void ChangeMoveSpeed(float speed) { move.SetSpeed(speed); }