/// <summary> /// Initialize the RepairShop class /// </summary> public Yard() : base("YARD") { Instance = this; // Fix for broken computer. // We're changing it to null. if (GameObject.Find("COMPUTER") != null) { GameObject.Find("COMPUTER").transform.parent = null; } GameObject.Find("GarageDoors").transform.parent = null; Doors = GetTransform().GetComponentsInChildren <Transform>() .Where(t => t.root == GetTransform() && t.gameObject.name.Contains("Door") && t.Find("Pivot") != null).ToArray(); foreach (Transform door in Doors) { if (door.Find("Pivot/Handle") != null) { door.Find("Pivot/Handle").gameObject.GetComponent <PlayMakerFSM>().Fsm.RestartOnEnable = false; } } GameObjectBlackList.AddRange(blackList); DisableableChilds = GetDisableableChilds(); // Remove fridge mesh from the list of disabled objects Transform fridgeMesh = DisableableChilds.Find(w => w.name == "mesh" && w.transform.parent.name == "Fridge"); DisableableChilds.Remove(fridgeMesh); }
/// <summary> /// Initialize the RepairShop class /// </summary> public RepairShop() : base("REPAIRSHOP", 250) { // Set junk car objects parent to null. for (int i = 1; transform.Find($"JunkCar{i}") != null; i++) { Transform junk = transform.Find($"JunkCar{i}"); if (junk != null) { junk.parent = null; } } GameObjectBlackList.AddRange(blackList); DisableableChilds = GetDisableableChilds(); // Fix for Satsuma parts on shelves List <Transform> productsMesh = DisableableChilds.FindAll(t => t.name == "mesh" && t.parent.name.Contains("Product")); foreach (Transform product in productsMesh) { DisableableChilds.Remove(product); } // Fix Sphere Collider of the cash register. SphereCollider registerCollider = transform.Find("LOD/Store/ShopCashRegister/Register").gameObject.GetComponent <SphereCollider>(); registerCollider.radius = 70; Vector3 newBounds = registerCollider.center; newBounds.x = 5; registerCollider.center = newBounds; // Add collider to Fury. BoxCollider collBox0 = transform.Find("LOD/Vehicle/FURY").gameObject.AddComponent <BoxCollider>(); BoxCollider collBox1 = transform.Find("LOD/Vehicle/FURY").gameObject.AddComponent <BoxCollider>(); collBox0.center = new Vector3(0, 0, -.2f); collBox0.size = new Vector3(2.2f, 1.3f, 5); collBox1.center = new Vector3(0, 0, -.25f); collBox1.size = new Vector3(1.4f, 2.3f, 1.1f); // Hooks a trigger for when Satsuma has been moved by the Fleetari, so it won't get teleported back. try { FsmHook.FsmInject(transform.Find("Order").gameObject, "Move Satsuma", Satsuma.Instance.FleetariIsMovingCar); } catch { throw new System.Exception("Couldn't FsmHook RepairShop/Order object."); } // Fix door resetting. transform.Find("LOD/Door/Handle").gameObject.GetComponent <PlayMakerFSM>().Fsm.RestartOnEnable = false; Compress(); }
/// <summary> /// Initialize the RepairShop class /// </summary> public Yard() : base("YARD") { Instance = this; // Fix for broken computer. // We're changing it to null. if (GameObject.Find("COMPUTER") != null) { GameObject.Find("COMPUTER").transform.parent = null; } GameObject garageDoors = GameObject.Find("GarageDoors"); garageDoors.transform.Find("DoorLeft/Coll").GetComponent <PlayMakerFSM>().Fsm.RestartOnEnable = false; garageDoors.transform.Find("DoorRight/Coll").GetComponent <PlayMakerFSM>().Fsm.RestartOnEnable = false; foreach (Transform door in transform.GetComponentsInChildren <Transform>().Where(t => t.root == transform && t.gameObject.name.Contains("Door") && t.Find("Pivot") != null).ToArray()) { if (door.Find("Pivot/Handle") != null) { door.Find("Pivot/Handle").gameObject.GetComponent <PlayMakerFSM>().Fsm.RestartOnEnable = false; } } GameObjectBlackList.AddRange(blackList); DisableableChilds = GetDisableableChilds(); // Remove fridge mesh from the list of disabled objects Transform fridgeMesh = DisableableChilds.Find(w => w.name == "mesh" && w.transform.parent.name == "Fridge"); DisableableChilds.Remove(fridgeMesh); // Disable restarting of FSM in UNCLE object. transform.Find("UNCLE").GetComponent <PlayMakerFSM>().Fsm.RestartOnEnable = false; Compress(); transform.Find("Building/SAUNA/Sauna/Kiuas/ButtonPower").GetComponent <PlayMakerFSM>().Fsm.RestartOnEnable = false; transform.Find("Building/SAUNA/Sauna/Kiuas/ButtonTime").GetComponent <PlayMakerFSM>().Fsm.RestartOnEnable = false; transform.Find("Building/SAUNA/Sauna/Kiuas/StoveTrigger").GetComponent <PlayMakerFSM>().Fsm.RestartOnEnable = false; transform.Find("Building/SAUNA/Sauna/Simulation").GetComponent <PlayMakerFSM>().Fsm.RestartOnEnable = false; }
/// <summary> /// Initialize the RepairShop class /// </summary> public RepairShop() : base("REPAIRSHOP", 250) { // Set junk car objects parent to null. for (int i = 1; GetTransform().Find($"JunkCar{i}") != null; i++) { Transform junk = GetTransform().Find($"JunkCar{i}"); if (junk != null) { junk.parent = null; } } GameObjectBlackList.AddRange(blackList); DisableableChilds = GetDisableableChilds(); // Fix for Satsuma parts on shelves List <Transform> productsMesh = DisableableChilds.FindAll(t => t.name == "mesh" && t.parent.name.Contains("Product")); foreach (Transform product in productsMesh) { DisableableChilds.Remove(product); } // Fix Sphere Collider of the cash register. SphereCollider registerCollider = GetTransform().Find("LOD/Store/ShopCashRegister/Register").gameObject.GetComponent <SphereCollider>(); registerCollider.radius = 70; Vector3 newBounds = registerCollider.center; newBounds.x = 5; registerCollider.center = newBounds; // Add collider to Fury. BoxCollider collBox0 = GetTransform().Find("LOD/Vehicle/FURY").gameObject.AddComponent <BoxCollider>(); BoxCollider collBox1 = GetTransform().Find("LOD/Vehicle/FURY").gameObject.AddComponent <BoxCollider>(); collBox0.center = new Vector3(0, 0, -.2f); collBox0.size = new Vector3(2.2f, 1.3f, 5); collBox1.center = new Vector3(0, 0, -.25f); collBox1.size = new Vector3(1.4f, 2.3f, 1.1f); }
public Inspection() : base("INSPECTION") { GameObjectBlackList.AddRange(blackList); DisableableChilds = GetDisableableChilds(); }
/// <summary> /// Initialize the Store class /// </summary> public Teimo() : base("STORE") { // Fix for items bought via envelope GetTransform().Find("Boxes").parent = null; // Fix for advertisement pile disappearing when taken GetTransform().Find("AdvertSpawn").transform.parent = null; // We're nulling the parent of the f*****g video poker game, // because that's much easier than hooking it... Transform videoPoker = GetTransform().Find("LOD/VideoPoker/HookSlot"); if (videoPoker != null) { FsmHook.FsmInject(videoPoker.gameObject, "Activate cable", RemoveVideoPokerParent); } GameObjectBlackList.AddRange(blackList); DisableableChilds = GetDisableableChilds(); // Remove video poker meshes. DisableableChilds.Remove(GetTransform().Find("LOD/VideoPoker/Hatch/Pivot/mesh")); // Fix for Z-fighting of slot machine glass. GetTransform().Find("LOD/GFX_Store/SlotMachine/slot_machine 1/slot_machine_glass") .gameObject.GetComponent <Renderer>().material.renderQueue = 3001; PlayMakers.AddRange(GetTransform().Find("TeimoInShop").GetComponents <PlayMakerFSM>()); PlayMakers.AddRange(GetTransform().Find("TeimoInShop").GetComponents <PlayMakerFSM>()); List <Transform> teimoShit = new List <Transform>(); teimoShit.Add(GetTransform().Find("TeimoInShop/Pivot/Speak")); teimoShit.Add(GetTransform().Find("TeimoInShop/Pivot/FacePissTrigger")); teimoShit.Add(GetTransform().Find("TeimoInShop/Pivot/TeimoCollider")); teimoShit.Add(GetTransform().Find("GasolineFire")); DisableableChilds.AddRange(teimoShit); // Disable resetting of the breakable windows. Transform storeBreakableWindow = GameObject.Find("STORE").transform.Find("LOD/GFX_Store/BreakableWindows/BreakableWindow"); if (storeBreakableWindow != null) { foreach (PlayMakerFSM fsm in storeBreakableWindow.gameObject.GetComponents <PlayMakerFSM>()) { fsm.Fsm.RestartOnEnable = false; } } Transform storeBreakableWindowPub = GameObject.Find("STORE").transform.Find("LOD/GFX_Pub/BreakableWindowsPub/BreakableWindowPub"); if (storeBreakableWindowPub != null) { foreach (PlayMakerFSM fsm in storeBreakableWindowPub.gameObject.GetComponents <PlayMakerFSM>()) { fsm.Fsm.RestartOnEnable = false; } } // Disables the idiotic distance limit, below which if player is too close to the Teimo's, the restocking won't be executed. FloatCompare checkDistance = GetTransform().Find("Inventory").gameObject.GetComponent <PlayMakerFSM>().FindFsmState("Check distance").Actions[1] as FloatCompare; checkDistance.float2 = 0; }
public Farm() : base("Farm", 300) { GameObjectBlackList.AddRange(blackList); DisableableChilds = GetDisableableChilds(); Compress(); }