// Token: 0x060000C8 RID: 200 RVA: 0x0000E114 File Offset: 0x0000C514 private void OnTriggerEnter(Collider other) { if (other.transform.parent == null) { PickUpScript component = other.gameObject.GetComponent <PickUpScript>(); if (component != null) { BodyPartScript bodyPart = component.BodyPart; if (bodyPart.Sacrifice && (bodyPart.Type == 3 || bodyPart.Type == 4)) { bool flag = true; for (int i = 1; i < 11; i++) { if (this.ArmArray[i] == other.gameObject) { flag = false; } } if (flag) { this.Arms++; if (this.Arms < this.ArmArray.Length) { this.ArmArray[this.Arms] = other.gameObject; } } } } } }
void Start() { script = this; rb = GetComponent <Rigidbody2D>(); target = GameObject.FindGameObjectWithTag("Player"); }
void OnTriggerEnter2D(Collider2D myCol) { if (myCol.gameObject.tag == "PickUp") { PickUpScript pickUp = myCol.gameObject.GetComponent <PickUpScript>(); string pickUpName = pickUp.ReturnPickUpState(); pickUp.PickedUpDestroy(); GameController.instance.ReturnBackPack().SetIcon(pickUpName, ADD_ONE); } }
void Start() { pickup = gameObject.GetComponent <PickUpScript>(); score = gameObject.GetComponent <Scores>(); spawn = gameObject.GetComponent <EnemySpawner>(); scorePlus = gameObject.GetComponent <QuestionScript> (); Vector3 randomDirection = new Vector3(Random.Range(0, 0), Random.Range(-359, 359), Random.Range(0, 0)); //transform.Rotate(randomDirection); timing = 0; }
// Token: 0x06000A1E RID: 2590 RVA: 0x00051B0C File Offset: 0x0004FD0C private void OnTriggerEnter(Collider other) { if (other.transform.parent == this.LimbParent) { PickUpScript component = other.gameObject.GetComponent <PickUpScript>(); if (component != null) { BodyPartScript bodyPart = component.BodyPart; if (bodyPart.Sacrifice && (bodyPart.Type == 3 || bodyPart.Type == 4)) { bool flag = true; for (int i = 1; i < 11; i++) { if (this.ArmArray[i] == other.gameObject) { flag = false; } } if (flag) { this.Arms++; if (this.Arms < this.ArmArray.Length) { this.ArmArray[this.Arms] = other.gameObject; } } } } } if (other.transform.parent != null && other.transform.parent.parent != null && other.transform.parent.parent.parent != null) { StudentScript component2 = other.transform.parent.parent.parent.gameObject.GetComponent <StudentScript>(); if (component2 != null && component2.Ragdoll.Sacrifice && component2.Armband.activeInHierarchy) { bool flag2 = true; for (int j = 1; j < 11; j++) { if (this.BodyArray[j] == other.gameObject) { flag2 = false; } } if (flag2) { this.Bodies++; if (this.Bodies < this.BodyArray.Length) { this.BodyArray[this.Bodies] = other.gameObject; } } } } }
public void Heal(PickUpScript pickup) { if (CurrentHealth == MaxHealth) { //Debug.Log("FullHealth"); } else { CurrentHealth = MaxHealth; } pickup.GetPickedUp(gameObject); }
private void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "PickUpPoint") { GameObject target = other.gameObject; PickUpScript pus = target.GetComponent <PickUpScript>(); if (pus != null) { playerAudioSource.Play(); Instantiate(pickParticles, target.transform.position, Quaternion.identity); if (tailOut.activeInHierarchy) { tailOut.SetActive(false); tailIn.SetActive(true); gameObject.transform.position = newCapsulePos.position; } GameObject toSpawn = null; switch (pus.GetRoot().tag) { case "Conch": { toSpawn = conch; break; } case "Cup": { toSpawn = cup; break; } case "Can": { toSpawn = can; break; } } Destroy(pus.GetRoot()); GameObject lastShell = rbm.GetLastConch(); Transform conchAnchor; if (lastShell != null) { conchAnchor = lastShell.GetComponent <ConchScript>().GetAnchor().transform; } else { conchAnchor = initialAnchor.transform; } GameObject addedConch = Instantiate(toSpawn, conchAnchor.position, conchAnchor.rotation); addedConch.transform.parent = conchAnchor; rbm.AddConch(addedConch); } } }
public void UpdateThrowingObject(bool _object, PickUpScript _object_script) { holding_throwable = _object; if (holding_throwable) { throwable_object = _object_script; } else { throwable_object = null; } }
// Token: 0x060000C9 RID: 201 RVA: 0x0000E1E4 File Offset: 0x0000C5E4 private void OnTriggerExit(Collider other) { PickUpScript component = other.gameObject.GetComponent <PickUpScript>(); if (component != null && component.BodyPart) { BodyPartScript component2 = other.gameObject.GetComponent <BodyPartScript>(); if (component2.Sacrifice && (other.gameObject.name == "FemaleRightArm(Clone)" || other.gameObject.name == "FemaleLeftArm(Clone)" || other.gameObject.name == "MaleRightArm(Clone)" || other.gameObject.name == "MaleLeftArm(Clone)" || other.gameObject.name == "SacrificialArm(Clone)")) { this.Arms--; } } }
public void SpawnTreasure() { if (Random.Range(0, 100) <= dropRate) { GameObject spawnedObject = pool.GetPooledObject(); pickUp = spawnedObject.GetComponent <PickUpScript>(); pickUp.pool = pool; spawnedObject.transform.position = transform.position; spawnedObject.transform.rotation = transform.rotation; spawnedObject.transform.parent = null; spawnedObject.SetActive(true); } }
// Token: 0x06000A1F RID: 2591 RVA: 0x00051CC0 File Offset: 0x0004FEC0 private void OnTriggerExit(Collider other) { PickUpScript component = other.gameObject.GetComponent <PickUpScript>(); if (component != null && component.BodyPart && other.gameObject.GetComponent <BodyPartScript>().Sacrifice&& (other.gameObject.name == "FemaleRightArm(Clone)" || other.gameObject.name == "FemaleLeftArm(Clone)" || other.gameObject.name == "MaleRightArm(Clone)" || other.gameObject.name == "MaleLeftArm(Clone)" || other.gameObject.name == "SacrificialArm(Clone)")) { this.Arms--; Debug.Log("Decrement arm count again?"); } if (other.transform.parent != null && other.transform.parent.parent != null && other.transform.parent.parent.parent != null) { StudentScript component2 = other.transform.parent.parent.parent.gameObject.GetComponent <StudentScript>(); if (component2 != null && component2.Ragdoll.Sacrifice && component2.Armband.activeInHierarchy) { this.Bodies--; } } }
void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player") { PickUpScript.IncreaseCount(); //other.gameObject.SetActive (false); //collider.attachedRigidbody.SetActice(false); AudioSource.PlayClipAtPoint(coin_collect_audio, transform.position); Destroy(this.gameObject); //gameObject.SetActive(false); //Instantiate(g1,new Vector3(transform.position.x,transform.position.y,transform.position.z+4.0f),transform.rotation); //gameObject.SetActive (false); //Destroy (gameObject); } //Destroy (other.gameObject); }
void Start() { GameObject ui = GameObject.FindGameObjectWithTag(Tags.UI_CONTROLLER); if (ui != null) { _talkScript = ui.GetComponent <TalkScript> (); } GameObject joysick = GameObject.FindGameObjectWithTag(Tags.JOYSTICK_CONTROLLER); if (joysick != null) { _btnText = joysick.GetComponent <InteractButtonText> (); _joystick = joysick.GetComponent <Joystick> (); } _pickup = gameObject.GetComponent <PickUpScript> (); }
// Start is called before the first frame update void Start() { IS = FindObjectOfType <InputSystem>(); pickup = FindObjectOfType <PickUpScript>(); }
private void Update() { if (this.Check) { if (this.Yandere.PickUp != null) { if (this.Yandere.PickUp.Clothing && this.Yandere.PickUp.GetComponent <FoldedUniformScript>().Clean&& this.Yandere.PickUp.GetComponent <FoldedUniformScript>().Type == 1 && this.Yandere.PickUp.gameObject.GetComponent <FoldedUniformScript>().Type == 1) { this.Prompt.enabled = true; } } else { this.Prompt.Hide(); this.Prompt.enabled = false; } } if (this.Prompt.Circle[0].fillAmount == 0f) { this.Prompt.Circle[0].fillAmount = 1f; if (!this.Yandere.Chased && this.Yandere.Chasers == 0) { this.Yandere.Character.GetComponent <Animation>().CrossFade("f02_sewing_00"); this.Yandere.MyController.radius = 0.1f; this.Yandere.CanMove = false; this.Chair.enabled = false; this.Sewing = true; base.GetComponent <AudioSource>().Play(); this.Uniform = this.Yandere.PickUp; this.Yandere.EmptyHands(); this.Uniform.transform.parent = this.Yandere.RightHand; this.Uniform.transform.localPosition = new Vector3(0f, 0f, 0.09f); this.Uniform.transform.localEulerAngles = new Vector3(0f, 0f, 0f); this.Uniform.MyRigidbody.useGravity = false; this.Uniform.MyCollider.enabled = false; } } if (this.Sewing) { this.Timer += Time.deltaTime; if (this.Timer < 5f) { this.targetRotation = Quaternion.LookRotation(base.transform.parent.transform.parent.position - this.Yandere.transform.position); this.Yandere.transform.rotation = Quaternion.Slerp(this.Yandere.transform.rotation, this.targetRotation, Time.deltaTime * 10f); this.Yandere.MoveTowardsTarget(this.Chair.transform.position); return; } if (!this.MoveAway) { this.Yandere.Character.GetComponent <Animation>().CrossFade(this.Yandere.IdleAnim); this.Yandere.Inventory.ModifiedUniform = true; this.StudentManager.Students[30].TaskPhase = 5; TaskGlobals.SetTaskStatus(30, 2); UnityEngine.Object.Destroy(this.Uniform.gameObject); this.MoveAway = true; this.Check = false; return; } this.Yandere.MoveTowardsTarget(this.Chair.gameObject.transform.position + new Vector3(-0.5f, 0f, 0f)); if (this.Timer > 6f) { this.Yandere.MyController.radius = 0.2f; this.Yandere.CanMove = true; this.Chair.enabled = true; base.enabled = false; this.Sewing = false; this.Prompt.Hide(); this.Prompt.enabled = false; } } }
private void Update() { if (this.Prompt.Circle[0].fillAmount == 0f) { this.Prompt.Circle[0].fillAmount = 1f; this.Open = !this.Open; this.UpdatePrompts(); } if (this.Prompt.Circle[1].fillAmount == 0f) { this.Prompt.Circle[1].fillAmount = 1f; if (this.Prompt.Yandere.Armed) { this.Weapon = this.Prompt.Yandere.EquippedWeapon; this.Prompt.Yandere.EmptyHands(); this.Weapon.transform.parent = this.WeaponSpot; this.Weapon.transform.localPosition = Vector3.zero; this.Weapon.transform.localEulerAngles = Vector3.zero; this.Weapon.gameObject.GetComponent <Rigidbody>().useGravity = false; this.Weapon.MyCollider.isTrigger = true; this.Weapon.Prompt.Hide(); this.Weapon.Prompt.enabled = false; } else { this.BodyPart = this.Prompt.Yandere.PickUp; this.Prompt.Yandere.EmptyHands(); this.BodyPart.transform.parent = this.BodyPartPositions[this.BodyPart.GetComponent <BodyPartScript>().Type]; this.BodyPart.transform.localPosition = Vector3.zero; this.BodyPart.transform.localEulerAngles = Vector3.zero; this.BodyPart.gameObject.GetComponent <Rigidbody>().useGravity = false; this.BodyPart.MyCollider.isTrigger = true; this.BodyParts[this.BodyPart.GetComponent <BodyPartScript>().Type] = this.BodyPart; } this.Contents++; this.UpdatePrompts(); } if (this.Prompt.Circle[3].fillAmount == 0f) { this.Prompt.Circle[3].fillAmount = 1f; if (!this.Open) { base.transform.parent = this.Prompt.Yandere.Backpack; base.transform.localPosition = Vector3.zero; base.transform.localEulerAngles = Vector3.zero; this.Prompt.Yandere.Container = this; this.Prompt.Yandere.WeaponMenu.UpdateSprites(); this.Prompt.Yandere.ObstacleDetector.gameObject.SetActive(true); this.Prompt.MyCollider.enabled = false; this.Prompt.Hide(); this.Prompt.enabled = false; Rigidbody component = base.GetComponent <Rigidbody>(); component.isKinematic = true; component.useGravity = false; } else { if (this.Weapon != null) { this.Weapon.Prompt.Circle[3].fillAmount = -1f; this.Weapon.Prompt.enabled = true; this.Weapon = null; } else { this.BodyPart = null; this.ID = 1; while (this.BodyPart == null) { this.BodyPart = this.BodyParts[this.ID]; this.BodyParts[this.ID] = null; this.ID++; } this.BodyPart.Prompt.Circle[3].fillAmount = -1f; } this.Contents--; this.UpdatePrompts(); } } this.Lid.localEulerAngles = new Vector3(this.Lid.localEulerAngles.x, this.Lid.localEulerAngles.y, Mathf.Lerp(this.Lid.localEulerAngles.z, this.Open ? 90f : 0f, Time.deltaTime * 10f)); if (this.Weapon != null) { this.Weapon.transform.localPosition = Vector3.zero; this.Weapon.transform.localEulerAngles = Vector3.zero; } this.ID = 1; while (this.ID < this.BodyParts.Length) { if (this.BodyParts[this.ID] != null) { this.BodyParts[this.ID].transform.localPosition = Vector3.zero; this.BodyParts[this.ID].transform.localEulerAngles = Vector3.zero; } this.ID++; } }
void Start() { pickup = gameObject.GetComponent<PickUpScript>(); score = gameObject.GetComponent<Scores>(); spawn = gameObject.GetComponent<EnemySpawner>(); scorePlus = gameObject.GetComponent<QuestionScript> (); Vector3 randomDirection = new Vector3(Random.Range(0, 0),Random.Range(-359, 359),Random.Range(0, 0)); //transform.Rotate(randomDirection); timing = 0; }
void Awake() { script = gameObject.GetComponent<PickUpScript>(); spawn = gameObject.GetComponent<EnemySpawner>(); scriptScore = gameObject.GetComponent<Scores>(); }
public override void pickedUp(GameObject p, PickUpScript pS) { base.pickedUp(p, pS); ammo = pS.Value; }
private void Update() { if (this.Yandere.PickUp != null) { if (this.Yandere.PickUp.Bucket != null) { if (!this.Yandere.PickUp.Bucket.Full) { if (this.Bucket == null) { this.BucketPrompt.HideButton[0] = false; if (this.BucketPrompt.Circle[0].fillAmount == 0f) { this.Bucket = this.Yandere.PickUp; this.Yandere.EmptyHands(); this.Bucket.transform.eulerAngles = this.BucketPoint.eulerAngles; this.Bucket.transform.position = this.BucketPoint.position; this.Bucket.GetComponent <Rigidbody>().useGravity = false; this.Bucket.MyCollider.enabled = false; } } else { this.BucketPrompt.HideButton[0] = true; } } else { this.BucketPrompt.HideButton[0] = true; } } else { this.BucketPrompt.HideButton[0] = true; } } else { this.BucketPrompt.HideButton[0] = true; } AudioSource component = base.GetComponent <AudioSource>(); if (!this.Open) { this.Rotation = Mathf.MoveTowards(this.Rotation, 0f, Time.deltaTime * 360f); if (this.Rotation > -36f) { if (this.Rotation < 0f) { component.clip = this.CloseAudio; component.Play(); } this.Rotation = 0f; } this.Lid.transform.localEulerAngles = new Vector3(this.Rotation, this.Lid.transform.localEulerAngles.y, this.Lid.transform.localEulerAngles.z); } else { if (this.Lid.transform.localEulerAngles.x == 0f) { component.clip = this.OpenAudio; component.Play(); } this.Rotation = Mathf.MoveTowards(this.Rotation, -90f, Time.deltaTime * 360f); this.Lid.transform.localEulerAngles = new Vector3(this.Rotation, this.Lid.transform.localEulerAngles.y, this.Lid.transform.localEulerAngles.z); } if (!this.BloodSpray.isPlaying) { if (!this.Occupied) { if (this.Yandere.Ragdoll == null) { this.Prompt.HideButton[3] = true; } else { this.Prompt.HideButton[3] = false; } } else if (this.Bucket == null) { this.Prompt.HideButton[0] = true; } else if (this.Bucket.Bucket.Full) { this.Prompt.HideButton[0] = true; } else { this.Prompt.HideButton[0] = false; } } if (this.Prompt.Circle[3].fillAmount == 0f) { Time.timeScale = 1f; if (this.Yandere.Ragdoll != null) { if (!this.Yandere.Carrying) { this.Yandere.Character.GetComponent <Animation>().CrossFade("f02_dragIdle_00"); } else { this.Yandere.Character.GetComponent <Animation>().CrossFade("f02_carryIdleA_00"); } this.Yandere.YandereVision = false; this.Yandere.Chipping = true; this.Yandere.CanMove = false; this.Victims++; this.VictimList[this.Victims] = this.Yandere.Ragdoll.GetComponent <RagdollScript>().StudentID; this.Open = true; } } if (this.Prompt.Circle[0].fillAmount == 0f) { component.clip = this.ShredAudio; component.Play(); this.Prompt.HideButton[3] = false; this.Prompt.HideButton[0] = true; this.Prompt.Hide(); this.Prompt.enabled = false; this.Yandere.Police.Corpses--; if (this.Yandere.Police.SuicideScene && this.Yandere.Police.Corpses == 1) { this.Yandere.Police.MurderScene = false; } if (this.Yandere.Police.Corpses == 0) { this.Yandere.Police.MurderScene = false; } if (this.Yandere.StudentManager.Students[this.VictimID].Drowned) { this.Yandere.Police.DrownVictims--; } this.Shredding = true; this.Yandere.StudentManager.Students[this.VictimID].Ragdoll.Disposed = true; } if (this.Shredding) { if (this.Bucket != null) { this.Bucket.Bucket.UpdateAppearance = true; } this.Timer += Time.deltaTime; if (this.Timer >= 10f) { this.Prompt.enabled = true; this.Shredding = false; this.Occupied = false; this.Timer = 0f; return; } if (this.Timer >= 9f) { if (this.Bucket != null) { this.Bucket.MyCollider.enabled = true; this.Bucket.Bucket.FillSpeed = 1f; this.Bucket = null; this.BloodSpray.Stop(); return; } } else if (this.Timer >= 0.33333f && !this.Bucket.Bucket.Full) { this.BloodSpray.GetComponent <AudioSource>().Play(); this.BloodSpray.Play(); this.Bucket.Bucket.Bloodiness = 100f; this.Bucket.Bucket.FillSpeed = 0.05f; this.Bucket.Bucket.Full = true; } } }
void weaponPickUp() { // Dropping Previous weapon of that type if we have one if (pStats.meleWeaponSlot != null && weaponPrefab.GetComponent <MeleWeapon>()) { GameObject newDrop = Instantiate(pStats.meleWeaponSlot.GetComponent <MeleWeapon>().pickUp, transform.position, transform.rotation); } else if ((pStats.rangedWeaponSlot != null && weaponPrefab.GetComponent <RangedWeapon>())) { GameObject newDrop = Instantiate(pStats.rangedWeaponSlot.GetComponent <RangedWeapon>().pickUp, transform.position, transform.rotation); PickUpScript pScript = newDrop.GetComponent <PickUpScript>(); pScript.Value = pStats.rangedWeaponSlot.GetComponent <RangedWeapon>().ammo; } if (weaponPrefab.GetComponent <MeleWeapon>()) { if (pStats.selectedWeapon.GetComponent <MeleWeapon>()) { Destroy(pStats.meleWeaponSlot); GameObject weap = Instantiate(weaponPrefab, pStats.equippedWeaponPos); weap.transform.position = pStats.equippedWeaponPos.position; MeleWeapon meleWeaponScript = weap.GetComponent <MeleWeapon>(); pStats.meleWeaponSlot = weap; pStats.selectedWeapon = pStats.meleWeaponSlot; meleWeaponScript.pickedUp(player, this); } else { Destroy(pStats.meleWeaponSlot); GameObject weap = Instantiate(weaponPrefab, pStats.unequippedMeleWeaponPos); weap.transform.position = pStats.unequippedMeleWeaponPos.position; MeleWeapon meleWeaponScript = weap.GetComponent <MeleWeapon>(); meleWeaponScript.pickedUp(player, this); pStats.meleWeaponSlot = weap; } } else { if (pStats.selectedWeapon.GetComponent <RangedWeapon>()) { Destroy(pStats.rangedWeaponSlot); GameObject weap = Instantiate(weaponPrefab, pStats.equippedWeaponPos); weap.transform.position = pStats.equippedWeaponPos.position; RangedWeapon rangedWeaponScript = weap.GetComponent <RangedWeapon>(); rangedWeaponScript.pickedUp(player, this); rangedWeaponScript.ammo = Value; pStats.rangedWeaponSlot = weap; pStats.selectedWeapon = pStats.rangedWeaponSlot; } else { Destroy(pStats.rangedWeaponSlot); GameObject weap = Instantiate(weaponPrefab, pStats.unequippedRangedWeaponPos); weap.transform.position = pStats.unequippedRangedWeaponPos.position; RangedWeapon rangedWeaponScript = weap.GetComponent <RangedWeapon>(); rangedWeaponScript.pickedUp(player, this); rangedWeaponScript.ammo = Value; pStats.rangedWeaponSlot = weap; } } Destroy(gameObject); }
void Start() { countText = this.guiText; PickUpScript.SetCountText(); }
public static void IncreaseCount() { count++; PickUpScript.SetCountText(); }
public virtual void pickedUp(GameObject p, PickUpScript pS) { player = p; pCtrl = player.GetComponent <PlayerControl>(); pStats = player.GetComponent <Stats>(); }
void Awake() { script = gameObject.GetComponent <PickUpScript>(); spawn = gameObject.GetComponent <EnemySpawner>(); scriptScore = gameObject.GetComponent <Scores>(); }