Exemplo n.º 1
0
        public static ProjectorConfig GenerateEquipmentConfig(EquipmentVO equipmentVO, Action <RenderTexture, ProjectorConfig> callback, float width, float height)
        {
            IGeometryVO     vo = ProjectorUtils.DetermineVOForEquipment(equipmentVO);
            ProjectorConfig projectorConfig = ProjectorUtils.GenerateGeometryConfig(vo, callback, width, height);

            projectorConfig.buildingEquipmentShaderName = ProjectorUtils.GetEquipmentBuildingShaderName(equipmentVO);
            return(projectorConfig);
        }
Exemplo n.º 2
0
        public static ProjectorConfig GenerateEquipmentConfig(EquipmentVO equipmentVO, UXSprite frameSprite, bool closeup)
        {
            IGeometryVO     vo = ProjectorUtils.DetermineVOForEquipment(equipmentVO);
            ProjectorConfig projectorConfig = ProjectorUtils.GenerateGeometryConfig(vo, frameSprite, closeup);

            projectorConfig.buildingEquipmentShaderName = ProjectorUtils.GetEquipmentBuildingShaderName(equipmentVO);
            return(projectorConfig);
        }
Exemplo n.º 3
0
        public static ProjectorConfig GenerateGeometryConfig(IGeometryVO vo, Action <RenderTexture, ProjectorConfig> callback, float width, float height)
        {
            ProjectorConfig projectorConfig = ProjectorUtils.GenerateGeometryConfig(vo, null, false);

            projectorConfig.RenderCallback = callback;
            projectorConfig.RenderWidth    = width;
            projectorConfig.RenderHeight   = height;
            return(projectorConfig);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
0
 public static ProjectorConfig GenerateGeometryConfig(IGeometryVO vo, UXSprite frameSprite)
 {
     return(ProjectorUtils.GenerateGeometryConfig(vo, frameSprite, false));
 }
Exemplo n.º 6
0
 private void ReCreate()
 {
     ProjectorUtils.ResetProjectorMembers(this);
 }
Exemplo n.º 7
0
        public static ProjectorConfig GenerateBuildingConfig(BuildingTypeVO vo, UXSprite frameSprite)
        {
            ProjectorConfig projectorConfig = ProjectorUtils.GenerateGeometryConfig(vo, frameSprite, false);
            BuildingType    type            = vo.Type;

            if (type <= BuildingType.Turret)
            {
                if (type == BuildingType.Barracks)
                {
                    projectorConfig.AnimationName = "IdleClosed";
                    goto IL_5A;
                }
                if (type != BuildingType.Turret)
                {
                    goto IL_4F;
                }
            }
            else if (type != BuildingType.Storage)
            {
                if (type != BuildingType.Armory)
                {
                    goto IL_4F;
                }
                projectorConfig.AnimationName = "Idle";
                goto IL_5A;
            }
            projectorConfig.AnimationName = null;
            goto IL_5A;
IL_4F:
            projectorConfig.AnimationName = "Active";
IL_5A:
            type = vo.Type;
            if (type <= BuildingType.Starport)
            {
                if (type != BuildingType.ChampionPlatform)
                {
                    if (type == BuildingType.Starport)
                    {
                        projectorConfig.Metered    = true;
                        projectorConfig.MeterValue = 1f;
                    }
                }
                else
                {
                    projectorConfig.AttachmentAssets = new string[]
                    {
                        vo.AssetName
                    };
                }
            }
            else if (type != BuildingType.Turret)
            {
                if (type == BuildingType.Trap)
                {
                    projectorConfig.SnapshotFrameDelay = 4;
                }
            }
            else if (!string.IsNullOrEmpty(vo.TurretUid))
            {
                TurretTypeVO turretTypeVO = Service.Get <IDataController>().Get <TurretTypeVO>(vo.TurretUid);
                projectorConfig.TrackerName = turretTypeVO.TrackerName;
            }
            return(projectorConfig);
        }
Exemplo n.º 8
0
 public unsafe static long $Invoke1(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ProjectorUtils.DetermineVOForEquipment((EquipmentVO)GCHandledObjects.GCHandleToObject(*args))));
 }
