private static void CreateLegacyChest() { for (int i = 1; i < 11; i++) { var go = ZNetScene.instance.GetPrefab("OdinLegacy"); GameObject Chest = Instantiate(ZNetScene.instance.GetPrefab("Chest"), Root.transform); Chest.name = "LegacyChest" + i; DestroyImmediate(Chest.GetComponent <Rigidbody>()); var sp = Chest.AddComponent <StaticPhysics>(); sp.m_pushUp = false; var ctn = Chest.GetComponent <Container>(); Chest.AddComponent <LegacyChest>(); var mat = Chest.GetComponentInChildren <Renderer>().material; mat.SetFloat("_Hue", 0.3f); mat.SetFloat("_Saturation", 0.5f); ctn.m_name = "LegacyChest"; ctn.m_width = 1; ctn.m_height = 1; ctn.m_defaultItems.m_drops.Add(new DropTable.DropData { m_item = go, m_stackMax = i, m_stackMin = i, m_weight = 1 }); //-? var fx = Instantiate(FxAssetManager.GetFxNN("BlueSmoke"), Chest.transform); PrefabList.Add(Chest.name, Chest); } }
public static GameObject CreateMonster(string name) { var go = Instantiate(ZNetScene.instance.GetPrefab(name), OdinPlus.PrefabParent.transform); name = Regex.Replace(name, @"[_]", ""); go.name = name + "Hunt"; go.AddComponent <HuntTarget>(); go.GetComponent <Humanoid>().m_name += " $op_hunt_target"; DestroyImmediate(go.GetComponent <CharacterDrop>()); var fx = Instantiate(FxAssetManager.GetFxNN("GreenSmoke"), go.transform); fx.transform.position = go.FindObject("Spine2").transform.position; //opt Random smoke return(go); }
public static void PostZNS() { if (!ZnsInit) { if (!FxAssetManager.isInit) { FxAssetManager.Init(); } if (!PetManager.isInit) { PetManager.Init(); } if (!PrefabManager.isInit) { PrefabManager.Init(); } HumanManager.Init(); ZnsInit = true; } ValRegister(); }