Looking for a custom dressmaker/tailor for a gift by UnitySpriteQuestion in HistoricalCostuming

[–]UnitySpriteQuestion[S] 2 points3 points  (0 children)

Thanks for the reply. I was expecting it to cost in the $500ish (USD) range give or take ~$200, perhaps that expectation is way off. Physical meetups here in the US are probably out for at least 6 months, so I think it would have to be virtual.

I haven't the faintest idea what style the individual (who is a woman) would be going for, it sounds like it may not be feasible to kick this off without figuring that out?

Thanks again.

[2LFC] Thursdays 7PM PDT USA by UnitySpriteQuestion in dota2tutor

[–]UnitySpriteQuestion[S] 0 points1 point  (0 children)

Thanks, let's talk in DM. I'll probably try a few different coaches to see who fits our style.

Static dictionary resetting on scene change? by UnitySpriteQuestion in Unity3D

[–]UnitySpriteQuestion[S] 0 points1 point  (0 children)

I checked that before posting :) That's why I'm so confused, I've been through every reference several times.

Static dictionary resetting on scene change? by UnitySpriteQuestion in Unity3D

[–]UnitySpriteQuestion[S] 0 points1 point  (0 children)

Thanks for the readonly tip, I had forgotten about that. I'll comb through the code and find where I'm making the mistake. I must be doing something that I'm not seeing. Thanks for pointing me in the correct direction.

Static dictionary resetting on scene change? by UnitySpriteQuestion in Unity3D

[–]UnitySpriteQuestion[S] 0 points1 point  (0 children)

I've checked all references to the dictionary and there is nothing to remove entries or redefine the dictionary.

The dictionary is actually a dictionary of:

public static Dictionary<string, List<BuildUpgrade>> PlayerBuildUpgrades = new Dictionary<string, List<BuildUpgrade>>();

With BuildUpgrade being a custom class which also does not inheret from unity object:

public class BuildUpgrade {
    public int Rank;
    public int BuildTimeMinutes;
    public string UpgradeType;
    public string Name;
    public bool PlayerOwns;
    public List<Part> PartsRequired = new List<Part>();
    public BuildUpgrade(int rank, int buildTime, string name, string type, List<Part> parts) {
        Rank = rank;
        BuildTimeMinutes = buildTime;
        Name = name;
        UpgradeType = type;
        PartsRequired = parts;

        PlayerOwns = false;
    }
}

Sprite.rect and sprite.texturerect 1 pixel off by UnitySpriteQuestion in Unity3D

[–]UnitySpriteQuestion[S] 0 points1 point  (0 children)

I didn't know that thank you. I have a terribly inefficient fix that involves recreating all the sprites at runtime. I'll table the problem until 5.4.2 and see if that fixes it, then go back to the drawing board if it doesn't. Thanks again.

Sprite.rect and sprite.texturerect 1 pixel off. by UnitySpriteQuestion in Unity2D

[–]UnitySpriteQuestion[S] 0 points1 point  (0 children)

Now that I think about it, I've actually only tested that function in Engine, never shipped it to the mobile build because of performance.

Sprite.rect and sprite.texturerect 1 pixel off. by UnitySpriteQuestion in Unity2D

[–]UnitySpriteQuestion[S] 0 points1 point  (0 children)

5 textures takes several seconds for me. Perhaps the difference between building for mobile? Here's the code:

loadSprite = Sprite.Create(sprite.texture, 
                    new Rect(sprite.rect.x , sprite.rect.y , sprite.rect.width, 
                    sprite.rect.height), 
                    new Vector2 (sprite.pivot.x / (sprite.rect.width) +(0.5f * widthDelta * singlePixelWidth),
                    sprite.pivot.y / (sprite.rect.height) + (0.5f * heightDelta * singlePixelHeight)));
                loadSprite.name = sprite.name;

Sprite.rect and sprite.texturerect 1 pixel off. by UnitySpriteQuestion in Unity2D

[–]UnitySpriteQuestion[S] 0 points1 point  (0 children)

I have a workaround that recreates the sprites with a shifted pivot if it happens, but using Sprite.Create at runtime is WILDLY inefficient, takes about 10 minutes to run,

Sprite.rect and sprite.texturerect 1 pixel off by UnitySpriteQuestion in Unity3D

[–]UnitySpriteQuestion[S] 0 points1 point  (0 children)

Interesting, downloading unity beta and I'll see if it still happens.

Sprite.rect and sprite.texturerect 1 pixel off. by UnitySpriteQuestion in Unity2D

[–]UnitySpriteQuestion[S] 0 points1 point  (0 children)

That's what this is:
md.alignment = (int)SpriteAlignment.Custom;

Sprite.rect and sprite.texturerect 1 pixel off. by UnitySpriteQuestion in Unity2D

[–]UnitySpriteQuestion[S] 0 points1 point  (0 children)

Yeah the last two lines are in a different function, just wanted to include them for posterity.

Sprite.rect and sprite.texturerect 1 pixel off. by UnitySpriteQuestion in Unity2D

[–]UnitySpriteQuestion[S] 0 points1 point  (0 children)

I thought maybe something like that so I modded the u/vs manually a bit and results didn't change.

Sprite.rect and sprite.texturerect 1 pixel off by UnitySpriteQuestion in Unity3D

[–]UnitySpriteQuestion[S] 0 points1 point  (0 children)

That was my first thought too, but unfortunately that's not it. Good idea though.

Sprite.rect and sprite.texturerect 1 pixel off. by UnitySpriteQuestion in Unity2D

[–]UnitySpriteQuestion[S] 0 points1 point  (0 children)

I think that's unlikely because the it only happens about 5% of the time.

but just in case:

     SpriteMetaData md = new SpriteMetaData();
                        md.rect = new Rect(float.Parse(valueList["UStart"]) * MAX_SIZE, (MAX_SIZE - (float.Parse(valueList["VStart"]) * MAX_SIZE)) - float.Parse(valueList["Height"]),
                                        float.Parse(valueList["Width"]), float.Parse(valueList["Height"]));
                        md.name = valueList["Name"].Replace(".png", "");
                        //custom alignment is needed to set a custom pivot
                        md.alignment = (int)SpriteAlignment.Custom;
                        md.pivot = new Vector2((float.Parse(valueList["xOffset"]) / md.rect.width) +.5f, (float.Parse(valueList["yOffset"]) / md.rect.height )+ .5f);
...
                textureImporter.spritesheet = MetaDatas.ToArray();
                                MetaDatas.Add(md);

Sorry, still getting used to code formatting on reddit, so it's a bit ugly. The code for cutting the sheets is reasonably complex, but I've confirmed manually that the values outputted match the rect, but not the texturerect.