コード例 #1
0
        void AcceptProperty <TContainer>(ref TContainer container, UnsafeObjectView view, IProperty <TContainer> property)
        {
            if (view.TryGetValue(property.Name, out var value))
            {
                using (CreatePropertyScope(property))
                    using (CreateViewScope(value))
                    {
                        property.Accept(this, ref container);
                    }

                return;
            }

            foreach (var attribute in property.GetAttributes <FormerNameAttribute>())
            {
                if (view.TryGetValue(attribute.OldName, out value))
                {
                    using (CreatePropertyScope(property))
                        using (CreateViewScope(value))
                        {
                            property.Accept(this, ref container);
                        }

                    return;
                }
            }

            foreach (var attribute in property.GetAttributes <UnityEngine.Serialization.FormerlySerializedAsAttribute>())
            {
                if (view.TryGetValue(attribute.oldName, out value))
                {
                    using (CreatePropertyScope(property))
                        using (CreateViewScope(value))
                        {
                            property.Accept(this, ref container);
                        }

                    return;
                }
            }
        }