示例#1
0
 // Token: 0x06001424 RID: 5156 RVA: 0x00056194 File Offset: 0x00054394
 private void OnJoinTeam(TeamIndex newTeamIndex)
 {
     if (TeamComponent.TeamIsValid(newTeamIndex))
     {
         TeamComponent.teamsList[(int)newTeamIndex].Add(this);
     }
     this.SetupIndicator();
     HurtBox[] array;
     if (!this.body)
     {
         array = null;
     }
     else
     {
         HurtBoxGroup hurtBoxGroup = this.body.hurtBoxGroup;
         array = ((hurtBoxGroup != null) ? hurtBoxGroup.hurtBoxes : null);
     }
     HurtBox[] array2 = array;
     if (array2 != null)
     {
         HurtBox[] array3 = array2;
         for (int i = 0; i < array3.Length; i++)
         {
             array3[i].teamIndex = newTeamIndex;
         }
     }
     this.oldTeamIndex = newTeamIndex;
 }
示例#2
0
        // Token: 0x06000D1A RID: 3354 RVA: 0x00040C04 File Offset: 0x0003EE04
        private void Awake()
        {
            this.childLocator = base.GetComponent <ChildLocator>();
            HurtBoxGroup component = base.GetComponent <HurtBoxGroup>();

            this.coreTransform = base.transform;
            if (component)
            {
                Transform transform;
                if (component == null)
                {
                    transform = null;
                }
                else
                {
                    HurtBox mainHurtBox = component.mainHurtBox;
                    transform = ((mainHurtBox != null) ? mainHurtBox.transform : null);
                }
                this.coreTransform = (transform ?? this.coreTransform);
                HurtBox[] hurtBoxes = component.hurtBoxes;
                if (hurtBoxes.Length != 0)
                {
                    this.hurtBoxInfos = new CharacterModel.HurtBoxInfo[hurtBoxes.Length];
                    for (int i = 0; i < hurtBoxes.Length; i++)
                    {
                        this.hurtBoxInfos[i] = new CharacterModel.HurtBoxInfo
                        {
                            transform       = hurtBoxes[i].transform,
                            estimatedRadius = Util.SphereVolumeToRadius(hurtBoxes[i].volume)
                        };
                    }
                }
            }
            this.propertyStorage = new MaterialPropertyBlock();
        }
        // Token: 0x06000CD8 RID: 3288 RVA: 0x00039A5C File Offset: 0x00037C5C
        public GameObject ResolveGameObject()
        {
            if (this.hurtBoxIndexPlusOne == 0)
            {
                return(this.rootObject);
            }
            GameObject gameObject = this.rootObject;

            HurtBox[] array;
            if (gameObject == null)
            {
                array = null;
            }
            else
            {
                ModelLocator component = gameObject.GetComponent <ModelLocator>();
                if (component == null)
                {
                    array = null;
                }
                else
                {
                    Transform modelTransform = component.modelTransform;
                    if (modelTransform == null)
                    {
                        array = null;
                    }
                    else
                    {
                        HurtBoxGroup component2 = modelTransform.GetComponent <HurtBoxGroup>();
                        array = ((component2 != null) ? component2.hurtBoxes : null);
                    }
                }
            }
            HurtBox[] array2 = array;
            if (array2 != null)
            {
                int num = (int)(this.hurtBoxIndexPlusOne - 1);
                if (num < array2.Length)
                {
                    return(array2[num].gameObject);
                }
            }
            return(null);
        }
        // Token: 0x06000AD4 RID: 2772 RVA: 0x00035740 File Offset: 0x00033940
        public GameObject ResolveHurtBoxReference()
        {
            if (this.modelChildIndex == -1)
            {
                return(this.rootObject);
            }
            GameObject gameObject = this.rootObject;

            if (gameObject == null)
            {
                return(null);
            }
            ModelLocator component = gameObject.GetComponent <ModelLocator>();

            if (component == null)
            {
                return(null);
            }
            Transform modelTransform = component.modelTransform;

            if (modelTransform == null)
            {
                return(null);
            }
            HurtBoxGroup component2 = modelTransform.GetComponent <HurtBoxGroup>();

            if (component2 == null)
            {
                return(null);
            }
            HurtBox hurtBox = component2.hurtBoxes.ElementAtOrDefault((int)this.modelChildIndex);

            if (hurtBox == null)
            {
                return(null);
            }
            return(hurtBox.gameObject);
        }