Ejemplo n.º 1
0
        // Token: 0x06000D24 RID: 3364 RVA: 0x00040FFC File Offset: 0x0003F1FC
        private void UpdateMaterials()
        {
            if (this.visibility == VisibilityLevel.Invisible)
            {
                for (int i = this.rendererInfos.Length - 1; i >= 0; i--)
                {
                    CharacterModel.RendererInfo rendererInfo = this.rendererInfos[i];
                    rendererInfo.renderer.shadowCastingMode = ShadowCastingMode.Off;
                    rendererInfo.renderer.enabled           = false;
                }
            }
            else
            {
                for (int j = this.rendererInfos.Length - 1; j >= 0; j--)
                {
                    CharacterModel.RendererInfo rendererInfo2 = this.rendererInfos[j];
                    rendererInfo2.renderer.shadowCastingMode = rendererInfo2.defaultShadowCastingMode;
                    rendererInfo2.renderer.enabled           = true;
                }
            }
            Color value = Color.black;

            if (this.body && this.body.healthComponent)
            {
                if (this.body.healthComponent.shield > 0f)
                {
                    value = CharacterModel.hitFlashShieldColor * Mathf.Clamp01(1f - this.body.healthComponent.timeSinceLastHit / 0.15f);
                }
                else
                {
                    value = CharacterModel.hitFlashBaseColor * Mathf.Clamp01(1f - this.body.healthComponent.timeSinceLastHit / 0.15f);
                }
            }
            for (int k = this.rendererInfos.Length - 1; k >= 0; k--)
            {
                Renderer renderer = this.rendererInfos[k].renderer;
                this.UpdateRendererMaterials(renderer, this.rendererInfos[k].defaultMaterial, this.rendererInfos[k].ignoreOverlays);
                renderer.GetPropertyBlock(this.propertyStorage);
                this.propertyStorage.SetColor("_FlashColor", value);
                this.propertyStorage.SetFloat("_Fade", this.fade);
                this.propertyStorage.SetFloat("_EliteIndex", (float)(this.myEliteIndex + 1));
                this.propertyStorage.SetFloat("_LimbPrimeMask", this.limbFlagSet.materialMaskValue);
                renderer.SetPropertyBlock(this.propertyStorage);
            }
            for (int l = 0; l < this.parentedPrefabDisplays.Count; l++)
            {
                ItemDisplay itemDisplay = this.parentedPrefabDisplays[l].itemDisplay;
                itemDisplay.SetVisibilityLevel(this.visibility);
                for (int m = 0; m < itemDisplay.rendererInfos.Length; m++)
                {
                    Renderer renderer2 = itemDisplay.rendererInfos[m].renderer;
                    renderer2.GetPropertyBlock(this.propertyStorage);
                    this.propertyStorage.SetColor("_FlashColor", value);
                    this.propertyStorage.SetFloat("_Fade", this.fade);
                    renderer2.SetPropertyBlock(this.propertyStorage);
                }
            }
        }
Ejemplo n.º 2
0
            // Token: 0x06000D3A RID: 3386 RVA: 0x00041E94 File Offset: 0x00040094
            public void Apply(CharacterModel characterModel, GameObject prefab, Transform parent, Vector3 localPosition, Quaternion localRotation, Vector3 localScale)
            {
                this.instance = UnityEngine.Object.Instantiate <GameObject>(prefab.gameObject, parent);
                this.instance.transform.localPosition = localPosition;
                this.instance.transform.localRotation = localRotation;
                this.instance.transform.localScale    = localScale;
                LimbMatcher component = this.instance.GetComponent <LimbMatcher>();

                if (component && characterModel.childLocator)
                {
                    component.SetChildLocator(characterModel.childLocator);
                }
                this.itemDisplay = this.instance.GetComponent <ItemDisplay>();
            }