Exception cleanup. Code cleanup.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Cryville.Common;
|
||||
using Cryville.Common.Pdt;
|
||||
using Cryville.Crtr.Components;
|
||||
using Cryville.Crtr.Event;
|
||||
@@ -100,10 +101,16 @@ namespace Cryville.Crtr {
|
||||
SkinProperty GetPropOp(Transform obj, SkinPropertyKey key) {
|
||||
var ctype = key.Component;
|
||||
var comp = (SkinComponent)obj.GetComponent(ctype);
|
||||
if (comp == null) throw new InvalidOperationException("Component instance not found");
|
||||
if (comp == null) throw new InvalidOperationException(string.Format(
|
||||
"Trying to set property {0} but the component is not found",
|
||||
IdentifierManager.SharedInstance.Retrieve(key.Name)
|
||||
));
|
||||
SkinProperty result;
|
||||
if (!comp.Properties.TryGetValue(key.Name, out result))
|
||||
throw new ArgumentException(string.Format("Property {0} not found on component", key.Name));
|
||||
throw new ArgumentException(string.Format(
|
||||
"Property {0} not found on component",
|
||||
IdentifierManager.SharedInstance.Retrieve(key.Name)
|
||||
));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user