johnatm / itween

Automatically exported from code.google.com/p/itween
1 stars 2 forks source link

OnEnable() #74

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
iTweenPath

void OnEnable(){
if(!paths.ContainsKey(pathName)){
    paths.Add(pathName.ToLower(), this);
}
}

this throws errors in some cases where User1 has a path with the same name as 
User2. The if statement does not compare exactly what is being added to the 
paths list. //if(!paths.ContainsKey(pathName.ToLower())){ // fixes the issue

Original issue reported on code.google.com by KJSebest...@gmail.com on 29 Jun 2011 at 4:27

GoogleCodeExporter commented 8 years ago
The fix for this error is here:
http://pastebin.com/4A9D3zCJ

But be warned that if you use the path with the same name twice, or more, you 
only get one "OnComplete method" call

*If you do not wish to visit the link*
//iTweenPath.cs line 37 fix @Dictionary Exception when instanciating an object 
with same path.

    void OnEnable()
    {
        string lowerPathName = pathName.ToLower();
        if (!paths.ContainsKey(lowerPathName))
        {
            paths.Add(lowerPathName, this);
        }
    }

Original comment by pedrinho...@gmail.com on 2 Jan 2012 at 10:43