Exemplo n.º 9
0
 public unsafe static long $Invoke11(long instance, long *args)
 {
     ProjectorUtils.OnDefaultAssetSuccess((GeometryProjector)GCHandledObjects.GCHandleToObject(*args));
     return(-1L);
 }
Exemplo n.º 10
0
 public unsafe static long $Invoke9(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ProjectorUtils.GetEquipmentBuildingShaderName((EquipmentVO)GCHandledObjects.GCHandleToObject(*args))));
 }
Exemplo n.º 11
0
 public unsafe static long $Invoke8(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ProjectorUtils.GenerateProjector((ProjectorConfig)GCHandledObjects.GCHandleToObject(*args))));
 }
Exemplo n.º 12
0
 public unsafe static long $Invoke7(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ProjectorUtils.GenerateGeometryConfig((IGeometryVO)GCHandledObjects.GCHandleToObject(*args), (Action <RenderTexture, ProjectorConfig>)GCHandledObjects.GCHandleToObject(args[1]), *(float *)(args + 2), *(float *)(args + 3))));
 }
Exemplo n.º 13
0
 public unsafe static long $Invoke6(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ProjectorUtils.GenerateGeometryConfig((IGeometryVO)GCHandledObjects.GCHandleToObject(*args), (UXSprite)GCHandledObjects.GCHandleToObject(args[1]), *(sbyte *)(args + 2) != 0)));
 }
Exemplo n.º 14
0
 public unsafe static long $Invoke2(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ProjectorUtils.GenerateBuildingConfig((BuildingTypeVO)GCHandledObjects.GCHandleToObject(*args), (UXSprite)GCHandledObjects.GCHandleToObject(args[1]))));
 }
Exemplo n.º 15
0
 public unsafe static long $Invoke12(long instance, long *args)
 {
     ProjectorUtils.ResetProjectorMembers((GeometryProjector)GCHandledObjects.GCHandleToObject(*args));
     return(-1L);
 }
Exemplo n.º 16
0
        public static ProjectorConfig GenerateBuildingConfig(BuildingTypeVO vo, UXSprite frameSprite)
        {
            ProjectorConfig projectorConfig = ProjectorUtils.GenerateGeometryConfig(vo, frameSprite, false);
            BuildingType    type            = vo.Type;

            if (type != BuildingType.Barracks)
            {
                if (type != BuildingType.Turret && type != BuildingType.Storage)
                {
                    if (type != BuildingType.Armory)
                    {
                        projectorConfig.AnimationName = "Active";
                    }
                    else
                    {
                        projectorConfig.AnimationName = "Idle";
                    }
                }
                else
                {
                    projectorConfig.AnimationName = null;
                }
            }
            else
            {
                projectorConfig.AnimationName = "IdleClosed";
            }
            BuildingType type2 = vo.Type;

            switch (type2)
            {
            case BuildingType.ChampionPlatform:
                projectorConfig.AttachmentAssets = new string[]
                {
                    vo.AssetName
                };
                return(projectorConfig);

            case BuildingType.Housing:
            case BuildingType.Squad:
IL_8F:
                if (type2 == BuildingType.Turret)
                {
                    if (!string.IsNullOrEmpty(vo.TurretUid))
                    {
                        TurretTypeVO turretTypeVO = Service.StaticDataController.Get <TurretTypeVO>(vo.TurretUid);
                        projectorConfig.TrackerName = turretTypeVO.TrackerName;
                    }
                    return(projectorConfig);
                }
                if (type2 != BuildingType.Trap)
                {
                    return(projectorConfig);
                }
                projectorConfig.SnapshotFrameDelay = 4;
                return(projectorConfig);

            case BuildingType.Starport:
                projectorConfig.Metered    = true;
                projectorConfig.MeterValue = 1f;
                return(projectorConfig);
            }
            goto IL_8F;
        }
Exemplo n.º 17
0
 public unsafe static long $Invoke0(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ProjectorUtils.CanBeAnimated((ProjectorConfig)GCHandledObjects.GCHandleToObject(*args))));
 }