示例#1
0
        public static string GetRubbleAssetNameForEntity(SmartEntity entity)
        {
            SizeComponent sizeComp = entity.SizeComp;
            int           num      = Units.BoardToGridX(sizeComp.Width);
            int           num2     = Units.BoardToGridZ(sizeComp.Depth);
            string        uid;

            if (entity.BuildingComp.BuildingType.Type == BuildingType.Wall)
            {
                uid = string.Format("rebelRubbleWall1", new object[]
                {
                    num,
                    num2
                });
            }
            else
            {
                uid = string.Format("rebelRubble{0}", new object[]
                {
                    num,
                    num2
                });
            }
            BuildingTypeVO buildingTypeVO = Service.Get <IDataController>().Get <BuildingTypeVO>(uid);

            return(buildingTypeVO.AssetName);
        }
示例#2
0
        public static string GetDebrisAssetNameForEntity(SmartEntity entity, bool isBuilding)
        {
            SizeComponent sizeComp = entity.SizeComp;
            int           val      = Units.BoardToGridX(sizeComp.Width);
            int           val2     = Units.BoardToGridZ(sizeComp.Depth);
            int           num      = Math.Min(val, val2);
            string        uid;

            if (isBuilding)
            {
                BuildingTypeVO buildingType = entity.BuildingComp.BuildingType;
                string         text         = string.IsNullOrEmpty(buildingType.DestructFX) ? "fx_debris_{0}x{1}" : buildingType.DestructFX;
                BuildingType   type         = buildingType.Type;
                if (type != BuildingType.Wall)
                {
                    if (type != BuildingType.Turret)
                    {
                        if (type != BuildingType.ShieldGenerator)
                        {
                            uid = string.Format(text, new object[]
                            {
                                num,
                                num
                            });
                        }
                        else
                        {
                            uid = "fx_debris_6x6";
                        }
                    }
                    else
                    {
                        uid = ((buildingType.Faction == FactionType.Tusken) ? "effect176" : string.Format(text, new object[]
                        {
                            num,
                            num
                        }));
                    }
                }
                else
                {
                    uid = "effect176";
                }
            }
            else
            {
                uid = string.Format("fx_vehdebris_{0}x{1}", new object[]
                {
                    num,
                    num
                });
            }
            EffectsTypeVO effectsTypeVO = Service.Get <IDataController>().Get <EffectsTypeVO>(uid);

            return(effectsTypeVO.AssetName);
        }
示例#3
0
 public unsafe static long $Invoke0(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(Units.BoardToGridX(*(int *)args)));
 }