public override void Postspawn(EnemyAgent agent)
        {
            agent.RequireTagForDetection = RequireTagForDetection;
            agent.MovingCuller.m_disableAnimatorCullingWhenRenderingShadow = true;

            agent.MovingCuller.Culler.Renderers.Clear();
            agent.MovingCuller.Culler.hasShadowsEnabled = true;

            var comps = agent.GetComponentsInChildren <Renderer>(true);

            foreach (var comp in comps)
            {
                if (!IncludeEggSack && comp.gameObject.name.Contains("Egg"))
                {
                    LogVerbose(" - Ignored EggSack Object!");
                    comp.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.On;
                    comp.enabled           = true;
                    continue;
                }

                comp.castShadows       = true;
                comp.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.ShadowsOnly;
                comp.enabled           = true;

                var skinmeshrenderer = comp.TryCast <SkinnedMeshRenderer>();
                if (skinmeshrenderer != null)
                {
                    skinmeshrenderer.updateWhenOffscreen = true;
                }
            }
        }
示例#2
0
        public override void Postspawn(EnemyAgent agent)
        {
            var tentacleComps    = agent.GetComponentsInChildren <MovingEnemyTentacleBase>(true);
            var isTypeEnabled    = TentacleTypes.Length > 0;
            var isSettingEnabled = TentacleSettings.Length > 0;

            for (int i = 0; i < tentacleComps.Length; i++)
            {
                var tentacle = tentacleComps[i];

                if (isTypeEnabled)
                {
                    var tenType = TentacleTypes[i % TentacleTypes.Length];
                    tentacle.m_GPUCurvyType = tenType;
                    LogVerbose($" - Applied Tentacle Type!, index: {i} type: {tenType}");
                }

                if (isSettingEnabled)
                {
                    var setting = TentacleSettings[i % TentacleSettings.Length];
                    tentacle.m_easingIn           = setting.GetInEaseFunction();
                    tentacle.m_easingOut          = setting.GetOutEaseFunction();
                    tentacle.m_attackInDuration   = setting.InDuration.GetAbsValue(tentacle.m_attackInDuration);
                    tentacle.m_attackOutDuration  = setting.OutDuration.GetAbsValue(tentacle.m_attackOutDuration);
                    tentacle.m_attackHangDuration = setting.HangDuration.GetAbsValue(tentacle.m_attackHangDuration);
                    LogVerbose($" - Applied Tentacle Setting!, index: {i}");
                }
            }
        }