bool IsFinishLap(VictoryCondition victor) { if(!playersLap && !playersLapB) { playersLap = victor.targets[0].GetComponent<DriftCar>(); playersLapB = victor.targets[0].GetComponent<CarB>(); } if(playersLap) return (playersLap.round == victor.times); else return (playersLapB.round == victor.times); }
void Start() { car = GetComponent<DriftCar>(); carB = GetComponent<CarB>(); carAI = GetComponent<CarAI>(); SMCamera = Camera.main.GetComponent<SmoothFollow>(); // if(networkView.enabled) // { // MatchArenaState mas = FindObjectOfType(typeof(MatchArenaState)) as MatchArenaState; // tvcMatchRoom = mas.GetTvCMatchRoom(); // } if(!rank) { rank = FindObjectOfType(typeof(RankManager)) as RankManager; } defaultScale = transform.localScale; if(car) oriGrip = car.handlingTendency; if(rearWheels.Length > 0) { stickWheels = new StickData[rearWheels.Length]; int i = 0; foreach(Transform wheel in rearWheels) { stickWheels[i] = new StickData(wheel); i++; } } /*SkillIcon[0] = levelTwo.GetIcon()[0]; SkillIcon = levelTwo.GetIcon()[1]; SkillIcon[2][0] = levelThree.GetIcon()[0]; SkillIcon[2][1] = levelThree.GetIcon()[1];*/ // while(true) // { // AddEnergy(energyRate); // yield return new WaitForSeconds(1); // } skillProbabilitys = new SkillProbability[4]; for(int i = 0; i < 4; i++) { skillProbabilitys[i] = new SkillProbability(); // skillProbabilitys[i].AddProbability(levelOne.Probability(i)); // skillProbabilitys[i].AddProbability(levelTwo.Probability(i)); // skillProbabilitys[i].AddProbability(levelThree.Probability(i)); foreach(Skill skill in skills) { skillProbabilitys[i].AddProbability(skill.Probability(i)); } } // skillRect = new Rect((Screen.width - (levelOne.SkillIcon.width * resolutionScale.x)) * 0.5f, levelOne.SkillIcon.height * resolutionScale.y, levelOne.SkillIcon.width * resolutionScale.x, levelOne.SkillIcon.height * resolutionScale.y); skillRect = new Rect((Screen.width - (skills[0].SkillIcon.width * resolutionScale.x)) * 0.5f, skills[0].SkillIcon.height * resolutionScale.y, skills[0].SkillIcon.width * resolutionScale.x, skills[0].SkillIcon.height * resolutionScale.y); }