public override void InitializePrefab() { Logger.LogLineNumber(); base.InitializePrefab(); Logger.LogLineNumber(); if (this.m_class == null) { Logger.LogLineNumber(); throw new PrefabException(this, "Class missing"); } if (this.m_skinRenderer != null) { Logger.LogLineNumber(); Material sharedMaterial = this.m_skinRenderer.sharedMaterial; this.m_color0 = sharedMaterial.GetColor("_ColorV0"); this.m_color1 = sharedMaterial.GetColor("_ColorV1"); this.m_color2 = sharedMaterial.GetColor("_ColorV2"); this.m_color3 = sharedMaterial.GetColor("_ColorV3"); } else { this.m_color0 = Color.white; this.m_color1 = Color.white; this.m_color2 = Color.white; this.m_color3 = Color.white; } if (this.m_lodObject != null) { Logger.LogLineNumber(); MeshFilter component = this.m_lodObject.GetComponent <MeshFilter>(); this.m_lodMesh = component.sharedMesh; this.m_lodMaterial = this.m_lodObject.GetComponent <Renderer>().sharedMaterial; this.GenerateCombinedLodMesh(); } else { CODebugBase <LogChannel> .Warn(LogChannel.Core, "LOD missing: " + base.gameObject.name, base.gameObject); } this.RefreshLevelOfDetail(); if (this.m_zombieAI == null) { this.m_zombieAI = base.GetComponent <ZombieAI>(); this.m_zombieAI.m_info = this; this.m_zombieAI.InitializeAI(); } this.m_lodLocations = new Matrix4x4[16]; this.m_lodColors = new Color[16]; this.m_lodCount = 0; this.m_lodMin = new Vector3(100000f, 100000f, 100000f); this.m_lodMax = new Vector3(-100000f, -100000f, -100000f); }
public override void InitializePrefabInstance() { base.InitializePrefabInstance(); this.m_animator = base.gameObject.GetComponent<Animator>(); this.m_zombieAI = base.gameObject.GetComponent<ZombieAI>(); if (this.m_zombieAI != null) { this.m_zombieAI.m_info = this; } this.m_renderer = base.gameObject.GetComponent<SkinnedMeshRenderer>(); if (this.m_renderer == null) { for (int i = 0; i < base.gameObject.transform.childCount; i++) { Transform child = base.gameObject.transform.GetChild(i); this.m_renderer = child.GetComponent<Renderer>(); if (this.m_renderer != null) { break; } } } if (this.m_renderer != null) { this.m_skinRenderer = (this.m_renderer as SkinnedMeshRenderer); this.m_material = new Material(this.m_renderer.sharedMaterial); this.m_renderer.sharedMaterial = this.m_material; } }
public override void InitializePrefab() { Logger.LogLineNumber(); base.InitializePrefab(); Logger.LogLineNumber(); if (this.m_class == null) { Logger.LogLineNumber(); throw new PrefabException(this, "Class missing"); } if (this.m_skinRenderer != null) { Logger.LogLineNumber(); Material sharedMaterial = this.m_skinRenderer.sharedMaterial; this.m_color0 = sharedMaterial.GetColor("_ColorV0"); this.m_color1 = sharedMaterial.GetColor("_ColorV1"); this.m_color2 = sharedMaterial.GetColor("_ColorV2"); this.m_color3 = sharedMaterial.GetColor("_ColorV3"); } else { this.m_color0 = Color.white; this.m_color1 = Color.white; this.m_color2 = Color.white; this.m_color3 = Color.white; } if (this.m_lodObject != null) { Logger.LogLineNumber(); MeshFilter component = this.m_lodObject.GetComponent<MeshFilter>(); this.m_lodMesh = component.sharedMesh; this.m_lodMaterial = this.m_lodObject.GetComponent<Renderer>().sharedMaterial; this.GenerateCombinedLodMesh(); } else { CODebugBase<LogChannel>.Warn(LogChannel.Core, "LOD missing: " + base.gameObject.name, base.gameObject); } this.RefreshLevelOfDetail(); if (this.m_zombieAI == null) { this.m_zombieAI = base.GetComponent<ZombieAI>(); this.m_zombieAI.m_info = this; this.m_zombieAI.InitializeAI(); } this.m_lodLocations = new Matrix4x4[16]; this.m_lodColors = new Color[16]; this.m_lodCount = 0; this.m_lodMin = new Vector3(100000f, 100000f, 100000f); this.m_lodMax = new Vector3(-100000f, -100000f, -100000f); }