public void IntializeEnemyInfo3V3(Role_Camp camp) { enemyInfo = new DeathInfo[1]; for (int i = 0; i < 3; i++) { Role_Main temp1 = Scence3v3_Intialize.Instance.role_Players [i].GetComponent <Role_Main> (); Role_Main temp2 = Scence3v3_Intialize.Instance.role_AIs [i].GetComponent <Role_Main>(); if (camp == Role_Camp.Blue) { if (temp1.roleCamp == Role_Camp.Red) { enemyInfo [0].roleMain = temp1; } if (temp2.roleCamp == Role_Camp.Red) { enemyInfo [0].roleMain = temp2; } } if (camp == Role_Camp.Red) { if (temp1.roleCamp == Role_Camp.Blue) { enemyInfo [0].roleMain = temp1; } if (temp2.roleCamp == Role_Camp.Blue) { enemyInfo [0].roleMain = temp2; } } } }
public void IntializeEnemyInfo1V1(Role_Camp camp) { Debug.Log("初始化IntializeEnemyInfo1V1"); enemyInfo = new DeathInfo[1]; Role_Main temp1 = Scence1v1_Intialize.Instance.role_Player.GetComponent <Role_Main> (); Role_Main temp2 = Scence1v1_Intialize.Instance.role_AI.GetComponent <Role_Main> (); if (camp == Role_Camp.Blue) { if (temp1.roleCamp == Role_Camp.Red) { enemyInfo [0].roleMain = temp1; } if (temp2.roleCamp == Role_Camp.Red) { enemyInfo [0].roleMain = temp2; } } if (camp == Role_Camp.Red) { if (temp1.roleCamp == Role_Camp.Blue) { enemyInfo [0].roleMain = temp1; } if (temp2.roleCamp == Role_Camp.Blue) { enemyInfo [0].roleMain = temp2; } } }
public override void GetHurt(int hurt_Physic, int hurt_Magic, Role_Main role) // 技能被动说明:普攻伤害 { if (!IsDeath) { this.RoleAtk = role; Hp = Hp - hurt_Physic + hurt_Physic * DefensePhysical / (DefensePhysical + 100) - hurt_Magic + hurt_Magic * DefenseMagic / (DefenseMagic + 100); if (Hp <= 0) { Hp = 0; GetComponent <HpShow> ().HpSilider.value = 0f; role.soliderKillCount++; role.ReceiveExpAndGold(worthExp, worthMoney); Collider[] cols = Physics.OverlapSphere(transform.position, expRadius, EnemyLayer); //给周围的英雄加金币 if (cols.Length > 0) { for (int i = 0; i < cols.Length; i++) { if (cols [i].gameObject.layer == EnemyLayerNum && cols[i].GetComponent <Role_Main>() != null) { cols [i].GetComponent <Role_Main> ().ReceiveExpAndGold(worthExp, 0); } } } transform.GetComponent <CharacterController> ().enabled = false; Destroy(this.gameObject, 0.2f); } } }
public void GetNumber(Role_Main role) { this.roleMain = role; this.attack_Physical = role.attack_Physical; this.attack_Magic = role.attack_Magic; moveSpeed = 2.6f; }
// Use this for initialization void Start() { handMoveRange = 60; moveSpeed = 0.01f; isMoving = false; if (mapSelect == MapSelect.oneVSone) { player = Scence1v1_Intialize.Instance.role_Player.GetComponent <Role_Main> (); } else { player = Scence3v3_Intialize.Instance.role_Players[0].GetComponent <Role_Main> (); } instance = this; handStartPos = handControl.position; expData = transform.Find("DataPanel/DetailPanel/EXP/Text").GetComponent <Text>(); hpData = transform.Find("DataPanel/DetailPanel/HP/Text").GetComponent <Text>(); mpData = transform.Find("DataPanel/DetailPanel/MP/Text").GetComponent <Text>(); pDamData = transform.Find("DataPanel/DetailPanel/PDam/Text").GetComponent <Text>(); mDamData = transform.Find("DataPanel/DetailPanel/MDam/Text").GetComponent <Text>(); pDefData = transform.Find("DataPanel/DetailPanel/PDef/Text").GetComponent <Text>(); mDefData = transform.Find("DataPanel/DetailPanel/MDef/Text").GetComponent <Text>(); msData = transform.Find("DataPanel/DetailPanel/MS/Text").GetComponent <Text>(); asData = transform.Find("DataPanel/DetailPanel/AS/Text").GetComponent <Text>(); head = transform.Find("DataPanel/DetailPanel/Head/Head").GetComponent <Image>(); tex_Skill_Q = transform.Find("OperatePanel/Skill_Q").GetComponent <Image>(); tex_Skill_W = transform.Find("OperatePanel/Skill_W").GetComponent <Image>(); tex_Skill_E = transform.Find("OperatePanel/Skill_E").GetComponent <Image>(); tex_Skill_D = transform.Find("OperatePanel/Skill_D").GetComponent <Image>(); tex_Skill_F = transform.Find("OperatePanel/Skill_F").GetComponent <Image>(); detailNormalButton = transform.Find("DataPanel/DetailButton/Normal").gameObject; detailClickedButton = transform.Find("DataPanel/DetailButton/Clicked").gameObject; detailPanel = transform.Find("DataPanel/DetailPanel").gameObject; buyPanel = transform.Find("DataPanel/BuyPanel").gameObject; setPanel = transform.Find("DataPanel/SetPanel").gameObject; detailPanel.SetActive(false); buyPanel.SetActive(false); setPanel.SetActive(false); button_DetailButton = GameObject.Find("UI/DataPanel/DetailButton").GetComponent <Button>(); EventTriggerListener.Get(button_DetailButton.gameObject).onClick = OnDetailButtonClick; button_BuyButton = GameObject.Find("UI/DataPanel/BuyButton").GetComponent <Button>(); EventTriggerListener.Get(button_BuyButton.gameObject).onClick = OnBuyBUttonClick; button_SettingButton = GameObject.Find("UI/DataPanel/SettingButton").GetComponent <Button>(); EventTriggerListener.Get(button_SettingButton.gameObject).onClick = OnSetButtonClick; tex_Item1 = transform.Find("DataPanel/DetailPanel/Item/Slot1").GetComponent <Image> (); tex_Item2 = transform.Find("DataPanel/DetailPanel/Item/Slot2").GetComponent <Image> (); tex_Item3 = transform.Find("DataPanel/DetailPanel/Item/Slot3").GetComponent <Image> (); tex_Item4 = transform.Find("DataPanel/DetailPanel/Item/Slot4").GetComponent <Image> (); tex_Item5 = transform.Find("DataPanel/DetailPanel/Item/Slot5").GetComponent <Image> (); tex_Item6 = transform.Find("DataPanel/DetailPanel/Item/Slot6").GetComponent <Image> (); }
public void IntializeOtherkill(string pathTemp) { HeroChooseInfoS chioce = JsonUti.JsonstreamToObject <HeroChooseInfoS> (pathTemp); Role_Main player = role_Player.GetComponent <Role_Main> (); Role_Main AIPlayer = role_AI.GetComponent <Role_Main> (); player.skill_D.skillName = chioce.hero [0].Skill_D; player.skill_F.skillName = chioce.hero [0].Skill_F; AIPlayer.skill_D.skillName = chioce.hero [3].Skill_D; AIPlayer.skill_F.skillName = chioce.hero [3].Skill_F; }
public override void GetHurt(int hurt_Physic, int hurt_Magic, Role_Main role) // 技能被动说明:普攻伤害 { Hp = Hp - hurt_Physic + hurt_Physic * DefensePhysical / (DefensePhysical + 100) - hurt_Magic + hurt_Magic * DefenseMagic / (DefenseMagic + 100); if (Hp <= 0) { Debug.Log("你补到一个小兵啦"); Hp = 0; GetComponent <HpShow> ().HpSilider.value = 0f; Destroy(this.gameObject, 1f); role.soliderKillCount++; role.ReceiveExpAndGold(worthExp, worthMoney); } }
public override void GetHurt(int hurt_Physic, int hurt_Magic, Role_Main roleMain) { if (IsDeath == false) { Hp = Hp - hurt_Physic + hurt_Physic * DefensePhysical / (DefensePhysical + 100) - hurt_Magic + hurt_Magic * DefenseMagic / (DefenseMagic + 100); if (Hp <= 0) { roleMain.ReceiveExpAndGold(worthExp, worthMoney); IsDeath = true; ani.SetTrigger("CanDeath"); colRole.enabled = false; } } }
public override void GetHurt(int hurt_Physic, int hurt_Magic, Role_Main roleMain) { if (IsDeath == false) { Hp = Hp - hurt_Physic + hurt_Physic * DefensePhysical / (DefensePhysical + 100) - hurt_Magic + hurt_Magic * DefenseMagic / (DefenseMagic + 100); if (Hp <= 0) { roleMain.ReceiveExpAndGold(worthExp, worthMoney); IsDeath = true; colRole.enabled = false; Destroy(transform.Find("Tower_base/Tower_Long").gameObject, 1f); } } }
// Use this for initialization void Start() { Add_Skill_Q = GameObject.Find("UI/OperatePanel/Skill_Q/Add_Skill_Q"); Add_Skill_W = GameObject.Find("UI/OperatePanel/Skill_W/Add_Skill_W"); Add_Skill_E = GameObject.Find("UI/OperatePanel/Skill_E/Add_Skill_E"); HideAddSkillButton(); uiManager = GameObject.Find("UI").GetComponent <UIManager> (); //1V1 or 3V3 roleMain = GetComponent <Role_Main>(); for (int i = 1; i < 5; i++) { HideSkillLevelCircle(i, "Q"); HideSkillLevelCircle(i, "W"); HideSkillLevelCircle(i, "E"); } }
// Use this for initialization void Start() { NumKill = GameObject.Find("UI/DataPanel/KillorDeath/PersonalData/Kill").GetComponent <Text>(); NumDeath = GameObject.Find("UI/DataPanel/KillorDeath/PersonalData/Death").GetComponent <Text>(); NumCount = GameObject.Find("UI/DataPanel/KillorDeath/PersonalData/SoliderCount").GetComponent <Text>(); NumAssists = GameObject.Find("UI/DataPanel/KillorDeath/PersonalData/Assists").GetComponent <Text>(); uiManager = GameObject.Find("UI").GetComponent <UIManager> (); if (uiManager.mapSelect == MapSelect.oneVSone) { roleMain = Scence1v1_Intialize.Instance.role_Player.GetComponent <Role_Main> (); } else { roleMain = Scence3v3_Intialize.Instance.role_Players[0].GetComponent <Role_Main> (); } }
// private AnimatorController ac = RuntimeAnimatorController as AnimatorController; 控制单个动画时使用 // private StateMachine sm=ac.GetLayer(0).stateMachine; void Start() { info = GetComponent <Role_Main> (); camp = GetComponent <RoleInfo> ().roleCamp; paths = ChoicePaths(camp); layerEnemy = GetComponent <RoleInfo> ().EnemyLayer; soliderAgent = transform.GetComponent <NavMeshAgent> (); ani = GetComponent <Animator> (); if (paths != null && paths.Length > 0) { target = paths[index]; } // bullet =Resources .Load <GameObject>("Prefeb_Role/bullet_S"); }
public override void GetHurt(int hurt_Physic, int hurt_Magic, Role_Main roleMain) { if (IsDeath == false) { Hp = Hp - hurt_Physic + hurt_Physic * DefensePhysical / (DefensePhysical + 100) - hurt_Magic + hurt_Magic * DefenseMagic / (DefenseMagic + 100); for (int i = 0; i < enemyInfo.Length; i++) //统计助攻; { if (enemyInfo[i].roleMain.insertID == roleMain.insertID) { enemyInfo [i].time_LastAtk = 0f; } } if (Hp <= 0) { IsDeath = true; } } }
// Use this for initialization void Start() { Add_Skill_Q = GameObject.Find("UI/OperatePanel/Skill_Q/Add_Skill_Q"); Add_Skill_W = GameObject.Find("UI/OperatePanel/Skill_W/Add_Skill_W"); Add_Skill_E = GameObject.Find("UI/OperatePanel/Skill_E/Add_Skill_E"); HideAddSkillButton(); uiManager = GameObject.Find("UI").GetComponent <UIManager> (); //1V1 or 3V3 if (uiManager.mapSelect == MapSelect.oneVSone) { roleMain = Scence1v1_Intialize.Instance.role_Player.GetComponent <Role_Main> (); } else { roleMain = Scence3v3_Intialize.Instance.role_Players [0].GetComponent <Role_Main> (); } for (int i = 1; i < 5; i++) { HideSkillLevelCircle(i, "Q"); HideSkillLevelCircle(i, "W"); HideSkillLevelCircle(i, "E"); } }
public void IntializeDataRole(GameObject role, Enum_Role enumRole) { Data_Rloe data = ChoiceDataRole(enumRole); Role_Main playerData = role.GetComponent <Role_Main> (); playerData.skinNum = data.skinNum; playerData.type_Allrole = data.RorS; playerData.HpMax = data.HpMax; playerData.MpMax = data.MpMax; playerData.DefensePhysical = data.DefensePhysical; playerData.DefenseMagic = data.DefenseMagic; playerData.attack_Physical = data.attack_Physical; playerData.attack_Magic = data.attack_Magic; playerData.moveSpeed = data.moveSpeed; playerData.attack_Radius = data.attack_Radius; playerData.attack_Speed = data.attack_Speed; playerData.Level = data.Level; playerData.Level_exp = data.Levl_exp; if (role.GetComponent <RoleInfo>().type_Range == Type_Range.Long) //初始化子弹层 { role.transform.FindChild("weapon/WEAPON_1").gameObject.layer = LayerMask.NameToLayer("Bullet"); } }
// Use this for initialization void Start() { uimanager = GameObject.Find("UI").GetComponent <UIManager> (); if (uimanager.mapSelect == MapSelect.oneVSone) { player = Scence1v1_Intialize.Instance.role_Player.transform; player_RoleMain = Scence1v1_Intialize.Instance.role_Player.GetComponent <Role_Main> (); } if (uimanager.mapSelect == MapSelect.threeVSthree) { player = Scence3v3_Intialize.Instance.role_Players [0].transform; player_RoleMain = Scence3v3_Intialize.Instance.role_Players [0].GetComponent <Role_Main> (); } cam_pos = Camera.main.transform; Vector3 camTemp2 = player.position; camTemp2.y += 10f; camTemp2.z -= 10f; camTemp2.x -= 4f; cam_pos.position = camTemp2; layerScence = LayerMask.GetMask("Scence"); layerPlayer = player_RoleMain.EnemyLayer; }
void Start() { roleInfo = transform.GetComponent <RoleInfo> (); roleMain = transform.GetComponent <Role_Main> (); ani = transform.GetComponent <Animator> (); agent = GetComponent <NavMeshAgent> (); uimanager = GameObject.Find("UI").GetComponent <UIManager> (); skillmanager = transform.GetComponent <SkillManager> (); roadLine = roleMain.roadLine; aiOfHeroState = AIOfHeroState.patrol; isGet = false; if (uimanager.mapSelect == MapSelect.oneVSone) { if (roleInfo.roleCamp == Role_Camp.Blue) { targetOfAI.target01 = GameObject.Find("Tower_Red_01").transform; targetOfAI.target02 = GameObject.Find("RebirthPos_Blue").transform; targetOfAI.target03 = GameObject.Find("shuiJingRedRoot").transform; } else { targetOfAI.target01 = GameObject.Find("Tower_Blue_01").transform; targetOfAI.target02 = GameObject.Find("RebirthPos_Red").transform; targetOfAI.target03 = GameObject.Find("shuiJingBlueRoot").transform; } } else if (uimanager.mapSelect == MapSelect.threeVSthree) { if (roleInfo.roleCamp == Role_Camp.Blue) { if (roadLine == 1) { targetOfAI.target_Roadpoint = GameObject.Find("PathSolider/Path (3)").transform; targetOfAI.target01 = GameObject.Find("Environment/Building/A_Towers/A_Tower_X02").transform; } else if (roadLine == 2) { targetOfAI.target_Roadpoint = GameObject.Find("PathSolider_z/Path_z (2)").transform; targetOfAI.target01 = GameObject.Find("Environment/Building/A_Towers/A_Tower_Z02").transform; } else if (roadLine == 3) { targetOfAI.target_Roadpoint = GameObject.Find("PathSolider_s/Path_s (4)").transform; targetOfAI.target01 = GameObject.Find("Environment/Building/A_Towers/A_Tower_S02").transform; } targetOfAI.target02 = GameObject.Find("RebirthPos_Blue").transform; targetOfAI.target03 = GameObject.Find("shuiJingRedRoot").transform; } else { if (roadLine == 1) { targetOfAI.target_Roadpoint = GameObject.Find("PathSolider_s/Path_s (4)").transform; targetOfAI.target01 = GameObject.Find("Environment/Building/B_Towers/B_Tower_X02").transform; } else if (roadLine == 2) { targetOfAI.target_Roadpoint = GameObject.Find("PathSolider_z/Path_z (2)").transform; targetOfAI.target01 = GameObject.Find("Environment/Building/B_Towers/B_Tower_Z02").transform; } else if (roadLine == 3) { targetOfAI.target_Roadpoint = GameObject.Find("PathSolider/Path (3)").transform; targetOfAI.target01 = GameObject.Find("Environment/Building/B_Towers/B_Tower_S02").transform; } targetOfAI.target02 = GameObject.Find("RebirthPos_Red").transform; targetOfAI.target03 = GameObject.Find("shuiJingBlueRoot").transform; } } }
void Start() { roleInfo = transform.GetComponent <RoleInfo> (); roleMain = transform.GetComponent <Role_Main> (); ani = transform.GetComponent <Animator> (); agent = GetComponent <NavMeshAgent> (); uimanager = GameObject.Find("UI").GetComponent <UIManager> (); if (roleMain.aiOrPlayer == AiOrPlayerType.Player) { this.enabled = false; } roadLine = Random.Range(0, 3); aiOfHeroState = AIOfHeroState.patrol; if (uimanager.mapSelect == MapSelect.oneVSone) { if (roleInfo.roleCamp == Role_Camp.Blue) { targetOfAI.target01 = GameObject.Find("Tower_Red_01").transform; targetOfAI.target02 = GameObject.Find("shuiJingBlueRoot").transform; targetOfAI.target03 = GameObject.Find("shuiJingRedRoot").transform; } else { targetOfAI.target01 = GameObject.Find("Tower_Blue_01").transform; targetOfAI.target02 = GameObject.Find("shuiJingRedRoot").transform; targetOfAI.target03 = GameObject.Find("shuiJingBlueRoot").transform; } } else if (uimanager.mapSelect == MapSelect.threeVSthree) { if (roleInfo.roleCamp == Role_Camp.Blue) { if (roadLine == 0) { targetOfAI.target01 = GameObject.Find("Environment/Building/A_Towers/A_Tower_X02").transform; } else if (roadLine == 1) { targetOfAI.target01 = GameObject.Find("Environment/Building/A_Towers/A_Tower_Z02").transform; } else if (roadLine == 2) { targetOfAI.target01 = GameObject.Find("Environment/Building/A_Towers/A_Tower_S02").transform; } targetOfAI.target02 = GameObject.Find("shuiJingBlueRoot").transform; targetOfAI.target03 = GameObject.Find("shuiJingRedRoot").transform; } else { if (roadLine == 0) { targetOfAI.target01 = GameObject.Find("Environment/Building/B_Towers/B_Tower_X02").transform; } else if (roadLine == 1) { targetOfAI.target01 = GameObject.Find("Environment/Building/B_Towers/B_Tower_Z02").transform; } else if (roadLine == 2) { targetOfAI.target01 = GameObject.Find("Environment/Building/B_Towers/B_Tower_S02").transform; } targetOfAI.target02 = GameObject.Find("shuiJingRedRoot").transform; targetOfAI.target03 = GameObject.Find("shuiJingBlueRoot").transform; } } }
public abstract void GetHurt(int hurt_Physic, int hurt_Magic, Role_Main role);