Ejemplo n.º 1
0
 // Token: 0x06000407 RID: 1031 RVA: 0x000176B8 File Offset: 0x000158B8
 private GameObject SpawnRagdoll()
 {
     this.spawnedRagdoll = UnityEngine.Object.Instantiate <GameObject>(this.ragdollPrefab, base.transform.position, base.transform.rotation);
     if (this.spawnSpecificSkins.Count > 0)
     {
         RagdollStyleManager.AssignSmartRagdollSkin(this.spawnedRagdoll.transform, this.spawnSpecificSkins[UnityEngine.Random.Range(0, this.spawnSpecificSkins.Count)]);
     }
     this.ApplyRagdollSettings(this.spawnedRagdoll);
     this.spawnedRagdoll.SetActive(false);
     return(this.spawnedRagdoll);
 }
Ejemplo n.º 2
0
    // Token: 0x06000164 RID: 356 RVA: 0x0000D9D4 File Offset: 0x0000BBD4
    public static void AssignSmartRagdollSkin(Transform ragdoll, RagdollStylePack.SkinType skinType)
    {
        RagdollStyleManager smartRagdollStyleProperties = RagdollStyleManager.GetSmartRagdollStyleProperties(ragdoll);

        if (smartRagdollStyleProperties == null)
        {
            return;
        }
        smartRagdollStyleProperties.assignRandomSkin = false;
        smartRagdollStyleProperties.skin             = skinType;
        smartRagdollStyleProperties.StyleUpdate();
    }
Ejemplo n.º 3
0
 // Token: 0x060003FD RID: 1021 RVA: 0x000175F8 File Offset: 0x000157F8
 private void LogEnteredRagdoll(Transform ragdoll)
 {
     this.ragdollSkin = RagdollStyleManager.GetSmartRagdollSkinType(ragdoll);
     if (this.OnAcceptableRagdollEnter != null)
     {
         this.OnAcceptableRagdollEnter(this.LogRagdoll(this.ragdollSkin, this.acceptableRagdolls));
     }
     if (this.OnUnacceptableRagdollEnter != null)
     {
         this.OnUnacceptableRagdollEnter(this.LogRagdoll(this.ragdollSkin, this.UnacceptableRagdolls));
     }
 }
Ejemplo n.º 4
0
 // Token: 0x06000408 RID: 1032 RVA: 0x00017744 File Offset: 0x00015944
 private void ApplyRagdollSettings(GameObject ragdoll)
 {
     if (this.spawnSpecificSkins.Count > 0)
     {
         RagdollStyleManager.AssignSmartRagdollSkin(ragdoll.transform, this.spawnSpecificSkins[UnityEngine.Random.Range(0, this.spawnSpecificSkins.Count)]);
     }
     this.antiTouchObject   = ragdoll.GetComponentInChildren <AntiTouchObject>();
     this.ragdollController = ragdoll.GetComponentInChildren <SmartRagdollController>();
     this.agentController   = this.ragdollController.agentController;
     if (this.antiTouchObject != null)
     {
         this.antiTouchObject.badForPlayer = this.RagdollIsAntiTouchBasedOnSkin(RagdollStyleManager.GetSmartRagdollSkinType(ragdoll.transform));
     }
     if (this.ragdollController != null)
     {
         this.ragdollController.enableSuicide    = this.suicide;
         this.ragdollController.suicideTimeFrame = this.suicideTimeFrame;
         this.ragdollController.doOnRagdollMode  = SmartRagdollController.OnRagdollMode.Hide;
         if (this.agentController != null)
         {
             this.agentController.speed = this.ragdollRunSpeed;
             if (this.targetIsPlayer)
             {
                 this.ragdollController.logic = SmartRagdollController.Logic.Attack;
                 return;
             }
             if (this.targets.Count > 0)
             {
                 this.ragdollController.useLogicConditions = false;
                 this.agentController.target     = this.targets[UnityEngine.Random.Range(0, this.targets.Count)];
                 this.agentController.moveMethod = AgentController.MoveMethod.MoveToPosition;
                 return;
             }
             this.ragdollController.useLogicConditions = true;
             this.ragdollController.logic = SmartRagdollController.Logic.Explore;
         }
     }
 }
Ejemplo n.º 5
0
 // Token: 0x06000163 RID: 355 RVA: 0x0000343B File Offset: 0x0000163B
 public static RagdollStylePack.SkinType GetSmartRagdollSkinType(Transform ragdoll)
 {
     return(RagdollStyleManager.GetSmartRagdollStyleProperties(ragdoll).skin);
 }