Ejemplo n.º 1
0
        public static GeometryProjector GenerateProjector(ProjectorConfig config)
        {
            GeometryProjector geometryProjector = new GeometryProjector(config);

            if (config.FrameSprite != null)
            {
                geometryProjector.Renderer = new SpriteProjectorRenderer(config.FrameSprite, geometryProjector.ProjectorIndex);
            }
            else
            {
                geometryProjector.Renderer = new SurfaceProjectorRenderer(geometryProjector.ProjectorIndex);
            }
            if (config.Metered)
            {
                geometryProjector.Renderer = new ProjectorMeterDecorator(geometryProjector.Renderer);
            }
            geometryProjector.Renderer = new ProjectorOutlineDecorator(geometryProjector.Renderer);
            if (!string.IsNullOrEmpty(config.TrackerName))
            {
                geometryProjector.Renderer = new ProjectorTurretDecorator(geometryProjector.Renderer);
            }
            if (!string.IsNullOrEmpty(config.buildingEquipmentShaderName) && ProjectorUtils.CanBeAnimated(config))
            {
                geometryProjector.Renderer = new ProjectorEquipmentBuildingDecorator(geometryProjector.Renderer);
            }
            else
            {
                geometryProjector.Renderer = new ProjectorShaderSwapDecorator(geometryProjector.Renderer);
            }
            geometryProjector.Renderer = new ProjectorAnimationDecorator(geometryProjector.Renderer);
            bool flag  = config.AnimPreference == AnimationPreference.NoAnimation;
            bool flag2 = config.AnimPreference == AnimationPreference.AnimationPreferred && HardwareProfile.IsLowEndDevice();

            if (!flag && !flag2 && config.IconRotationSpeed > 0f)
            {
                geometryProjector.Renderer = new ProjectorRotationDecorator(geometryProjector.Renderer);
            }
            ProjectorAssetProcessor arg_16C_0 = geometryProjector.AssetProcessor;

            if (ProjectorUtils.< > f__mg$cache0 == null)
            {
                ProjectorUtils.< > f__mg$cache0 = new Action <GeometryProjector>(ProjectorUtils.OnDefaultAssetSuccess);
            }
            Action <GeometryProjector> arg_16C_1 = ProjectorUtils.< > f__mg$cache0;

            if (ProjectorUtils.< > f__mg$cache1 == null)
            {
                ProjectorUtils.< > f__mg$cache1 = new Action <GeometryProjector>(ProjectorUtils.OnDefaultAssetFailure);
            }
            arg_16C_0.LoadAllAssets(arg_16C_1, ProjectorUtils.< > f__mg$cache1);
            return(geometryProjector);
        }
Ejemplo n.º 2
0
 public unsafe static long $Invoke0(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ProjectorUtils.CanBeAnimated((ProjectorConfig)GCHandledObjects.GCHandleToObject(*args))));
 }