/// <summary> /// Creates a BasicBullet object at the given location facing the given rotation. /// Bullet will travel forward and use standard collisions. /// </summary> /// <param name="owner">The Prefab that spawned the bullet</param> public BasicBullet(Prefab owner, Vector3 location, Vector3 rotation, Vector3 scale) : base(owner, ContentLoader.BasicBulletModel, location, rotation, scale, Settings.BASIC_BULLET_DAMAGE, Settings.BASIC_BULLET_LIFESPAN, Settings.BASIC_BULLET_SPEED) { this.scripts.Add(new BulletStraightMovementScript(this)); this.scripts.Add(new BulletCollisionScript(this)); }
public DropBombScript(Prefab bomber, Vector3 target, float reloadTime) { this.bomber = bomber; this.target = target; this.reloadTime = reloadTime; this.timeSinceLastBomb = reloadTime; }
/// <summary> /// Detects collisions from incoming Bullets. /// </summary> /// <param name="collider"></param> public override void detectCollision(Prefab collider) { base.detectCollision(collider); float damage = 0f; if (collider is Bullet) { Bullet collidingBullet = (Bullet)collider; if (collidingBullet.Owner != this) { damage = collidingBullet.Damage; } } else if (collider is Tank) { damage = Settings.TANK_COLLIDE_DAMAGE; } health -= damage; if (health <= 0) { this.health = 0; this.alive = false; // TODO: Add death animation script } }
public Entity ReplaceResource(Prefab newPrefab) { var component = CreateComponent<ResourceComponent>(ComponentIds.Resource); component.prefab = newPrefab; ReplaceComponent(ComponentIds.Resource, component); return this; }
public static void SpawnPrefabModel(this ScriptComponent script, Prefab source, Entity attachEntity, Matrix localMatrix, Vector3 forceImpulse) { if (source == null) return; // Clone var spawnedEntities = source.Instantiate(); // Add foreach (var prefabEntity in spawnedEntities) { prefabEntity.Transform.UpdateLocalMatrix(); var entityMatrix = prefabEntity.Transform.LocalMatrix * localMatrix; entityMatrix.Decompose(out prefabEntity.Transform.Scale, out prefabEntity.Transform.Rotation, out prefabEntity.Transform.Position); if (attachEntity != null) { attachEntity.AddChild(prefabEntity); } else { script.SceneSystem.SceneInstance.Scene.Entities.Add(prefabEntity); } var physComp = prefabEntity.Get<RigidbodyComponent>(); if (physComp != null) { physComp.ApplyImpulse(forceImpulse); } } }
/// <summary> /// Creates a BombBullet at the given location facing the given /// rotation. /// </summary> /// <param name="owner">The Prefab that owns this Bomb</param> public BombBullet(Prefab owner, Vector3 location, Vector3 rotation, Vector3 scale) : base(owner, ContentLoader.BombBulletModel, location, rotation, scale, Settings.BOMB_BULLET_DAMAGE, Settings.BOMB_BULLET_LIFESPAN, Settings.BOMB_BULLET_SPEED) { this.scripts.Add(new BombMovementScript(this, this.speed)); this.scripts.Add(new BombCollisionScript(this)); }
/// <summary> /// If collider is not the Bombs owner it will explode. /// </summary> /// <param name="collider">Prefab that has collided witht the Bomb</param> public override void detectCollision(Prefab collider) { base.detectCollision(collider); if (owner != collider) { ParticleEmitterManager.spawnParticleEmitter(ParticleEmitterType.explosion, this.location); this.alive = false; } }
/// <summary> /// Returns all of the features found within a bitmap. /// </summary> /// <param name="bitmap">The bitmap to search through.</param> /// <returns>All of the features found within the bitmap.</returns> public void Match(Prefab.Bitmap bitmap, ICollection<Tree> found) { for (int row = 0; row < bitmap.Height; row++) { for (int col = 0; col < bitmap.Width; col++) { root.GetMatches(bitmap, col, row, found); } } }
/// <summary> /// Creates a single vanilla Bullet at the given location facing the /// given rotation. The Bullet is visually represented by the given /// Model, will travel that the given speed, inflict the given damage /// to Enemies it collides with, and will remain alive for the given /// lifespan unless a collision occures. /// </summary> /// <param name="owner">The Prefab that owns the Bullet</param> /// <param name="bulletModel">Model to represent Bullet</param> /// <param name="damage">Damage Bullet will inflict</param> /// <param name="lifespan">Time in seconds the bullet will remain in scene</param> /// <param name="speed">Speed bullet will travel at</param> public Bullet(Prefab owner, Model bulletModel, Vector3 location, Vector3 rotation, Vector3 scale, float damage, float lifespan, float speed) : base(location, rotation, scale) { this.owner = owner; this.damage = damage; this.lifespan = lifespan; this.timeAlive = 0.0f; this.speed = speed; this.models.Add(bulletModel); }
protected void SpawnInstance(Prefab source, Entity attachEntity, float timeout, Matrix localMatrix) { if (source == null) return; Func<Task> spawnTask = async () => { // Clone var spawnedEntities = source.Instantiate(); // Add foreach (var prefabEntity in spawnedEntities) { prefabEntity.Transform.UpdateLocalMatrix(); var entityMatrix = prefabEntity.Transform.LocalMatrix * localMatrix; entityMatrix.Decompose(out prefabEntity.Transform.Scale, out prefabEntity.Transform.Rotation, out prefabEntity.Transform.Position); if (attachEntity != null) { attachEntity.AddChild(prefabEntity); } else { SceneSystem.SceneInstance.Scene.Entities.Add(prefabEntity); } } // Countdown var secondsCountdown = timeout; while (secondsCountdown > 0f) { await Script.NextFrame(); secondsCountdown -= (float)Game.UpdateTime.Elapsed.TotalSeconds; } // Remove foreach (var clonedEntity in spawnedEntities) { if (attachEntity != null) { attachEntity.RemoveChild(clonedEntity); } else { SceneSystem.SceneInstance.Scene.Entities.Remove(clonedEntity); } } // Cleanup spawnedEntities.Clear(); }; Script.AddTask(spawnTask); }
public Entity ReplaceResource(Prefab newPrefab) { var previousComponent = hasResource ? resource : null; var component = _resourceComponentPool.Count > 0 ? _resourceComponentPool.Pop() : new ResourceComponent(); component.prefab = newPrefab; ReplaceComponent(ComponentIds.Resource, component); if (previousComponent != null) { _resourceComponentPool.Push(previousComponent); } return this; }
public static Item Generate(Prefab prefab, Point position) { Item item = new Item(); switch (prefab) { case Prefab.Corpse: break; } item.Area = Area.Current; item.Position = position; return item; }
private ICollection<Tree> Match(Prefab.Bitmap bitmap, int top, int left, int bottomExclusive, int rightExclusive){ List<Tree> found = new List<Tree>(); for (int row = top; row < bottomExclusive; row++) { for (int col = left; col < rightExclusive; col++) { root.GetMatches(bitmap, col, row, found); } } return found; }
/// <summary> /// Destorys the Tank if the collider Prefab is a Bullet not owned by /// this Tank. /// </summary> /// <param name="collider">Prefab that collided with the Tank</param> public override void detectCollision(Prefab collider) { base.detectCollision(collider); bool die = true; if (collider is Bullet) { Bullet collidingBullet = (Bullet)collider; die = collidingBullet.Owner != this; } if (die) { this.scripts.Clear(); this.alive = false; ParticleEmitterManager.spawnParticleEmitter(ParticleEmitterType.explosion, location); } }
/// <summary> /// Creates an explosion if the collider is a Bullet object. /// </summary> /// <param name="collider">The Prefab that was collided with</param> public override void detectCollision(Prefab collider) { base.detectCollision(collider); if (collider is Bullet) { Bullet collidingBullet = (Bullet)collider; if (collidingBullet.Owner != this) { this.scripts.Clear(); this.alive = false; ParticleEmitterManager.spawnParticleEmitter(ParticleEmitterType.explosion, location); foreach (Prefab child in children) { if (child is PlaneSmokeTrail) { PlaneSmokeTrail smokeTrail = (PlaneSmokeTrail)child; smokeTrail.stop(); } } } } }
private void GetTownships(Prefab prefab) => Bin.Add("Townships", Townships = prefab.GetAllowedTownships());
private bool BitmapContainsOffset(Bitmap bmp, Prefab.Point location) { return location.Y < bmp.Height && location.X < bmp.Width && location.X >= 0 && location.Y >= 0; }
private void GetBiomes(Prefab prefab) => Bin.Add("Biomes", Biomes = prefab.GetAllowedBiomes());
public BombMovementScript(Prefab bomb, float speed) { this.bomb = bomb; this.speed = speed; }
private void GetDistYOffset(Prefab prefab) => Bin.Add("DistYOffset", DistYOffset = Math.Round(prefab.distantPOIYOffset, 3));
// Token: 0x06000244 RID: 580 RVA: 0x000165C0 File Offset: 0x000147C0 public static void Tab() { Prefab.MenuArea(new Rect(0f, 0f, 466f, 436f), "АИМ", delegate { GUILayout.BeginHorizontal(Array.Empty <GUILayoutOption>()); GUILayout.BeginVertical(new GUILayoutOption[] { GUILayout.Width(230f) }); GUILayout.Space(2f); Prefab.Toggle("Тихий АИМ", ref RaycastOptions.Enabled, 17); GUILayout.Space(10f); bool enabled = RaycastOptions.Enabled; bool flag = enabled; if (flag) { Prefab.Toggle("Авто радиус сферы", ref SphereOptions.SpherePrediction, 17); GUILayout.Space(5f); bool flag2 = !SphereOptions.SpherePrediction; bool flag3 = flag2; if (flag3) { GUILayout.Label("Радиус сферы: " + System.Math.Round((double)SphereOptions.SphereRadius, 2) + "m", Prefab._TextStyle, Array.Empty <GUILayoutOption>()); Prefab.Slider(0f, 16f, ref SphereOptions.SphereRadius, 200); } GUILayout.Space(5f); GUIContent[] array = new GUIContent[] { new GUIContent("Игроки"), new GUIContent("Зомби"), new GUIContent("Турели"), new GUIContent("Кровати"), new GUIContent("Клейм флаг"), new GUIContent("Ящики"), new GUIContent("Транспорт") }; Prefab.Toggle("Не стрелять через стены", ref RaycastOptions.NoShootthroughthewalls, 17); GUILayout.Space(2f); Prefab.Toggle("Использовать FOV", ref RaycastOptions.SilentAimUseFOV, 17); bool silentAimUseFOV = RaycastOptions.SilentAimUseFOV; bool flag4 = silentAimUseFOV; if (flag4) { Prefab.Toggle("Отображать FOV", ref RaycastOptions.ShowSilentAimUseFOV, 17); GUILayout.Space(2f); GUILayout.Label("FOV: " + RaycastOptions.SilentAimFOV, Prefab._TextStyle, Array.Empty <GUILayoutOption>()); RaycastOptions.SilentAimFOV = Prefab.Slider(1f, 180f, RaycastOptions.SilentAimFOV, 200); bool flag5 = RaycastOptions.SilentAimFOV == 1f; if (flag5) { RaycastOptions.SilentAimFOV = 2f; } } else { RaycastOptions.ShowSilentAimUseFOV = false; } bool flag6 = Prefab.List(200f, "_TargetPriority", new GUIContent("Приоритет: " + array[(int)RaycastOptions.Target].text), array, Array.Empty <GUILayoutOption>()); if (flag6) { RaycastOptions.Target = (TargetPriority)DropDown.Get("_TargetPriority").ListIndex; } GUILayout.Space(5f); } GUILayout.EndVertical(); GUILayout.BeginVertical(Array.Empty <GUILayoutOption>()); Prefab.Toggle("АИМ", ref AimbotOptions.Enabled, 17); Prefab.Toggle("Нет падения пули", ref AimbotOptions.NoAimbotDrop, 17); Prefab.Toggle("Дистанция по оружию", ref AimbotOptions.UseGunDistance, 17); Prefab.Toggle("Плавность", ref AimbotOptions.Smooth, 17); Prefab.Toggle("По кнопке(F)", ref AimbotOptions.OnKey, 17); GUILayout.Space(3f); bool smooth = AimbotOptions.Smooth; bool flag7 = smooth; if (flag7) { GUILayout.Label("Скорость аима: " + AimbotOptions.AimSpeed, Prefab._TextStyle, Array.Empty <GUILayoutOption>()); AimbotOptions.AimSpeed = (float)((int)Prefab.Slider(1f, AimbotOptions.MaxSpeed, AimbotOptions.AimSpeed, 200)); } Prefab.Toggle("Использовать FOV", ref AimbotOptions.UseFovAim, 17); bool useFovAim = AimbotOptions.UseFovAim; if (useFovAim) { Prefab.Toggle("Отображать FOV", ref RaycastOptions.ShowAimUseFOV, 17); AimbotOptions.TargetMode = TargetMode.FOV; GUILayout.Label("FOV: " + AimbotOptions.FOV, Prefab._TextStyle, Array.Empty <GUILayoutOption>()); AimbotOptions.FOV = (float)((int)Prefab.Slider(1f, 180f, AimbotOptions.FOV, 200)); bool flag8 = AimbotOptions.FOV == 1f; if (flag8) { AimbotOptions.FOV = 3f; } } else { RaycastOptions.ShowAimUseFOV = false; } GUILayout.Label("Дистанция: " + AimbotOptions.Distance, Prefab._TextStyle, Array.Empty <GUILayoutOption>()); AimbotOptions.Distance = (float)((int)Prefab.Slider(50f, 1000f, AimbotOptions.Distance, 200)); GUIContent[] array2 = new GUIContent[] { new GUIContent("Дистанция"), new GUIContent("FOV") }; bool flag9 = Prefab.List(200f, "_TargetMode", new GUIContent("Наводится: " + array2[(int)AimbotOptions.TargetMode].text), array2, Array.Empty <GUILayoutOption>()); bool flag10 = flag9; if (flag10) { AimbotOptions.TargetMode = (TargetMode)DropDown.Get("_TargetMode").ListIndex; } GUILayout.EndVertical(); GUILayout.EndHorizontal(); }); }
private void GetYOffset(Prefab prefab) => Bin.Add("YOffset", YOffset = prefab.yOffset);
private Prefab.Point Sibling(Prefab.Point currNode, Mode currMode) { switch (currMode) { case Mode.Up: return new Prefab.Point(currNode.X, currNode.Y - 1); case Mode.Right: return new Prefab.Point(currNode.X + 1, currNode.Y); case Mode.Down: return new Prefab.Point(currNode.X, currNode.Y + 1); case Mode.Left: return new Prefab.Point(currNode.X - 1, currNode.Y); } return currNode; throw new Exception("Invalid mode"); }
private void GetAirBlocks(Prefab prefab) => Bin.Add("AirBlocks", AirBlocks = prefab.bCopyAirBlocks);
private void GetRotation(Prefab prefab) => Bin.Add("Rotation", Rotation = prefab.rotationToFaceNorth);
private void GetTopSoil(Prefab prefab) => Bin.Add("AllowTopSoil", AllowTopSoil = prefab.bAllowTopSoilDecorations);
private void GetHasMeshFile(Prefab prefab) => Bin.Add("HasMeshFile", HasMeshFile = File.Exists(Utils.GetGameDir("Data/Prefabs") + "/" + prefab.filename + ".mesh"));
private void GetExcludePoiMesh(Prefab prefab) => Bin.Add("ExcludePoiMesh", ExcludePoiMesh = prefab.bExcludeDistantPOIMesh);
private bool AroundPoints(Prefab.Point currNode, Mode mode) { switch (mode) { case Mode.Up: return currNode.X <= Start.X; case Mode.Right: return currNode.Y < FarthestUpClick; case Mode.Down: return currNode.X > FarthestRightClick; case Mode.Left: return currNode.Y > FarthestDownClick; } return false; }
private void GetSize(Prefab prefab) => Bin.Add("Size", Size = new BCMVector3(prefab.size));
private int Bitmap(Prefab.Point currNode, Mode mode) { return Bitmap(currNode.Y, currNode.X, mode); }
private void GetName(Prefab prefab) => Bin.Add("Name", Name = prefab.filename);
private void SetVisited(Prefab.Point offset, int value) { SetVisited(offset.Y, offset.X, value); }
protected override void GetData(object obj) { if (!(obj is string prefabname)) { return; } if (!Options.ContainsKey("filter") && !Options.ContainsKey("info") && !Options.ContainsKey("blocks") && !Options.ContainsKey("full")) { Bin.Add("Name", Name = prefabname); return; } if (Options.ContainsKey("full") && cache.ContainsKey(prefabname)) { Bin = cache[prefabname].Bin; return; } if (Options.ContainsKey("filter") && cache.ContainsKey(prefabname)) { foreach (var f in StrFilter) { switch (f) { case StrFilters.Name: Bin.Add("Name", cache[prefabname].Name); break; case StrFilters.Size: Bin.Add("Size", cache[prefabname].Size); break; case StrFilters.YOffset: Bin.Add("YOffset", cache[prefabname].YOffset); break; case StrFilters.Rotation: Bin.Add("Rotation", cache[prefabname].Rotation); break; case StrFilters.AirBlocks: Bin.Add("AirBlocks", cache[prefabname].AirBlocks); break; case StrFilters.AllowTopSoil: Bin.Add("AllowTopSoil", cache[prefabname].AllowTopSoil); break; case StrFilters.HasMeshFile: Bin.Add("HasMeshFile", cache[prefabname].HasMeshFile); break; case StrFilters.ExcludePoiMesh: Bin.Add("ExcludePoiMesh", cache[prefabname].ExcludePoiMesh); break; case StrFilters.DistYOffset: Bin.Add("DistYOffset", cache[prefabname].DistYOffset); break; case StrFilters.DistOverride: Bin.Add("DistOverride", cache[prefabname].DistOverride); break; case StrFilters.IsTrader: Bin.Add("IsTrader", cache[prefabname].IsTrader); break; case StrFilters.TraderProtect: Bin.Add("TraderProtect", cache[prefabname].TraderProtect); break; case StrFilters.TraderTpSize: Bin.Add("TraderTpSize", cache[prefabname].TraderTpSize); break; case StrFilters.TraderTpCenter: Bin.Add("TraderTpCenter", cache[prefabname].TraderTpCenter); break; case StrFilters.Biomes: Bin.Add("Biomes", cache[prefabname].Biomes); break; case StrFilters.Townships: Bin.Add("Townships", cache[prefabname].Townships); break; case StrFilters.Zoning: Bin.Add("Zoning", cache[prefabname].Zoning); break; case StrFilters.HasVolumes: Bin.Add("HasVolumes", cache[prefabname].HasVolumes); break; case StrFilters.SleeperVolumes: Bin.Add("SleeperVolumes", cache[prefabname].SleeperVolumes); break; case StrFilters.Blocks: // Bin.Add("Blocks", cache[prefabname].Blocks); break; default: Log.Out($"{Config.ModPrefix} Unknown filter {f}"); break; } } return; } var prefab = new Prefab(); if (!prefab.Load(prefabname)) { return; } if (IsOption("filter")) { foreach (var f in StrFilter) { switch (f) { case StrFilters.Name: GetName(prefab); break; case StrFilters.Size: GetSize(prefab); break; case StrFilters.YOffset: GetYOffset(prefab); break; case StrFilters.Rotation: GetRotation(prefab); break; case StrFilters.AirBlocks: GetAirBlocks(prefab); break; case StrFilters.AllowTopSoil: GetTopSoil(prefab); break; case StrFilters.HasMeshFile: GetHasMeshFile(prefab); break; case StrFilters.ExcludePoiMesh: GetExcludePoiMesh(prefab); break; case StrFilters.DistYOffset: GetDistYOffset(prefab); break; case StrFilters.DistOverride: GetDistOverride(prefab); break; case StrFilters.IsTrader: GetIsTrader(prefab); break; case StrFilters.TraderProtect: GetTraderProtect(prefab); break; case StrFilters.TraderTpSize: GetTraderTpSize(prefab); break; case StrFilters.TraderTpCenter: GetTraderTpCenter(prefab); break; case StrFilters.Biomes: GetBiomes(prefab); break; case StrFilters.Townships: GetTownships(prefab); break; case StrFilters.Zoning: GetZoning(prefab); break; case StrFilters.HasVolumes: GetHasVolumes(prefab); break; case StrFilters.SleeperVolumes: GetSleeperVolumes(prefab); break; case StrFilters.Blocks: //GetBlocks(prefab); break; //case StrFilters.Stats: // GetStats(prefab); // break; default: Log.Out($"{Config.ModPrefix} Unknown filter {f}"); break; } } } else { GetName(prefab); if (!Options.ContainsKey("info") && !Options.ContainsKey("blocks") && !Options.ContainsKey("full")) { return; } if (Options.ContainsKey("info") || Options.ContainsKey("full")) { GetSize(prefab); GetYOffset(prefab); GetRotation(prefab); } if (Options.ContainsKey("full")) { GetAirBlocks(prefab); GetTopSoil(prefab); GetHasMeshFile(prefab); GetExcludePoiMesh(prefab); GetDistYOffset(prefab); GetDistOverride(prefab); GetIsTrader(prefab); GetTraderProtect(prefab); GetTraderTpSize(prefab); GetTraderTpCenter(prefab); GetBiomes(prefab); GetTownships(prefab); GetZoning(prefab); GetHasVolumes(prefab); GetSleeperVolumes(prefab); } if (Options.ContainsKey("blocks")) { //GetBlocks(prefab); } //GetStats(prefab); } if (Options.ContainsKey("full")) { cache.Add(prefabname, this); } }
private void GetTraderTpSize(Prefab prefab) => Bin.Add("TraderTpSize", TraderTpSize = new BCMVector3(prefab.TraderAreaTeleportSize));
// Token: 0x0600028E RID: 654 RVA: 0x0001A360 File Offset: 0x00018560 public static void Tab() { Prefab.ScrollView(new Rect(0f, 0f, 225f, 436f), "ВХ", ref StatsTab.ScrollPos, delegate() { Prefab.SectionTabButton("Игроки", delegate { GUILayout.BeginHorizontal(Array.Empty <GUILayoutOption>()); GUILayout.BeginVertical(new GUILayoutOption[] { GUILayout.Width(240f) }); VisualsTab.BasicControls(ESPTarget.Игроки); bool flag = !ESPOptions.VisualOptions[0].Enabled; bool flag2 = !flag; if (flag2) { GUILayout.EndVertical(); GUILayout.BeginVertical(Array.Empty <GUILayoutOption>()); Prefab.Toggle("Показывать оружие", ref ESPOptions.ShowPlayerWeapon, 17); Prefab.Toggle("Показывать транспорт", ref ESPOptions.ShowPlayerVehicle, 17); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } }, 0f, 20); Prefab.SectionTabButton("Зомби", delegate { VisualsTab.BasicControls(ESPTarget.Зомби); }, 0f, 20); Prefab.SectionTabButton("Транспорт", delegate { GUILayout.BeginHorizontal(Array.Empty <GUILayoutOption>()); GUILayout.BeginVertical(new GUILayoutOption[] { GUILayout.Width(240f) }); VisualsTab.BasicControls(ESPTarget.Транспорт); bool flag = !ESPOptions.VisualOptions[6].Enabled; bool flag2 = !flag; if (flag2) { GUILayout.EndVertical(); GUILayout.BeginVertical(Array.Empty <GUILayoutOption>()); Prefab.Toggle("Кол-во топлива", ref ESPOptions.ShowVehicleFuel, 17); Prefab.Toggle("Кол-во прочности", ref ESPOptions.ShowVehicleHealth, 17); Prefab.Toggle("Показывать закрытые", ref ESPOptions.ShowVehicleLocked, 17); Prefab.Toggle("Фильтровать закрытые", ref ESPOptions.FilterVehicleLocked, 17); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } }, 0f, 20); Prefab.SectionTabButton("Предметы", delegate { GUILayout.BeginHorizontal(Array.Empty <GUILayoutOption>()); GUILayout.BeginVertical(new GUILayoutOption[] { GUILayout.Width(240f) }); VisualsTab.BasicControls(ESPTarget.Предметы); bool flag = !ESPOptions.VisualOptions[2].Enabled; bool flag2 = !flag; if (flag2) { GUILayout.EndVertical(); GUILayout.BeginVertical(Array.Empty <GUILayoutOption>()); Prefab.Toggle("Фильтр предметов", ref ESPOptions.FilterItems, 17); bool filterItems = ESPOptions.FilterItems; bool flag3 = filterItems; if (flag3) { GUILayout.Space(5f); ItemUtilities.DrawFilterTab(ItemOptions.ItemESPOptions); } GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } }, 0f, 20); Prefab.SectionTabButton("Ящики", delegate { VisualsTab.BasicControls(ESPTarget.Ящики); }, 0f, 20); Prefab.SectionTabButton("Кровати", delegate { GUILayout.BeginHorizontal(Array.Empty <GUILayoutOption>()); GUILayout.BeginVertical(new GUILayoutOption[] { GUILayout.Width(240f) }); VisualsTab.BasicControls(ESPTarget.Кровати); bool flag = !ESPOptions.VisualOptions[4].Enabled; bool flag2 = !flag; if (flag2) { GUILayout.EndVertical(); GUILayout.BeginVertical(Array.Empty <GUILayoutOption>()); Prefab.Toggle("Показать занятые", ref ESPOptions.ShowClaimed, 17); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } }, 0f, 20); Prefab.SectionTabButton("Генераторы", delegate { GUILayout.BeginHorizontal(Array.Empty <GUILayoutOption>()); GUILayout.BeginVertical(new GUILayoutOption[] { GUILayout.Width(240f) }); VisualsTab.BasicControls(ESPTarget.Генераторы); bool flag = !ESPOptions.VisualOptions[8].Enabled; bool flag2 = !flag; if (flag2) { GUILayout.EndVertical(); GUILayout.BeginVertical(Array.Empty <GUILayoutOption>()); Prefab.Toggle("Кол-во топлива", ref ESPOptions.ShowGeneratorFuel, 17); Prefab.Toggle("Статус работы", ref ESPOptions.ShowGeneratorPowered, 17); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } }, 0f, 20); Prefab.SectionTabButton("Турели", delegate { GUILayout.BeginHorizontal(Array.Empty <GUILayoutOption>()); GUILayout.BeginVertical(new GUILayoutOption[] { GUILayout.Width(240f) }); VisualsTab.BasicControls(ESPTarget.Турели); bool flag = !ESPOptions.VisualOptions[3].Enabled; bool flag2 = !flag; if (flag2) { GUILayout.EndVertical(); GUILayout.BeginVertical(Array.Empty <GUILayoutOption>()); Prefab.Toggle("Показывать оружие", ref ESPOptions.ShowSentryItem, 17); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } }, 0f, 20); Prefab.SectionTabButton("Клейм флаги", delegate { VisualsTab.BasicControls(ESPTarget.КлеймФлаги); }, 0f, 20); Prefab.SectionTabButton("Животные", delegate { GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.BeginVertical(new GUILayoutOption[] { GUILayout.Width(240f) }); VisualsTab.BasicControls(ESPTarget.Животные); bool flag = !ESPOptions.VisualOptions[3].Enabled; if (!flag) { GUILayout.EndVertical(); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } }, 0f, 20); Prefab.SectionTabButton("Ловушки", delegate { GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.BeginVertical(new GUILayoutOption[] { GUILayout.Width(240f) }); VisualsTab.BasicControls(ESPTarget.Ловшуки); bool flag = !ESPOptions.VisualOptions[3].Enabled; if (!flag) { GUILayout.EndVertical(); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } }, 0f, 20); Prefab.SectionTabButton("Двери", delegate { GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.BeginVertical(new GUILayoutOption[] { GUILayout.Width(240f) }); VisualsTab.BasicControls(ESPTarget.Двери); bool flag = !ESPOptions.VisualOptions[3].Enabled; if (!flag) { GUILayout.EndVertical(); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } }, 0f, 20); Prefab.SectionTabButton("Аирдропы", delegate { GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.BeginVertical(new GUILayoutOption[] { GUILayout.Width(240f) }); VisualsTab.BasicControls(ESPTarget.Аирдропы); bool flag = !ESPOptions.VisualOptions[3].Enabled; if (!flag) { GUILayout.EndVertical(); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } }, 0f, 20); Prefab.SectionTabButton("Ягоды", delegate { GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.BeginVertical(new GUILayoutOption[] { GUILayout.Width(240f) }); VisualsTab.BasicControls(ESPTarget.Ягоды); bool flag = !ESPOptions.VisualOptions[3].Enabled; if (!flag) { GUILayout.EndVertical(); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } }, 0f, 20); Prefab.SectionTabButton("Растения", delegate { GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.BeginVertical(new GUILayoutOption[] { GUILayout.Width(240f) }); VisualsTab.BasicControls(ESPTarget.астения); bool flag = !ESPOptions.VisualOptions[3].Enabled; if (!flag) { GUILayout.EndVertical(); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } }, 0f, 20); Prefab.SectionTabButton("Взрывчатка", delegate { GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.BeginVertical(new GUILayoutOption[] { GUILayout.Width(240f) }); VisualsTab.BasicControls(ESPTarget.C4); bool flag = !ESPOptions.VisualOptions[3].Enabled; if (!flag) { GUILayout.EndVertical(); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } }, 0f, 20); Prefab.SectionTabButton("Источники огня", delegate { GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.BeginVertical(new GUILayoutOption[] { GUILayout.Width(240f) }); VisualsTab.BasicControls(ESPTarget.Fire); bool flag = !ESPOptions.VisualOptions[3].Enabled; if (!flag) { GUILayout.EndVertical(); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } }, 0f, 20); Prefab.SectionTabButton("Лампы", delegate { GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.BeginVertical(new GUILayoutOption[] { GUILayout.Width(240f) }); VisualsTab.BasicControls(ESPTarget.Лампы); bool flag = !ESPOptions.VisualOptions[3].Enabled; if (!flag) { GUILayout.EndVertical(); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } }, 0f, 20); Prefab.SectionTabButton("Топливо", delegate { GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.BeginVertical(new GUILayoutOption[] { GUILayout.Width(240f) }); VisualsTab.BasicControls(ESPTarget.Топливо); bool flag = !ESPOptions.VisualOptions[3].Enabled; if (!flag) { GUILayout.EndVertical(); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } }, 0f, 20); Prefab.SectionTabButton("Ген. СЗ", delegate { GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.BeginVertical(new GUILayoutOption[] { GUILayout.Width(240f) }); VisualsTab.BasicControls(ESPTarget.Генератор_безопасной_зоны); bool flag = !ESPOptions.VisualOptions[3].Enabled; if (!flag) { GUILayout.EndVertical(); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } }, 0f, 20); Prefab.SectionTabButton("Ген. воздух", delegate { GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.BeginVertical(new GUILayoutOption[] { GUILayout.Width(240f) }); VisualsTab.BasicControls(ESPTarget.Генератор_Воздуха); bool flag = !ESPOptions.VisualOptions[3].Enabled; if (!flag) { GUILayout.EndVertical(); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } }, 0f, 20); }, 20, Array.Empty <GUILayoutOption>()); Prefab.MenuArea(new Rect(230f, 0f, 236f, 180f), "ДРУГОЕ", delegate { Prefab.SectionTabButton("Радар", delegate { Prefab.Toggle("Радар", ref RadarOptions.Enabled, 17); bool enabled2 = RadarOptions.Enabled; bool flag2 = enabled2; if (flag2) { Prefab.Toggle("Центрирование игрока", ref RadarOptions.TrackPlayer, 17); Prefab.Toggle("Показывать игроков", ref RadarOptions.ShowPlayers, 17); Prefab.Toggle("Показывать машины", ref RadarOptions.ShowVehicles, 17); bool showVehicles = RadarOptions.ShowVehicles; bool flag3 = showVehicles; if (flag3) { Prefab.Toggle("Только открытые", ref RadarOptions.ShowVehiclesUnlocked, 17); } GUILayout.Space(5f); GUILayout.Label("Зум радара: " + Mathf.Round(RadarOptions.RadarZoom), Prefab._TextStyle, Array.Empty <GUILayoutOption>()); Prefab.Slider(0f, 10f, ref RadarOptions.RadarZoom, 200); bool flag4 = Prefab.Button("По умолчанию", 105f, 25f, Array.Empty <GUILayoutOption>()); bool flag5 = flag4; if (flag5) { RadarOptions.RadarZoom = 1f; } GUILayout.Space(5f); GUILayout.Label("Размер радара: " + Mathf.RoundToInt(RadarOptions.RadarSize), Prefab._TextStyle, Array.Empty <GUILayoutOption>()); Prefab.Slider(50f, 1000f, ref RadarOptions.RadarSize, 200); } }, 0f, 20); Prefab.Toggle("Игроки в ванише", ref ESPOptions.ShowVanishPlayers, 17); Prefab.Toggle("Камера заднего вида", ref MirrorCameraOptions.Enabled, 17); GUILayout.Space(5f); }); Prefab.MenuArea(new Rect(230f, 185f, 236f, 250f), "Переключатели", delegate { bool flag = Prefab.Toggle("ВХ", ref ESPOptions.Enabled, 17); bool flag2 = flag; if (flag2) { bool flag3 = !ESPOptions.Enabled; bool flag4 = flag3; if (flag4) { for (int i = 0; i < ESPOptions.VisualOptions.Length; i++) { ESPOptions.VisualOptions[i].Glow = false; } abc.HookObject.GetComponent <ESPComponent>().OnGUI(); } } Prefab.Toggle("Чамсы", ref ESPOptions.ChamsEnabled, 17); bool chamsEnabled = ESPOptions.ChamsEnabled; bool flag5 = chamsEnabled; if (flag5) { Prefab.Toggle("Плоские чамсы", ref ESPOptions.ChamsFlat, 17); } Prefab.Toggle("Без дождя", ref MiscOptions.NoRain, 17); Prefab.Toggle("Без снега", ref MiscOptions.NoSnow, 17); Prefab.Toggle("No Flash", ref MiscOptions.NoFlash, 17); Prefab.Toggle("ПНВ", ref MiscOptions.NightVision, 17); Prefab.Toggle("Компасс", ref MiscOptions.Compass, 17); Prefab.Toggle("Карта(GPS)", ref MiscOptions.GPS, 17); Prefab.Toggle("Показ игроков на карте", ref MiscOptions.ShowPlayersOnMap, 17); }); }
public static void DrawFilterTab(ItemOptionList OptionList) { Prefab.SectionTabButton("ITEM FILTER", () => { Prefab.Toggle("Guns", ref OptionList.ItemfilterGun); Prefab.Toggle("Ammo", ref OptionList.ItemfilterAmmo); Prefab.Toggle("Medical", ref OptionList.ItemfilterMedical); Prefab.Toggle("Backpacks", ref OptionList.ItemfilterBackpack); Prefab.Toggle("Charges", ref OptionList.ItemfilterCharges); Prefab.Toggle("Fuel", ref OptionList.ItemfilterFuel); Prefab.Toggle("Clothing", ref OptionList.ItemfilterClothing); Prefab.Toggle("Food and Water", ref OptionList.ItemfilterFoodAndWater); Prefab.Toggle("Enable Custom Filter", ref OptionList.ItemfilterCustom); if (OptionList.ItemfilterCustom) { GUILayout.Space(5); Prefab.SectionTabButton("CUSTOM FILTER", () => { GUILayout.BeginHorizontal(); GUILayout.Space(55); OptionList.searchstring = Prefab.TextField(OptionList.searchstring, "Search:", 200); GUILayout.Space(5); if (Prefab.Button("Refresh", 276)) { ItemsComponent.RefreshItems(); } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); Prefab.ScrollView(new Rect(70, 0 + 50, 620 - 70 - 10, 190), "Add", ref OptionList.additemscroll, () => { GUILayout.Space(5); for (var i = 0; i < ItemsComponent.items.Count; i++) { ItemAsset asset = ItemsComponent.items[i]; bool isShown = false; if (asset.itemName.ToLower().Contains(OptionList.searchstring.ToLower())) { isShown = true; } if (OptionList.searchstring.Length < 2) { isShown = false; } if (OptionList.AddedItems.Contains(asset.id)) { isShown = false; } if (isShown) { DrawItemButton(asset, OptionList.AddedItems); } } GUILayout.Space(2); }); Prefab.ScrollView(new Rect(70, 200 + 5 + 40, 620 - 70 - 10, 191), "Remove", ref OptionList.removeitemscroll, () => { GUILayout.Space(5); for (var i = 0; i < ItemsComponent.items.Count; i++) { ItemAsset asset = ItemsComponent.items[i]; bool isShown = false; if (asset.itemName.ToLower().Contains(OptionList.searchstring.ToLower())) { isShown = true; } if (!OptionList.AddedItems.Contains(asset.id)) { isShown = false; } if (isShown) { DrawItemButton(asset, OptionList.AddedItems); } } GUILayout.Space(2); }); }); } }); }
// Token: 0x0600028F RID: 655 RVA: 0x0001A444 File Offset: 0x00018644 private static void BasicControls(ESPTarget esptarget) { ESPVisual espvisual = ESPOptions.VisualOptions[(int)esptarget]; Prefab.Toggle("Активировать", ref espvisual.Enabled, 17); bool flag = !espvisual.Enabled; bool flag2 = !flag; if (flag2) { Prefab.Toggle("Надписи", ref espvisual.Labels, 17); bool labels = espvisual.Labels; bool flag3 = labels; if (flag3) { Prefab.Toggle("Показывать имя", ref espvisual.ShowName, 17); Prefab.Toggle("Показывать дистанцию", ref espvisual.ShowDistance, 17); Prefab.Toggle("Показывать угол", ref espvisual.ShowAngle, 17); } Prefab.Toggle("Вох", ref espvisual.Boxes, 17); bool boxes = espvisual.Boxes; bool flag4 = boxes; if (flag4) { Prefab.Toggle("2D Вох", ref espvisual.TwoDimensional, 17); } Prefab.Toggle("Обводка", ref espvisual.Glow, 17); Prefab.Toggle("Линия до объекта", ref espvisual.LineToObject, 17); Prefab.Toggle("Масштаб текста", ref espvisual.TextScaling, 17); bool textScaling = espvisual.TextScaling; bool flag5 = textScaling; if (flag5) { espvisual.MinTextSize = Prefab.TextField(espvisual.MinTextSize, "Минимальный размер текста: ", 30, 0, 255); espvisual.MaxTextSize = Prefab.TextField(espvisual.MaxTextSize, "Максимальный размер текста: ", 30, 0, 255); GUILayout.Space(3f); GUILayout.Label("Масштабирование текста по расстоянию: " + Mathf.RoundToInt(espvisual.MinTextSizeDistance), Prefab._TextStyle, Array.Empty <GUILayoutOption>()); Prefab.Slider(0f, 1000f, ref espvisual.MinTextSizeDistance, 200); GUILayout.Space(3f); } else { espvisual.FixedTextSize = Prefab.TextField(espvisual.FixedTextSize, "Фиксированный размер текста: ", 30, 0, 255); } Prefab.Toggle("Дистанция на всю карту", ref espvisual.InfiniteDistance, 17); bool flag6 = !espvisual.InfiniteDistance; bool flag7 = flag6; if (flag7) { GUILayout.Label("ESP Расстояние: " + Mathf.RoundToInt(espvisual.Distance), Prefab._TextStyle, Array.Empty <GUILayoutOption>()); Prefab.Slider(0f, 4000f, ref espvisual.Distance, 200); GUILayout.Space(3f); } Prefab.Toggle("Лимит объектов", ref espvisual.UseObjectCap, 17); bool useObjectCap = espvisual.UseObjectCap; bool flag8 = useObjectCap; if (flag8) { espvisual.ObjectCap = Prefab.TextField(espvisual.ObjectCap, "Object cap:", 30, 0, 255); } espvisual.BorderStrength = Prefab.TextField(espvisual.BorderStrength, "Border Strength:", 30, 0, 255); } }
/// <summary> /// Removes Bullet from game if collider is not from its owner. /// </summary> /// <param name="collider">Prefab collided with</param> public override void detectCollision(Prefab collider) { base.detectCollision(collider); this.alive = collider == this.owner; }
public CutsceneRoom(int id) { prefabId = $"cutscene_{id}"; prefab = Prefabs.Get(prefabId); }
private void GetTraderProtect(Prefab prefab) => Bin.Add("TraderProtect", TraderProtect = new BCMVector3(prefab.TraderAreaProtect));
GameObject readXmlNode(XmlNode xmlNode, GameObject parent, string fileName) { GameObject go = new GameObject(xmlNode.Name); if (parent != null) { go.transform.parent = parent.transform; } if (xmlNode.NodeType == XmlNodeType.Comment) { CommentElement comment = go.AddComponent <CommentElement>(); go.transform.parent = parent.transform; comment.comment = xmlNode.InnerText; } else if (xmlNode.Name == "vehicle") { Vehicle tag = go.AddComponent <Vehicle>(); go.transform.parent = parent.transform; attachGameObjectProperties(tag, xmlNode); go.name = "<" + xmlNode.Name + " " + tag.teardownName + ">"; tag.sound = readString(xmlNode, "sound"); tag.spring = readFloat(xmlNode, "spring"); tag.acceleration = readFloat(xmlNode, "acceleration"); tag.antiroll = readFloat(xmlNode, "antiroll"); tag.damping = readFloat(xmlNode, "damping"); tag.friction = readFloat(xmlNode, "friction"); tag.difflock = readFloat(xmlNode, "difflock"); tag.steerassist = readFloat(xmlNode, "steerassist"); tag.topspeed = readFloat(xmlNode, "topspeed"); tag.driven = readBool(xmlNode, "driven", false); tag.antispin = readFloat(xmlNode, "antispin"); tag.soundVolume = readFloat(xmlNode, "soundvolume"); go.transform.localRotation = Quaternion.Euler(tag.rotation); go.transform.localPosition = tag.position; if (tag.scale > 0) { go.transform.localScale = go.transform.localScale * tag.scale; } addToParent(parent, tag); } else if (xmlNode.Name == "wheel") { Wheel tag = go.AddComponent <Wheel>(); go.transform.parent = parent.transform; attachTransformProperties(tag, xmlNode); go.name = "<" + xmlNode.Name + " " + tag.teardownName + ">"; tag.steer = readFloat(xmlNode, "steer"); tag.drive = readFloat(xmlNode, "drive"); tag.travel = readVec2(xmlNode, "travel"); go.transform.localRotation = Quaternion.Euler(tag.rotation); go.transform.localPosition = tag.position; if (tag.scale > 0) { go.transform.localScale = go.transform.localScale * tag.scale; } addToParent(parent, tag); } else if (xmlNode.Name == "spawnpoint") { SpawnPoint tag = go.AddComponent <SpawnPoint>(); go.transform.parent = parent.transform; attachTransformProperties(tag, xmlNode); go.name = "<" + xmlNode.Name + " " + tag.teardownName + ">"; go.transform.localRotation = Quaternion.Euler(tag.rotation); go.transform.localPosition = tag.position; if (tag.scale > 0) { go.transform.localScale = go.transform.localScale * tag.scale; } addToParent(parent, tag); } else if (xmlNode.Name == "location") { Location tag = go.AddComponent <Location>(); go.transform.parent = parent.transform; attachTransformProperties(tag, xmlNode); go.name = "<" + xmlNode.Name + " " + tag.teardownName + ">"; go.transform.localRotation = Quaternion.Euler(tag.rotation); go.transform.localPosition = tag.position; if (tag.scale > 0) { go.transform.localScale = go.transform.localScale * tag.scale; } addToParent(parent, tag); } else if (xmlNode.Name == "group") { Group tag = go.AddComponent <Group>(); go.transform.parent = parent.transform; attachTransformProperties(tag, xmlNode); go.name = "<" + xmlNode.Name + " " + tag.teardownName + ">"; go.transform.localRotation = Quaternion.Euler(tag.rotation); go.transform.localPosition = tag.position; if (tag.scale > 0) { go.transform.localScale = go.transform.localScale * tag.scale; } addToParent(parent, tag); } else if (xmlNode.Name == "rope") { Rope tag = go.AddComponent <Rope>(); go.transform.parent = parent.transform; attachTransformProperties(tag, xmlNode); go.name = "<" + xmlNode.Name + " " + tag.teardownName + ">"; go.transform.localRotation = Quaternion.Euler(tag.rotation); go.transform.localPosition = tag.position; tag.strength = readFloat(xmlNode, "strength"); tag.slack = readFloat(xmlNode, "slack"); addToParent(parent, tag); } else if (xmlNode.Name == "screen") { Screen tag = go.AddComponent <Screen>(); go.transform.parent = parent.transform; attachTransformProperties(tag, xmlNode); go.name = "<" + xmlNode.Name + " " + tag.teardownName + ">"; go.transform.localRotation = Quaternion.Euler(tag.rotation); go.transform.localPosition = tag.position; tag.size = readVec2(xmlNode, "size"); tag.isEnabled = readBool(xmlNode, "enabled", false); tag.interactive = readBool(xmlNode, "interactive", false); tag.emissive = readFloat(xmlNode, "emissive"); tag.color = readColor(xmlNode, "color"); tag.resolution = readVec2(xmlNode, "resolution"); tag.bulge = readVec2(xmlNode, "bulge"); tag.script = readString(xmlNode, "script"); if (tag.scale > 0) { go.transform.localScale = go.transform.localScale * tag.scale; } addToParent(parent, tag); } else if (xmlNode.Name == "vox") { Vox tag = go.AddComponent <Vox>(); go.transform.parent = parent.transform; attachGameObjectProperties(tag, xmlNode); tag.file = readString(xmlNode, "file").Replace("LEVEL", getLevelFolder(fileName));; tag.voxObject = readString(xmlNode, "object"); tag.dynamic = readBool(xmlNode, "prop", false); go.transform.localRotation = Quaternion.Euler(tag.rotation); go.transform.localPosition = tag.position; tag.Reload(); if (tag.scale > 0) { go.transform.localScale *= tag.scale; } addToParent(parent, tag); } else if (xmlNode.Name == "joint") { TeardownJoint tag = go.AddComponent <TeardownJoint>(); go.transform.parent = parent.transform; attachTransformProperties(tag, xmlNode); go.name = "<" + xmlNode.Name + " " + tag.teardownName + ">"; tag.type = (TeardownJoint.Type)Enum.Parse(typeof(TeardownJoint.Type), readString(xmlNode, "type", "ball"), false); tag.size = readFloat(xmlNode, "size"); tag.rotspring = readFloat(xmlNode, "rotspring"); tag.rotstrength = readFloat(xmlNode, "rotstrength"); tag.limits = readVec2(xmlNode, "limits"); go.transform.localRotation = Quaternion.Euler(tag.rotation); go.transform.localPosition = tag.position; if (tag.scale > 0) { go.transform.localScale = go.transform.localScale * tag.scale; } addToParent(parent, tag); } else if (xmlNode.Name == "voxbox") { VoxBox tag = go.AddComponent <VoxBox>(); go.transform.parent = parent.transform; attachGameObjectProperties(tag, xmlNode); go.name = "<" + xmlNode.Name + " " + tag.teardownName + ">"; tag.color = readColor(xmlNode, "color"); tag.dynamic = readBool(xmlNode, "prop", false); go.transform.localRotation = Quaternion.Euler(tag.rotation); go.transform.localPosition = tag.position; GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube); cube.transform.parent = go.transform; cube.transform.localPosition = new Vector3(0.5f, 0.5f, -0.5f); cube.transform.localRotation = Quaternion.identity; cube.GetComponent <MeshRenderer>().sharedMaterial = new Material(Shader.Find("Standard")); go.transform.localScale = tag.size / 10; if (tag.scale > 0) { go.transform.localScale = go.transform.localScale * tag.scale; } addToParent(parent, tag); } else if (xmlNode.Name == "body") { Body tag = go.AddComponent <Body>(); go.transform.parent = parent.transform; attachGameObjectProperties(tag, xmlNode); go.name = "<" + xmlNode.Name + " " + tag.teardownName + ">"; tag.dynamic = readBool(xmlNode, "dynamic", false); go.transform.localRotation = Quaternion.Euler(tag.rotation); go.transform.localPosition = tag.position; if (tag.scale > 0) { go.transform.localScale = go.transform.localScale * tag.scale; } addToParent(parent, tag); } else if (xmlNode.Name == "water") { go.name = "<" + xmlNode.Name + ">"; Water tag = go.AddComponent <Water>(); go.transform.parent = parent.transform; attachTransformProperties(tag, xmlNode); go.name = "<" + xmlNode.Name + " " + tag.teardownName + ">"; go.transform.localRotation = Quaternion.Euler(tag.rotation); go.transform.localPosition = tag.position; if (tag.scale > 0) { go.transform.localScale = go.transform.localScale * tag.scale; } addToParent(parent, tag); } else if (xmlNode.Name == "environment") { TeardownEnvironment tag = go.AddComponent <TeardownEnvironment>(); go.transform.parent = parent.transform; attachGeneralProperties(tag, xmlNode); go.name = "<" + xmlNode.Name + " " + tag.teardownName + ">"; tag.skyboxrot = readFloat(xmlNode, "skyboxrot"); tag.sunBrightness = readFloat(xmlNode, "sunBrightness"); tag.sunFogScale = readFloat(xmlNode, "sunFogScale"); tag.sunDir = readVec3(xmlNode, "sunDir"); tag.sunColorTint = readColor(xmlNode, "sunColorTint"); addToParent(parent, tag); } else if (xmlNode.Name == "scene") { Scene tag = go.AddComponent <Scene>(); go.transform.parent = parent.transform; attachGeneralProperties(tag, xmlNode); go.name = "<" + xmlNode.Name + " " + tag.teardownName + ">"; tag.shadowVolume = readVec3(xmlNode, "shadowVolume"); tag.version = readInt(xmlNode, "version"); addToParent(parent, tag); } else if (xmlNode.Name == "boundary") { Boundary tag = go.AddComponent <Boundary>(); attachGeneralProperties(tag, xmlNode); go.transform.parent = parent.transform; go.name = "<" + xmlNode.Name + " " + tag.teardownName + ">"; addToParent(parent, tag); } else if (xmlNode.Name == "script") { Script tag = go.AddComponent <Script>(); attachGeneralProperties(tag, xmlNode); go.transform.parent = parent.transform; tag.file = readString(xmlNode, "file"); go.name = "<" + xmlNode.Name + " " + tag.teardownName + " " + tag.file + ">"; addToParent(parent, tag); } else if (xmlNode.Name == "instance") { Instance tag = go.AddComponent <Instance>(); go.transform.parent = parent.transform; attachGeneralProperties(tag, xmlNode); tag.file = readString(xmlNode, "file"); go.name = "<" + xmlNode.Name + " " + tag.teardownName + " " + tag.file + ">"; if (!fileName.Contains("create") && tag.file.StartsWith("LEVEL")) { Debug.LogError("Your source file has no create folder in its path but an instance is referencing the level folder. Cannot import!"); } else if (!tag.file.StartsWith("LEVEL")) { GameObject xmlRoot = readXML(tag.file); xmlRoot.GetComponentInChildren <Prefab>().gameObject.transform.transform.parent = go.transform; DestroyImmediate(xmlRoot); } else { GameObject xmlRoot = readXML(tag.file.Replace("LEVEL", getLevelFolder(fileName))); xmlRoot.GetComponentInChildren <Prefab>().gameObject.transform.transform.parent = go.transform; DestroyImmediate(xmlRoot); } go.transform.localRotation = Quaternion.Euler(tag.rotation); go.transform.localPosition = tag.position; if (tag.scale > 0) { go.transform.localScale = go.transform.localScale * tag.scale; } addToParent(parent, tag); } else if (xmlNode.Name == "prefab") { Prefab tag = go.AddComponent <Prefab>(); go.transform.parent = parent.transform; attachGameObjectProperties(tag, xmlNode); go.name = "<" + xmlNode.Name + " " + tag.teardownName + ">"; addToParent(parent, tag); } else if (xmlNode.Name == "vertex") { Vertex tag = go.AddComponent <Vertex>(); go.transform.parent = parent.transform; attachGeneralProperties(tag, xmlNode); tag.pos = readVec2(xmlNode, "pos"); go.name = "<" + xmlNode.Name + " " + tag.teardownName + ">"; go.transform.localPosition = new Vector3(tag.pos.x, 0, tag.pos.y); addToParent(parent, tag); } else if (xmlNode.Name == "light") { Light tag = go.AddComponent <Light>(); go.transform.parent = parent.transform; attachGeneralProperties(tag, xmlNode); attachTransformProperties(tag, xmlNode); go.name = "<" + xmlNode.Name + " " + tag.teardownName + ">"; tag.penumbra = readFloat(xmlNode, "penumbra"); tag.unshadowed = readFloat(xmlNode, "unshadowed"); tag.angle = readFloat(xmlNode, "angle"); tag.glare = readFloat(xmlNode, "glare"); tag.color = readColor(xmlNode, "color"); tag.type = (Light.Type)Enum.Parse(typeof(Light.Type), readString(xmlNode, "type", "area"), false); go.transform.localRotation = Quaternion.Euler(tag.rotation); go.transform.localPosition = tag.position; if (tag.scale > 0) { go.transform.localScale = go.transform.localScale * tag.scale; } addToParent(parent, tag); } foreach (XmlNode child in xmlNode.ChildNodes) { GameObject childGameObject = readXmlNode(child, go, fileName); } return(go); }
private ReturnValue Run(Prefab.Point currNode, Mode mode ) { #region escape cases //check if an edge or was visited if (!BitmapContainsOffset(Bitmaps[0], currNode) || Bitmap(currNode, mode) > Thresh) return ReturnValue.FailedNormal; //mark visited SetVisited(currNode, Thresh + 1); //Set a property defining our path SetPathValue(currNode, mode); //If we're not surrounding the mouse clicks, we fail if (!AroundPoints(currNode, mode)) return ReturnValue.FailedNormal; //Check if we closed the rectangle if (Done(currNode, mode)) return ReturnValue.Closed; #endregion Prefab.Point child = Child(currNode, mode); ReturnValue value = Run(child, NextMode(mode)); if (value == ReturnValue.Closed) return value; else if (value == ReturnValue.FailedDontContinue) return value; else if (value == ReturnValue.FailedNormal && mode == Mode.Left && currNode.X == Start.X && currNode.Y > Start.Y) return ReturnValue.FailedDontContinue; return Run(Sibling(currNode, mode), mode); }
private void GetHasVolumes(Prefab prefab) => Bin.Add("HasVolumes", HasVolumes = prefab.bSleeperVolumes);
private void SetPathValue(Prefab.Point currNode, Mode mode) { switch (mode) { case Mode.Up: if (MinY > currNode.Y) MinY = currNode.Y; break; case Mode.Right: if (MaxX < currNode.X) MaxX = currNode.X; break; case Mode.Down: if (MaxY < currNode.Y) MaxY = currNode.Y; break; case Mode.Left: if (MinX > currNode.X) MinX = currNode.X; break; } }
public Prefab ToPrefab() { return(Prefab.Create(prefabEntity)); }
private List<Prefab.Point> NexTurn(Prefab.Point turn, List<Prefab.Point> turns) { List<Prefab.Point> cpy = new List<Prefab.Point>(); cpy.AddRange(turns); cpy.Add(turn); return cpy; }
void LayoutObjectAtRandom(Prefab[] tileArray, int min, int max, Action<Entity, int, int> postProcess) { var gridPositions = pool.gridPositions.value; int objectCount = UnityEngine.Random.Range(min, max + 1); for (int i = 0; i < objectCount; i++) { int randomIndex = gridPositions.RandomIndex(); var randomPosition = gridPositions[randomIndex]; //Remove the entry at randomIndex from the list so that it can't be re-used. gridPositions.RemoveAt(randomIndex); var randomTileIndex = tileArray.RandomIndex(); var tileChoice = tileArray[randomTileIndex]; var tile = pool.CreateEntity() .IsGameBoardElement(true) .IsDeleteOnExit(true) .AddResource(tileChoice) .AddPosition((int)randomPosition.x, (int)randomPosition.y); postProcess(tile, i, randomTileIndex); } }
private Prefab.Point Child(Prefab.Point currNode, Mode currMode) { switch (currMode) { case Mode.Up: return new Prefab.Point(currNode.X + 1, currNode.Y); case Mode.Right: return new Prefab.Point(currNode.X, currNode.Y + 1); case Mode.Down: return new Prefab.Point(currNode.X - 1, currNode.Y); case Mode.Left: return new Prefab.Point(currNode.X, currNode.Y - 1); } throw new Exception("Invalid number of turns"); }
public Entity AddResource(Prefab newPrefab) { var component = CreateComponent<ResourceComponent>(ComponentIds.Resource); component.prefab = newPrefab; return AddComponent(ComponentIds.Resource, component); }
private bool Done(Prefab.Point currNode, Mode mode) { if (currNode.X == Start.X && currNode.Y - 1 == Start.Y) return true; return false; }
private void GetIsTrader(Prefab prefab) => Bin.Add("IsTrader", IsTrader = prefab.bTraderArea);
private PrefabExportCollection(IAssetExporter assetExporter, VirtualSerializedFile virtualFile, GameObject root) : this(assetExporter, root.File, Prefab.CreateVirtualInstance(virtualFile, root)) { }
private void GetDistOverride(Prefab prefab) => Bin.Add("DistOverride", DistOverride = prefab.distantPOIOverride);
public static Character Generate(Prefab prefab, Point position) { Character c = new Character(); switch (prefab) { case Prefab.Player: c.Name = "Adam"; c.Symbol = '@'; c.Infection = 0; c.Faction = Factions.Survivors; c.Strength = 16; c.Dexterity = 12; c.Constitution = 12; c.Intelligence = 12; c.AttackMultiplier = 1; c.AttackModifier = 4; c.Defense = 10; c.Speed = 2; c.MaxHP = 30; c.HP = c.MaxHP; c.ViewRadius = 23; break; case Prefab.Survivor: c.Symbol = '@'; c.Infection = 0; c.Faction = Factions.Survivors; break; case Prefab.Zombie: c.Symbol = 'z'; c.ForegroundColor = TCODColor.desaturatedGreen; c.Infection = 100; c.Faction = Factions.Undead; c.Strength = 8; c.Dexterity = 6; c.Constitution = 6; c.Intelligence = 4; c.AttackMultiplier = 1; c.AttackModifier = -2; c.Defense = 10; c.Speed = 1; c.MaxHP = 10; c.HP = c.MaxHP; c.AIType = AITypes.Zombie; c.ViewRadius = 14; break; } c.Area = Area.Current; c.Position = position; return c; }
private PrefabExportCollection(IAssetExporter assetExporter, IAssetContainer file, Prefab prefab) : base(assetExporter, prefab) { foreach (EditorExtension asset in prefab.FetchObjects(file)) { AddAsset(asset); } }
// Construct this class from serialization data public void LoadFromData(StringReader data) { _prefabs.Clear(); string info; while ((info = data.ReadLine()) != null && info.Contains("Game Object:")) { Prefab prefab = new Prefab(); // loading the GameObject prefab.gameObject = AssetDatabase.LoadAssetAtPath <Object>(info.Substring(13).TrimEnd('\n')); // Setting Layer info = data.ReadLine(); prefab.layerMenu.SetSelection(info.Substring(7).TrimEnd('\n')); // Setting toggle info = data.ReadLine(); prefab.toggle = bool.Parse(info.Substring(8).TrimEnd('\n')); // Setting slider value info = data.ReadLine(); prefab.slider = float.Parse(info.Substring(8).TrimEnd('\n')); // Setting lock orientation toggle info = data.ReadLine(); prefab.lockOrientation = bool.Parse(info.Substring(25).TrimEnd('\n')); // Setting random rotation toggle info = data.ReadLine(); prefab.randRotToggle = bool.Parse(info.Substring(24).TrimEnd('\n')); // Setting random XYZ toggles for (int i = 0; i < 3; ++i) { info = data.ReadLine(); prefab.randRotXYZ[i] = bool.Parse(info.Substring(19).TrimEnd('\n')); } // Setting random scale toggle info = data.ReadLine(); prefab.randScaleToggle = bool.Parse(info.Substring(21).TrimEnd('\n')); // Setting random scale min / max info = data.ReadLine(); prefab.randScaleMin = float.Parse(info.Substring(18).TrimEnd('\n')); info = data.ReadLine(); prefab.randScaleMax = float.Parse(info.Substring(18).TrimEnd('\n')); // Setting FIXED rotation toggle info = data.ReadLine(); prefab.FixRotToggle = bool.Parse(info.Substring(22).TrimEnd('\n')); // Setting FIXED XYZ toggles for (int i = 0; i < 3; ++i) { info = data.ReadLine(); prefab.FixRotXYZ[i] = float.Parse(info.Substring(18).TrimEnd('\n')); } // Setting depth info = data.ReadLine(); prefab.depth = float.Parse(info.Substring(6).TrimEnd('\n')); // Adding the newly constructed prefab _prefabs.Add(prefab); // getting rid of the extra newline info = data.ReadLine(); } _groupingObjects.Clear(); while ((info = data.ReadLine()) != null) { GameObject obj; if ((obj = GameObject.Find(info)) && !_groupingObjects.ContainsKey(info)) { _groupingObjects.Add(info, obj); } } }
public static void Tab() { Prefab.ScrollView(new Rect(0f, 0f, 250f, 436f), "Статистика", ref StatsTab.ScrollPos, delegate() { for (int i = 0; i < StatsTab.StatLabels.Length; i++) { string text = StatsTab.StatLabels[i]; bool flag = Prefab.Button(text, 205f, 25f, new GUILayoutOption[0]); if (flag) { StatsTab.Selected = i; } GUILayout.Space(3f); } GUILayout.Label("Получение достижений", Prefab._TextStyle, new GUILayoutOption[0]); if (Prefab.Button("Welcome to PEI", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("pei"); } GUILayout.Space(3f); if (Prefab.Button("A Bridge Too Far", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("bridge"); } GUILayout.Space(3f); if (Prefab.Button("Mastermind", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("mastermind"); } GUILayout.Space(3f); if (Prefab.Button("Offense", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("offense"); } GUILayout.Space(3f); if (Prefab.Button("Defense", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("defense"); } GUILayout.Space(3f); if (Prefab.Button("Support", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("support"); } GUILayout.Space(3f); if (Prefab.Button("Experienced + Schooled", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("experienced"); } GUILayout.Space(3f); if (Prefab.Button("Hoarder + Scavenger", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("hoarder"); } GUILayout.Space(3f); if (Prefab.Button("Outdoors + Camper", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("outdoors"); } GUILayout.Space(3f); if (Prefab.Button("Psychopath + Murderer", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("psychopath"); } GUILayout.Space(3f); if (Prefab.Button("Survivor", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("survivor"); } GUILayout.Space(3f); if (Prefab.Button("Berries", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("berries"); } GUILayout.Space(3f); if (Prefab.Button("Accident Prone", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("accident_prone"); } GUILayout.Space(3f); if (Prefab.Button("Behind the Wheel", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("wheel"); } GUILayout.Space(3f); if (Prefab.Button("Welcome to the Yukon", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("yukon"); } GUILayout.Space(3f); if (Prefab.Button("Welcome to Washington", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("washington"); } GUILayout.Space(3f); if (Prefab.Button("Fishing", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("fishing"); } GUILayout.Space(3f); if (Prefab.Button("Crafting", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("crafting"); } GUILayout.Space(3f); if (Prefab.Button("Farming", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("farming"); } GUILayout.Space(3f); if (Prefab.Button("Headshot", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("headshot"); } GUILayout.Space(3f); if (Prefab.Button("Sharpshooter", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("sharpshooter"); } GUILayout.Space(3f); if (Prefab.Button("Hiking", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("hiking"); } GUILayout.Space(3f); if (Prefab.Button("Roadtrip", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("roadtrip"); } GUILayout.Space(3f); if (Prefab.Button("Champion", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("champion"); } GUILayout.Space(3f); if (Prefab.Button("Fortified", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("fortified"); } GUILayout.Space(3f); if (Prefab.Button("Welcome to Russia", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("russia"); } GUILayout.Space(3f); if (Prefab.Button("Villain", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("villain"); } GUILayout.Space(3f); if (Prefab.Button("Helping Hand", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("Quest"); } if (Prefab.Button("Unturned", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("unturned"); } GUILayout.Space(3f); if (Prefab.Button("Forged + Hardened", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("forged"); } GUILayout.Space(3f); if (Prefab.Button("Graduation", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("Educated"); } if (Prefab.Button("Soulcrystal", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("soulcrystal"); } GUILayout.Space(3f); if (Prefab.Button("Paragon", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("paragon"); } GUILayout.Space(3f); if (Prefab.Button("Mk. II", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("mk2"); } GUILayout.Space(3f); if (Prefab.Button("Ensign", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("ensign"); } GUILayout.Space(3f); if (Prefab.Button("Lieutenant", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("lieutenant"); } GUILayout.Space(3f); if (Prefab.Button("Major", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("major"); } GUILayout.Space(3f); if (Prefab.Button("Welcome to Hawaii", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("hawaii"); } GUILayout.Space(3f); if (Prefab.Button("Extinguished", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("Boss_Magma"); } GUILayout.Space(3f); if (Prefab.Button("Secrets of Neuschwanstein", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("Zweihander"); } if (Prefab.Button("Получить все достижения", 205f, 25f, new GUILayoutOption[0])) { Provider.provider.achievementsService.setAchievement("Educated"); Provider.provider.achievementsService.setAchievement("Zweihander"); Provider.provider.achievementsService.setAchievement("Boss_Magma"); Provider.provider.achievementsService.setAchievement("Quest"); Provider.provider.achievementsService.setAchievement("pei"); Provider.provider.achievementsService.setAchievement("bridge"); Provider.provider.achievementsService.setAchievement("mastermind"); Provider.provider.achievementsService.setAchievement("offense"); Provider.provider.achievementsService.setAchievement("defense"); Provider.provider.achievementsService.setAchievement("support"); Provider.provider.achievementsService.setAchievement("experienced"); Provider.provider.achievementsService.setAchievement("hoarder"); Provider.provider.achievementsService.setAchievement("outdoors"); Provider.provider.achievementsService.setAchievement("psychopath"); Provider.provider.achievementsService.setAchievement("survivor"); Provider.provider.achievementsService.setAchievement("berries"); Provider.provider.achievementsService.setAchievement("accident_prone"); Provider.provider.achievementsService.setAchievement("wheel"); Provider.provider.achievementsService.setAchievement("yukon"); Provider.provider.achievementsService.setAchievement("fishing"); Provider.provider.achievementsService.setAchievement("washington"); Provider.provider.achievementsService.setAchievement("crafting"); Provider.provider.achievementsService.setAchievement("farming"); Provider.provider.achievementsService.setAchievement("headshot"); Provider.provider.achievementsService.setAchievement("sharpshooter"); Provider.provider.achievementsService.setAchievement("hiking"); Provider.provider.achievementsService.setAchievement("roadtrip"); Provider.provider.achievementsService.setAchievement("champion"); Provider.provider.achievementsService.setAchievement("fortified"); Provider.provider.achievementsService.setAchievement("russia"); Provider.provider.achievementsService.setAchievement("villain"); Provider.provider.achievementsService.setAchievement("unturned"); Provider.provider.achievementsService.setAchievement("forged"); Provider.provider.achievementsService.setAchievement("soulcrystal"); Provider.provider.achievementsService.setAchievement("paragon"); Provider.provider.achievementsService.setAchievement("mk2"); Provider.provider.achievementsService.setAchievement("ensign"); Provider.provider.achievementsService.setAchievement("major"); Provider.provider.achievementsService.setAchievement("lieutenant"); Provider.provider.achievementsService.setAchievement("hawaii"); } GUILayout.Space(3f); }, 20, new GUILayoutOption[0]); Rect area; area = new Rect(260f, 0f, 196f, 250f); Prefab.MenuArea(area, "Модиффикатор", delegate { bool flag = StatsTab.Selected == 0; if (!flag) { string text = StatsTab.StatLabels[StatsTab.Selected]; Provider.provider.statisticsService.userStatisticsService.getStatistic(StatsTab.StatNames[StatsTab.Selected], out int num); GUILayout.Label(text, Prefab._TextStyle, new GUILayoutOption[0]); GUILayout.Space(4f); GUILayout.Label(string.Format("Текущий: {0}", num), Prefab._TextStyle, new GUILayoutOption[0]); GUILayout.Space(3f); StatsTab.Amount = Prefab.TextField(StatsTab.Amount, "Модиффицировать: ", 50); GUILayout.Space(2f); bool flag2 = !int.TryParse(StatsTab.Amount, out int num2); if (!flag2) { bool flag3 = Prefab.Button("Принять", 75f, 25f, new GUILayoutOption[0]); if (flag3) { for (int i = 1; i <= num2; i++) { Provider.provider.statisticsService.userStatisticsService.setStatistic(StatsTab.StatNames[StatsTab.Selected], num + i); } } } } });
private void OnEditorUpdate() { UpdateLoadingProgress(); if (HasFocus) { if (!Input.IsPointerButtonHeld(PointerButton.Right)) { if (VirtualInput.IsButtonDown(EditorApplication.DuplicateKey)) { DuplicateSelection(); } else if (VirtualInput.IsButtonDown(EditorApplication.DeleteKey)) { DeleteSelection(); } else if (VirtualInput.IsButtonDown(viewToolKey)) { EditorApplication.ActiveSceneTool = SceneViewTool.View; } else if (VirtualInput.IsButtonDown(moveToolKey)) { EditorApplication.ActiveSceneTool = SceneViewTool.Move; } else if (VirtualInput.IsButtonDown(rotateToolKey)) { EditorApplication.ActiveSceneTool = SceneViewTool.Rotate; } else if (VirtualInput.IsButtonDown(scaleToolKey)) { EditorApplication.ActiveSceneTool = SceneViewTool.Scale; } } } // Refresh GUI buttons if needed (in case someones changes the values from script) if (editorSettingsHash != EditorSettings.Hash) { UpdateButtonStates(); editorSettingsHash = EditorSettings.Hash; } // Update scene view handles and selection sceneGrid.Draw(); bool handleActive = sceneHandles.IsActive() || sceneAxesGUI.IsActive(); Vector2I scenePos; bool inBounds = ScreenToScenePos(Input.PointerPosition, out scenePos); bool clearSelection = false; if (AllowViewportInput) { if (Input.IsPointerButtonUp(PointerButton.Left)) { clearSelection = true; } else if (Input.IsPointerButtonDown(PointerButton.Left)) { mouseDownPosition = scenePos; } } else { clearSelection = true; inBounds = false; } bool dragResult = false; if (clearSelection) { dragResult = EndDragSelection(); if (sceneHandles.IsActive()) { sceneHandles.ClearSelection(); } if (sceneAxesGUI.IsActive()) { sceneAxesGUI.ClearSelection(); } } bool draggedOver = DragDrop.DragInProgress || DragDrop.DropInProgress; draggedOver &= IsPointerHovering && inBounds && DragDrop.Type == DragDropType.Resource; if (draggedOver) { if (DragDrop.DropInProgress) { dragActive = false; if (draggedSO != null) { Selection.SceneObject = draggedSO; EditorApplication.SetSceneDirty(); } draggedSO = null; } else { if (!dragActive) { dragActive = true; ResourceDragDropData dragData = (ResourceDragDropData)DragDrop.Data; string[] draggedPaths = dragData.Paths; for (int i = 0; i < draggedPaths.Length; i++) { ResourceMeta meta = ProjectLibrary.GetMeta(draggedPaths[i]); if (meta != null) { if (meta.ResType == ResourceType.Mesh) { if (!string.IsNullOrEmpty(draggedPaths[i])) { string meshName = Path.GetFileNameWithoutExtension(draggedPaths[i]); draggedSO = UndoRedo.CreateSO(meshName, "Created a new Renderable \"" + meshName + "\""); Mesh mesh = ProjectLibrary.Load <Mesh>(draggedPaths[i]); Renderable renderable = draggedSO.AddComponent <Renderable>(); renderable.Mesh = mesh; if (mesh != null) { draggedSOOffset = mesh.Bounds.Box.Center; } else { draggedSOOffset = Vector3.Zero; } } break; } else if (meta.ResType == ResourceType.Prefab) { if (!string.IsNullOrEmpty(draggedPaths[i])) { Prefab prefab = ProjectLibrary.Load <Prefab>(draggedPaths[i]); draggedSO = UndoRedo.Instantiate(prefab, "Instantiating " + prefab.Name); if (draggedSO != null) { AABox draggedObjBounds = EditorUtility.CalculateBounds(draggedSO); draggedSOOffset = draggedObjBounds.Center; } else { draggedSOOffset = Vector3.Zero; } } break; } } } } if (draggedSO != null) { if (Input.IsButtonHeld(ButtonCode.Space)) { SnapData snapData; sceneSelection.Snap(scenePos, out snapData, new SceneObject[] { draggedSO }); Quaternion q = Quaternion.FromToRotation(Vector3.YAxis, snapData.normal); draggedSO.Position = snapData.position; draggedSO.Rotation = q; } else { Ray worldRay = camera.ScreenPointToRay(scenePos); draggedSO.Position = worldRay * DefaultPlacementDepth - draggedSOOffset; } } } return; } else { if (dragActive) { dragActive = false; if (draggedSO != null) { draggedSO.Destroy(); draggedSO = null; } } } if ((HasContentFocus || IsPointerHovering) && AllowViewportInput) { cameraController.EnableInput(true); if (inBounds && HasContentFocus) { if (Input.IsPointerButtonDown(PointerButton.Left)) { Rect2I sceneAxesGUIBounds = new Rect2I(Width - HandleAxesGUISize - HandleAxesGUIPaddingX, HandleAxesGUIPaddingY, HandleAxesGUISize, HandleAxesGUISize); if (sceneAxesGUIBounds.Contains(scenePos)) { sceneAxesGUI.TrySelect(scenePos); } else { sceneHandles.TrySelect(scenePos); } } else if (Input.IsPointerButtonHeld(PointerButton.Left) && !handleActive && !dragActive && draggedSO == null && scenePos != mouseDownPosition) { if (isDraggingSelection) { UpdateDragSelection(scenePos); } else { StartDragSelection(scenePos); } } else if (Input.IsPointerButtonUp(PointerButton.Left)) { if (!handleActive && !dragActive && !dragResult) { bool ctrlHeld = Input.IsButtonHeld(ButtonCode.LeftControl) || Input.IsButtonHeld(ButtonCode.RightControl); sceneSelection.PickObject(scenePos, ctrlHeld, new SceneObject[] { draggedSO }); } } } } else { cameraController.EnableInput(false); } if (AllowViewportInput) { SceneHandles.BeginInput(); sceneHandles.UpdateInput(scenePos, Input.PointerDelta); sceneAxesGUI.UpdateInput(scenePos); SceneHandles.EndInput(); } sceneHandles.Draw(); sceneAxesGUI.Draw(); // Must be done after handle input is processed, in order to reflect most recent transform sceneGizmos.Draw(); sceneSelection.Draw(); UpdateGridMode(); if (VirtualInput.IsButtonDown(frameKey)) { cameraController.FrameSelected(); } }
private void GetTraderTpCenter(Prefab prefab) => Bin.Add("TraderTpCenter", TraderTpCenter = new BCMVector3(prefab.TraderAreaTeleportCenter));