示例#1
0
 public static void RefreshShadows()
 {
     if (ShadowController.IsPreviousRealTimeShadowEnable != GameLevelManager.IsRealTimeShadowOn())
     {
         XDict <long, EntityParent> allEntities = EntityWorld.Instance.AllEntities;
         using (List <EntityParent> .Enumerator enumerator = allEntities.Values.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 EntityParent current = enumerator.get_Current();
                 if (current != null & current.Actor)
                 {
                     if (ShadowController.IsPreviousRealTimeShadowEnable)
                     {
                         ShadowController.SetShadowModelRender(current.Actor.FixTransform, true);
                     }
                     else
                     {
                         ShadowProjector.ShowShadowProjector(current.Actor.FixTransform, true);
                     }
                     ShadowController.ShowShadow(current.ID, current.Actor.FixTransform, false, 0);
                 }
             }
         }
     }
     ShadowController.IsPreviousRealTimeShadowEnable = GameLevelManager.IsRealTimeShadowOn();
 }
示例#2
0
    private static void ShowShadow(long uuid, Transform actorTarget, ActorParent actorParent, bool bHideShadow, int modelId = 0)
    {
        if (GameLevelManager.IsRealTimeShadowOn())
        {
            ShadowController.SetShadowModelRender(actorTarget, bHideShadow);
        }
        else
        {
            float scale = 1f;
            if (modelId > 0)
            {
                AvatarModel avatarModel = DataReader <AvatarModel> .Get(modelId);

                if (avatarModel != null)
                {
                    scale = avatarModel.projectorScale;
                }
            }
            ShadowSlicePlaneMgr.ShowShadowSlicePlane(uuid, actorTarget, actorParent, bHideShadow, scale);
        }
    }