void Start() { //Naomi 1.2.3 StudentInfo[] student = new StudentInfo[3]; student[0].name = "zz"; student[0].mathScore = 85; student[0].chineseScore = 95; student[0].englishScore = 80; student[0].friendConnection = 20; student[1].name = "wuwu"; student[1].mathScore = 88; student[1].chineseScore = 94; student[1].englishScore = 82; student[1].friendConnection = 13; student[2].name = "baibai"; student[2].mathScore = 98; student[2].chineseScore = 87; student[2].englishScore = 90; student[2].friendConnection = 5; ElectionCommissary(student); ElectionMonitor(student); //baibai 4.5.6 AltmanInfo Taro = new AltmanInfo(); Taro.name = "泰罗奥特曼"; Taro.height = 53; Taro.weight = 55000; Taro.speed = 20; Taro.mother = "奥特之母"; Taro.birthPlace = "M78星云"; Taro.currentPlace = "仙女座星云"; Taro.distanceToearth = 254f; AltmanInfo Severn = new AltmanInfo(); Severn.name = "塞文21奥特曼"; Severn.height = 56; Severn.weight = 57000; Severn.speed = 26; Severn.partner = "奈欧斯奥特曼"; Severn.birthPlace = "M78星云"; Severn.currentPlace = "M78星云"; Severn.distanceToearth = 300f; float tarospeed = ActualSpeed(ref Taro); Debug.Log("泰罗奥特曼速度" + tarospeed + "米/秒"); float severnspeed = ActualSpeed(ref Severn); Debug.Log("塞文21奥特曼速度" + severnspeed + "米/秒"); float tarotime = GoToEarth(ref Taro); float severntime = GoToEarth(ref Severn); if (tarotime - severntime > 0) { Debug.Log("首先抵达地球的是塞文21奥特曼"); } if (tarotime - severntime < 0) { Debug.Log("首先抵达地球的是泰罗奥特曼"); } //wupeng 7 Owner manL = new Owner(); manL.name = "林克"; manL.live = 100f; manL.attack = 60f; manL.defend = 40f; Skill christina = new Skill(); christina.heroattack = 30f; christina.speed = -10f; Skill carolanyork = new Skill(); carolanyork.heroattack = 50f; carolanyork.herodefend = manL.defend * 2f; Skill karlsruhe = new Skill(); karlsruhe.herolive = -60f; karlsruhe.heroattack = 100f; Skill goldsmith = new Skill(); goldsmith.herodefend = manL.defend * 3f; float currentlive = CurrentLive(ref manL, ref karlsruhe); Debug.Log("生命" + currentlive); float currentattack = CurrentAttack(ref manL, ref karlsruhe); Debug.Log("攻击" + currentattack); float currentdefend = CurrentDefend(ref manL, ref karlsruhe); Debug.Log("防御" + currentdefend); //wupeng 8 Hero[] heroes = new Hero[5]; heroes[0].live = 100f; heroes[0].attack = 60f; heroes[0].defend = 40f; heroes[1].live = 60f; heroes[1].attack = 100f; heroes[1].defend = 70f; heroes[2].live = 150f; heroes[2].attack = 60f; heroes[2].defend = 120f; heroes[3].live = 150f; heroes[3].attack = 90f; heroes[3].defend = 40f; heroes[4].live = 70f; heroes[4].attack = 70f; heroes[4].defend = 150f; CurrentEnergy(heroes); //wupeng 9 Lastman yhh = new Lastman(); yhh.name = "呀哈哈"; yhh.live = 30f; yhh.attack = 1f; yhh.defend = 5f; //LastManCurrent(yhh); //mengmeng 10 Card[] cards = new Card[5]; cards[0].pattern = "红桃"; cards[0].number = 13; cards[1].pattern = "黑桃"; cards[1].number = 13; cards[2].pattern = "方块"; cards[2].number = 13; cards[3].pattern = "草花"; cards[3].number = 13; cards[4].pattern = "怪"; cards[4].number = 2; }
float ActualSpeed(ref AltmanInfo altman) { return(altman.speed * 340.3f); }
float GoToEarth(ref AltmanInfo timetogo) { return(timetogo.distanceToearth / timetogo.speed); }