コード例 #1
0
        public override void SetAttributes(string name, int attributes)
        {
            ScriptableObject.CheckValidAttributes(attributes);
            int info = FindInstanceIdInfo(name);

            if (info != 0)
            {
                int currentAttributes = (int)((uint)info >> 16);
                if (attributes != currentAttributes)
                {
                    throw new ApplicationException("Change of attributes for this id is not supported");
                }
                return;
            }
            if (prototypeValues != null)
            {
                int id = prototypeValues.FindId(name);
                if (id != 0)
                {
                    prototypeValues.SetAttributes(id, attributes);
                    return;
                }
            }
            base.SetAttributes(name, attributes);
        }
コード例 #2
0
            internal void InitValue(int id, string name, object value, int attributes)
            {
                if (!(1 <= id && id <= maxId))
                {
                    throw new ArgumentException();
                }
                if (name == null)
                {
                    throw new ArgumentException();
                }
                if (value == UniqueTag.NotFound)
                {
                    throw new ArgumentException();
                }
                ScriptableObject.CheckValidAttributes(attributes);
                if (obj.FindPrototypeId(name) != id)
                {
                    throw new ArgumentException(name);
                }

                if (id == constructorId)
                {
                    if (!(value is IdFunctionObject))
                    {
                        throw new ArgumentException("consructor should be initialized with IdFunctionObject");
                    }
                    constructor      = (IdFunctionObject)value;
                    constructorAttrs = (short)attributes;
                    return;
                }

                InitSlot(id, name, value, attributes);
            }
コード例 #3
0
 internal void SetAttributes(int id, int attributes)
 {
     ScriptableObject.CheckValidAttributes(attributes);
     EnsureId(id);
     lock (this) {
         attributeArray [id - 1] = (short)attributes;
     }
 }