// Start is called before the first frame update void Start() { if (badGuy != null) { BadGuys.Add(badGuy); } GenerateObjects(stone1Prefab); GenerateObjects(stone2Prefab); GenerateObjects(grassPrefab); GenerateObjects(bushPrefab); GenerateWear(hat); GenerateWear(coat); GenerateWear(scarf); GenerateWear(pants); GenerateWear(blouse); GenerateBadGuys(); if (!BeginingGame) { _texts[0].text = "Уровень " + level; _texts[1].text = "Найдено " + WearCount + "/" + AllWear.Count; _texts[2].text = "Уровень " + level; _texts[3].text = "Нажмите любую клавишу для старта"; } }
void GenerateBadGuys() { for (var i = 0; i < 10 * level; ++i) { float x = RandX(), y = RandY(); while (!CheckGoodGuyDistance(x, y, 10)) { x = RandX(); y = RandY(); } BadGuys.Add(Instantiate(badGuy, new Vector2(x, y), Quaternion.identity)); } }
public void OnStartMission() { if (Function.Call <bool>(Hash.IS_IPL_ACTIVE, "sunkcargoship")) { Function.Call(Hash.REMOVE_IPL, "sunkcargoship"); } Function.Call(Hash.REQUEST_IPL, "cargoship"); for (int i = 0; i < _positions.Length; i++) { var tmp = new Enemy(_positions[i].Item1, _positions[i].Item2); tmp.Character.Task.GuardCurrentPosition(); BadGuys.Add(tmp); CleanupBag.Add(tmp.Character); } }
public void OnStartMission() { Function.Call(Hash.REMOVE_IPL, "CS1_02_cf_offmission"); Function.Call(Hash.REQUEST_IPL, "CS1_02_cf_onmission1"); Function.Call(Hash.REQUEST_IPL, "CS1_02_cf_onmission2"); Function.Call(Hash.REQUEST_IPL, "CS1_02_cf_onmission3"); Function.Call(Hash.REQUEST_IPL, "CS1_02_cf_onmission4"); for (int i = 0; i < _positions.Length; i++) { var tmp = new Enemy(_positions[i].Item1, _positions[i].Item2); tmp.Character.Task.GuardCurrentPosition(); BadGuys.Add(tmp); CleanupBag.Add(tmp.Character); } }
public void OnStartMission() { Function.Call(Hash.REQUEST_IPL, "hei_yacht_heist"); Function.Call(Hash.REQUEST_IPL, "hei_yacht_heist_Bar"); Function.Call(Hash.REQUEST_IPL, "hei_yacht_heist_Bedrm"); Function.Call(Hash.REQUEST_IPL, "hei_yacht_heist_Bridge"); Function.Call(Hash.REQUEST_IPL, "hei_yacht_heist_DistantLights"); Function.Call(Hash.REQUEST_IPL, "hei_yacht_heist_enginrm"); Function.Call(Hash.REQUEST_IPL, "hei_yacht_heist_LODLights"); Function.Call(Hash.REQUEST_IPL, "hei_yacht_heist_Lounge"); for (int i = 0; i < _positions.Length; i++) { var tmp = new Enemy(_positions[i].Item1, _positions[i].Item2); tmp.Character.Task.GuardCurrentPosition(); BadGuys.Add(tmp); CleanupBag.Add(tmp.Character); } }
public void OnStartMission() { Function.Call(Hash.REQUEST_IPL, "hei_carrier"); Function.Call(Hash.REQUEST_IPL, "hei_carrier_DistantLights"); Function.Call(Hash.REQUEST_IPL, "hei_Carrier_int1"); Function.Call(Hash.REQUEST_IPL, "hei_Carrier_int2"); Function.Call(Hash.REQUEST_IPL, "hei_Carrier_int3"); Function.Call(Hash.REQUEST_IPL, "hei_Carrier_int4"); Function.Call(Hash.REQUEST_IPL, "hei_Carrier_int5"); Function.Call(Hash.REQUEST_IPL, "hei_Carrier_int6"); Function.Call(Hash.REQUEST_IPL, "hei_carrier_LODLights"); for (int i = 0; i < _positions.Length; i++) { var tmp = new Enemy(_positions[i].Item1, _positions[i].Item2); tmp.Character.Task.GuardCurrentPosition(); BadGuys.Add(tmp); CleanupBag.Add(tmp.Character); } }
public void OnStartMission() { for (int i = 0; i < _positions.Length; i++) { var tmp = new Enemy(_positions[i].Item1, _positions[i].Item2); tmp.Character.Task.GuardCurrentPosition(); BadGuys.Add(tmp); CleanupBag.Add(tmp.Character); } var polmodel = new Model(VehicleHash.Police2); polmodel.Request(10); var polcar1 = World.CreateVehicle(polmodel, new Vector3(-1769f, -1157.036f, 12.633f), 68.7f); polcar1.SirenActive = true; var polcar2 = World.CreateVehicle(polmodel, new Vector3(-1774.87f, -1153.445f, 12.633f), 202.47f); polcar2.SirenActive = true; CleanupBag.Add(polcar1); CleanupBag.Add(polcar2); }
public void OnStartMission(Gamemodes gamemode) { Gamemode = gamemode; LoadIPL(); foreach (var veh in _decorativeVehicles.Where(x => x.EntryPoint == -1)) { var tmpMod = new Model(veh.Model); int counter = 0; do { tmpMod.Request(); counter++; Script.Yield(); } while (!tmpMod.IsLoaded && counter < 10000); if (counter >= 10000) { continue; } Vehicle tmpVeh = new Vehicle(Function.Call <int>(Hash.CREATE_VEHICLE, tmpMod.Hash, veh.Position.X, veh.Position.Y, veh.Position.Z, veh.Heading, false, false)); tmpVeh.SirenActive = veh.SirenActive; foreach (VehicleDoor door in veh.OpenDoors) { tmpVeh.OpenDoor(door, false, false); } CleanupBag.Add(tmpVeh); } var tmpposs = new List <Tuple <Vector3, float> >(_positions); var tmpMax = _maxEnemies; if (_maxEnemies == -1) { tmpMax = Enemy.Dice.Next(_positions.Count / 2, _positions.Count); } MaxEnemies = tmpMax; for (int i = 0; i < tmpMax; i++) { Enemy tmp; int ourPick = Enemy.Dice.Next(tmpposs.Count); Tuple <Vector3, float> ourTuple = tmpposs[ourPick]; tmp = new Enemy(ourTuple.Item1, ourTuple.Item2); tmpposs.RemoveAt(ourPick); tmp.Character.Task.GuardCurrentPosition(); BadGuys.Add(tmp); CleanupBag.Add(tmp.Character); } if (Gamemode == Gamemodes.BombDefusal) { BombDefused = false; _defusePercentage = 0; _defuseStart = null; IsDefusingBomb = false; var ourPick = _bombLocations[Enemy.Dice.Next(_bombLocations.Count)]; CurrentBomb = new Tuple <Vector3, float>(ourPick.Item1, ourPick.Item2); int counter = 0; var barrelM = new Model(1298403575); do { barrelM.Request(); counter++; Script.Yield(); } while (!barrelM.IsLoaded && counter < 2000); var barrel = World.CreateProp(barrelM, CurrentBomb.Item1 - new Vector3(0f, 0f, 1f), new Vector3(0f, 0f, CurrentBomb.Item2), false, false); barrel.FreezePosition = true; counter = 0; var bombM = new Model(929047740); do { bombM.Request(); counter++; Script.Yield(); } while (!bombM.IsLoaded && counter < 2000); var bomb = World.CreateProp(bombM, CurrentBomb.Item1 - new Vector3(0f, 0f, 0.2f), new Vector3(-90f, 0f, CurrentBomb.Item2), false, false); bomb.FreezePosition = true; CleanupBag.Add(barrel); CleanupBag.Add(bomb); } }