public void DressSuit(Item.ItemProp it) { if (!showSuit) { GameObject clone = (GameObject)Instantiate(suitPrefab.gameObject, transform.position, transform.rotation); clone.name = "Suit"; clone.transform.parent = transform; activeSuit = it; it.active = true; showSuit = true; transform.FindChild("Hostage").gameObject.SetActive(false); transform.FindChild("Suit").gameObject.SetActive(true); } }
public void DisableAllWeapons() { foreach (MyStack obj in Stacks) { if (obj.MyItems.Count > 0) if (obj.MyItems[0].weapon) obj.MyItems[0].active = false; } if (activeWeapon.name != "") { if (GameObject.Find("WeapObj").transform.FindChild(activeWeapon.name)) { Destroy(GameObject.Find("WeapObj").transform.FindChild(activeWeapon.name).gameObject); } } activeWeapon = new Item.ItemProp("", 0, false); }
public PlayerInfoSL(GameObject Prop) { Inventory.Clear(); PlayerInfo Pi = Prop.GetComponent<PlayerInfo>(); ActiveWeapon = Pi.ActiveWeapon; Name = Pi.Name; Gender = Pi.Gender; Hunger = Pi.Hunger; Health = Pi.Health; Happy = Pi.Happy; Speed = Pi.Speed; safeRadLevel = Pi.safeRadLevel; Age = Pi.Age; HungerTimer = Pi.HungerTimer - Time.timeSinceLevelLoad; HealthTimer = Pi.HealthTimer - Time.timeSinceLevelLoad; HappyTimer = Pi.HappyTimer - Time.timeSinceLevelLoad; secTimer = Pi.secTimer - Time.timeSinceLevelLoad; AgeTimer = Pi.AgeTimer - Time.timeSinceLevelLoad; mass = Pi.rigidbody.mass; camY = Prop.GetComponent<PlayerController>().CameraOffset.y; it = Pi.activeSuit; activeWeapon = Pi.activeWeapon; activeSuit = Pi.activeSuit; Inventory = Pi.Stacks; myRadLevel = Pi.myRadLevel; // Debug Debug.Log(Inventory.Count); Debug.Log(Inventory[0].MyItems.Count); // Debug }
public ItemSL(GameObject Prop) { ip = Prop.GetComponent<Item>().Ip; }
public float timer; //+3600; #endregion Fields #region Constructors //public int fPP; public Data(string name) { food = new Item.ItemProp(name, 0, true); }
void Awake() { Pr = GetComponent<Item>().Ip; startScale = transform.localScale; collider.enabled = false; }
public void DressSuit(Item.ItemProp it) { if (!showSuit) { Transform w = GameObject.Find("WeapObj").transform.FindChild(activeWeapon.name); if (w) w.parent = transform; Destroy(transform.FindChild("Hostage").gameObject); GameObject clone = (GameObject)Instantiate(suitPrefab.gameObject, transform.position, transform.rotation); clone.name = "Suit"; clone.transform.parent = transform; //clone.transform.position = new Vector3(transform.position.x,transform.position.y-0.2f,transform.position.z); tied to fix dres change hight bug activeSuit = it; it.active = true; showSuit = true; if (transform.FindChild(activeWeapon.name)) Invoke("WeapParent", 0.05f); } }
public void SetActiveWeapon(Item.ItemProp it) { GameObject clone = (GameObject)Instantiate(Resources.Load("Objects/" + it.name + "_model"), GameObject.Find("WeapObj").transform.position, GameObject.Find("WeapObj").transform.rotation); it.active = true; clone.name = it.name; clone.transform.parent = GameObject.Find("WeapObj").transform; //clone.transform.localPosition = weapOffset; activeWeapon = new Item.ItemProp(it);//it; clone.GetComponent<Item>().Ip = it; }
public void RemoveSuit() { if (showSuit) { Transform w = GameObject.Find("WeapObj").transform.FindChild(activeWeapon.name); if (w) w.parent = transform; Transform g = transform.FindChild("Suit"); if (g == null) return; Destroy(g.gameObject); showSuit = false; activeSuit.active = false; activeSuit = null; GameObject clone = (GameObject)Instantiate(Resources.Load("Objects/Hostage"), transform.position, transform.rotation); clone.name = "Hostage"; clone.transform.localScale = new Vector3(1, 1, 1); clone.transform.parent = transform; if (transform.FindChild(activeWeapon.name)) Invoke("WeapParent", 0.05f); } }
public void RemoveSuit() { if (showSuit) { Transform g = transform.FindChild("Suit"); if (g == null) return; Destroy(g.gameObject); showSuit = false; activeSuit.active = false; activeSuit = null; transform.FindChild("Suit").gameObject.SetActive(false); transform.FindChild("Hostage").gameObject.SetActive(true); } }