private void Start()
    {
        Animation component = base.GetComponent <Animation>();

        component["f02_angryFace_00"].layer = 2;
        component.Play("f02_angryFace_00");
        component["f02_angryFace_00"].weight = 0f;
        if (!this.Leader && GameObject.Find("DetectionCamera") != null)
        {
            this.DetectionMarker = UnityEngine.Object.Instantiate <GameObject>(this.Marker, GameObject.Find("DetectionPanel").transform.position, Quaternion.identity).GetComponent <DetectionMarkerScript>();
            this.DetectionMarker.transform.parent = GameObject.Find("DetectionPanel").transform;
            this.DetectionMarker.Target           = base.transform;
        }
    }
예제 #2
0
 private void Update()
 {
     if (this.UpdateNextFrame)
     {
         this.Student.Hips.localPosition = this.NextPosition;
         this.Student.Hips.localRotation = this.NextRotation;
         Physics.SyncTransforms();
         this.UpdateNextFrame = false;
     }
     if (!this.Dragged && !this.Carried && !this.Settled && !this.Yandere.PK && !this.Yandere.StudentManager.NoGravity)
     {
         this.SettleTimer += Time.deltaTime;
         if (this.SettleTimer > 5f)
         {
             this.Settled = true;
             for (int i = 0; i < this.AllRigidbodies.Length; i++)
             {
                 this.AllRigidbodies[i].isKinematic = true;
                 this.AllColliders[i].enabled       = false;
             }
         }
     }
     if (this.DetectionMarker != null)
     {
         if (this.DetectionMarker.Tex.color.a > 0.1f)
         {
             this.DetectionMarker.Tex.color = new Color(this.DetectionMarker.Tex.color.r, this.DetectionMarker.Tex.color.g, this.DetectionMarker.Tex.color.b, Mathf.MoveTowards(this.DetectionMarker.Tex.color.a, 0f, Time.deltaTime * 10f));
         }
         else
         {
             this.DetectionMarker.Tex.color = new Color(this.DetectionMarker.Tex.color.r, this.DetectionMarker.Tex.color.g, this.DetectionMarker.Tex.color.b, 0f);
             this.DetectionMarker           = null;
         }
     }
     if (!this.Dumped)
     {
         if (this.StopAnimation && this.Student.CharacterAnimation.isPlaying)
         {
             this.Student.CharacterAnimation.Stop();
         }
         if (this.BloodPoolSpawner != null && this.BloodPoolSpawner.gameObject.activeInHierarchy && !this.Cauterized)
         {
             if (this.Yandere.PickUp != null)
             {
                 if (this.Yandere.PickUp.Blowtorch)
                 {
                     if (!this.Cauterizable)
                     {
                         this.Prompt.Label[0].text = "     Cauterize";
                         this.Cauterizable         = true;
                     }
                 }
                 else if (this.Cauterizable)
                 {
                     this.Prompt.Label[0].text = "     Dismember";
                     this.Cauterizable         = false;
                 }
             }
             else if (this.Cauterizable)
             {
                 this.Prompt.Label[0].text = "     Dismember";
                 this.Cauterizable         = false;
             }
         }
         if (this.Prompt.Circle[0].fillAmount == 0f)
         {
             this.Prompt.Circle[0].fillAmount = 1f;
             if (!this.Yandere.Chased && this.Yandere.Chasers == 0)
             {
                 if (this.Cauterizable)
                 {
                     this.Prompt.Label[0].text     = "     Dismember";
                     this.BloodPoolSpawner.enabled = false;
                     this.Cauterizable             = false;
                     this.Cauterized = true;
                     this.Yandere.CharacterAnimation.CrossFade("f02_cauterize_00");
                     this.Yandere.Cauterizing = true;
                     this.Yandere.CanMove     = false;
                     this.Yandere.PickUp.GetComponent <BlowtorchScript>().enabled = true;
                     this.Yandere.PickUp.GetComponent <AudioSource>().Play();
                 }
                 else if (this.Yandere.StudentManager.OriginalUniforms + this.Yandere.StudentManager.NewUniforms > 1)
                 {
                     this.Yandere.CharacterAnimation.CrossFade("f02_dismember_00");
                     this.Yandere.transform.LookAt(base.transform);
                     this.Yandere.RPGCamera.transform.position    = this.Yandere.DismemberSpot.position;
                     this.Yandere.RPGCamera.transform.eulerAngles = this.Yandere.DismemberSpot.eulerAngles;
                     this.Yandere.EquippedWeapon.Dismember();
                     this.Yandere.RPGCamera.enabled = false;
                     this.Yandere.TargetStudent     = this.Student;
                     this.Yandere.Ragdoll           = base.gameObject;
                     this.Yandere.Dismembering      = true;
                     this.Yandere.CanMove           = false;
                 }
                 else if (!this.Yandere.ClothingWarning)
                 {
                     this.Yandere.NotificationManager.DisplayNotification(NotificationType.Clothing);
                     this.Yandere.StudentManager.TutorialWindow.ShowClothingMessage = true;
                     this.Yandere.ClothingWarning = true;
                 }
             }
         }
         if (this.Prompt.Circle[1].fillAmount == 0f)
         {
             this.Prompt.Circle[1].fillAmount = 1f;
             if (!this.Student.FireEmitters[1].isPlaying)
             {
                 if (!this.Dragged)
                 {
                     this.Yandere.EmptyHands();
                     this.Prompt.AcceptingInput[1] = false;
                     this.Prompt.Label[1].text     = "     Drop";
                     this.PickNearestLimb();
                     this.Yandere.RagdollDragger.connectedBody   = this.Rigidbodies[this.LimbID];
                     this.Yandere.RagdollDragger.connectedAnchor = this.LimbAnchor[this.LimbID];
                     this.Yandere.Dragging  = true;
                     this.Yandere.Running   = false;
                     this.Yandere.DragState = 0;
                     this.Yandere.Ragdoll   = base.gameObject;
                     this.Dragged           = true;
                     this.Yandere.StudentManager.UpdateStudents(0);
                     if (this.MurderSuicide)
                     {
                         this.Police.MurderSuicideScene = false;
                         this.MurderSuicide             = false;
                     }
                     if (this.Suicide)
                     {
                         this.Police.Suicide = false;
                         this.Suicide        = false;
                     }
                     for (int j = 0; j < this.Student.Ragdoll.AllRigidbodies.Length; j++)
                     {
                         this.Student.Ragdoll.AllRigidbodies[j].drag = 2f;
                     }
                     for (int k = 0; k < this.AllRigidbodies.Length; k++)
                     {
                         this.AllRigidbodies[k].isKinematic = false;
                         this.AllColliders[k].enabled       = true;
                         if (this.Yandere.StudentManager.NoGravity)
                         {
                             this.AllRigidbodies[k].useGravity = false;
                         }
                     }
                 }
                 else
                 {
                     this.StopDragging();
                 }
             }
         }
         if (this.Prompt.Circle[3].fillAmount == 0f)
         {
             this.Prompt.Circle[3].fillAmount = 1f;
             if (!this.Student.FireEmitters[1].isPlaying)
             {
                 this.Yandere.EmptyHands();
                 this.Prompt.Label[1].text = "     Drop";
                 this.Prompt.HideButton[1] = true;
                 this.Prompt.HideButton[3] = true;
                 this.Prompt.enabled       = false;
                 this.Prompt.Hide();
                 for (int l = 0; l < this.AllRigidbodies.Length; l++)
                 {
                     this.AllRigidbodies[l].isKinematic = true;
                     this.AllColliders[l].enabled       = false;
                 }
                 if (this.Male)
                 {
                     Rigidbody rigidbody = this.AllRigidbodies[0];
                     rigidbody.transform.parent.transform.localPosition = new Vector3(rigidbody.transform.parent.transform.localPosition.x, 0.2f, rigidbody.transform.parent.transform.localPosition.z);
                 }
                 this.Yandere.CharacterAnimation.Play("f02_carryLiftA_00");
                 this.Student.CharacterAnimation.enabled = true;
                 this.Student.CharacterAnimation.Play(this.LiftAnim);
                 this.BloodSpawnerCollider.enabled = false;
                 this.PelvisRoot.localEulerAngles  = new Vector3(this.PelvisRoot.localEulerAngles.x, 0f, this.PelvisRoot.localEulerAngles.z);
                 this.Prompt.MyCollider.enabled    = false;
                 this.PelvisRoot.localPosition     = new Vector3(this.PelvisRoot.localPosition.x, this.PelvisRoot.localPosition.y, 0f);
                 this.Yandere.Ragdoll        = base.gameObject;
                 this.Yandere.CurrentRagdoll = this;
                 this.Yandere.CanMove        = false;
                 this.Yandere.Lifting        = true;
                 this.StopAnimation          = false;
                 this.Carried   = true;
                 this.Falling   = false;
                 this.FallTimer = 0f;
             }
         }
         if (this.Yandere.Running && this.Yandere.CanMove && this.Dragged)
         {
             this.StopDragging();
         }
         if (Vector3.Distance(this.Yandere.transform.position, this.Prompt.transform.position) < 2f)
         {
             if (!this.Suicide && !this.AddingToCount)
             {
                 this.Yandere.NearestCorpseID = this.StudentID;
                 this.Yandere.NearBodies++;
                 this.AddingToCount = true;
             }
         }
         else if (this.AddingToCount)
         {
             this.Yandere.NearBodies--;
             this.AddingToCount = false;
         }
         if (!this.Prompt.AcceptingInput[1] && Input.GetButtonUp("B"))
         {
             this.Prompt.AcceptingInput[1] = true;
         }
         bool flag = false;
         if (this.Yandere.Armed && this.Yandere.EquippedWeapon.WeaponID == 7 && !this.Student.Nemesis)
         {
             flag = true;
         }
         if (!this.Cauterized && this.Yandere.PickUp != null && this.Yandere.PickUp.Blowtorch && this.BloodPoolSpawner.gameObject.activeInHierarchy)
         {
             flag = true;
         }
         this.Prompt.HideButton[0] = (this.Dragged || this.Carried || this.Tranquil || !flag);
     }
     else if (this.DumpType == RagdollDumpType.Incinerator)
     {
         if (this.DumpTimer == 0f && this.Yandere.Carrying)
         {
             this.Student.CharacterAnimation[this.DumpedAnim].time = 2.5f;
         }
         this.Student.CharacterAnimation.CrossFade(this.DumpedAnim);
         this.DumpTimer += Time.deltaTime;
         if (this.Student.CharacterAnimation[this.DumpedAnim].time >= this.Student.CharacterAnimation[this.DumpedAnim].length)
         {
             this.Incinerator.Corpses++;
             this.Incinerator.CorpseList[this.Incinerator.Corpses] = this.StudentID;
             this.Remove();
             base.enabled = false;
         }
     }
     else if (this.DumpType == RagdollDumpType.TranqCase)
     {
         if (this.DumpTimer == 0f && this.Yandere.Carrying)
         {
             this.Student.CharacterAnimation[this.DumpedAnim].time = 2.5f;
         }
         this.Student.CharacterAnimation.CrossFade(this.DumpedAnim);
         this.DumpTimer += Time.deltaTime;
         if (this.Student.CharacterAnimation[this.DumpedAnim].time >= this.Student.CharacterAnimation[this.DumpedAnim].length)
         {
             this.TranqCase.Open = false;
             if (this.AddingToCount)
             {
                 this.Yandere.NearBodies--;
             }
             base.enabled = false;
         }
     }
     else if (this.DumpType == RagdollDumpType.WoodChipper)
     {
         if (this.DumpTimer == 0f && this.Yandere.Carrying)
         {
             this.Student.CharacterAnimation[this.DumpedAnim].time = 2.5f;
         }
         this.Student.CharacterAnimation.CrossFade(this.DumpedAnim);
         this.DumpTimer += Time.deltaTime;
         if (this.Student.CharacterAnimation[this.DumpedAnim].time >= this.Student.CharacterAnimation[this.DumpedAnim].length)
         {
             this.WoodChipper.VictimID = this.StudentID;
             this.Remove();
             base.enabled = false;
         }
     }
     if (this.Hidden && this.HideCollider == null)
     {
         this.Police.HiddenCorpses--;
         this.Hidden = false;
     }
     if (this.Falling)
     {
         this.FallTimer += Time.deltaTime;
         if (this.FallTimer > 2f)
         {
             this.BloodSpawnerCollider.enabled = true;
             this.FallTimer = 0f;
             this.Falling   = false;
         }
     }
     if (this.Burning)
     {
         for (int m = 0; m < 3; m++)
         {
             Material material = this.MyRenderer.materials[m];
             material.color = Vector4.MoveTowards(material.color, new Vector4(0.1f, 0.1f, 0.1f, 1f), Time.deltaTime * 0.1f);
         }
         this.Student.Cosmetic.HairRenderer.material.color = Vector4.MoveTowards(this.Student.Cosmetic.HairRenderer.material.color, new Vector4(0.1f, 0.1f, 0.1f, 1f), Time.deltaTime * 0.1f);
         if (this.MyRenderer.materials[0].color == new Color(0.1f, 0.1f, 0.1f, 1f))
         {
             this.Burning = false;
             this.Burned  = true;
         }
     }
     if (this.Burned)
     {
         this.Sacrifice = (Vector3.Distance(this.Prompt.transform.position, this.Yandere.StudentManager.SacrificeSpot.position) < 1.5f);
     }
 }