@int() public method

整数パラメータの取得
public @int ( int no ) : int
no int
return int
        /// <summary>
        /// 処理
        /// </summary>
        /// <param name="part"></param>
        public static void OnUpdate( SpritePart part, AttributeBase attribute )
        {
            bool hasInt = attribute.@bool( 0 );
            bool hasPoint = attribute.@bool( 1 );
            bool hasRect = attribute.@bool( 2 );
            bool hasString = attribute.@bool( 3 );

            Vector2 point = Vector2.zero;
            Rect rect = new Rect();

            int index = 0;

            if ( hasPoint ) {
                point = new Vector2( attribute.@float( 0 ), attribute.@float( 1 ) );
                index = 2;
            }
            if ( hasRect ) {
                rect = new Rect(
                        attribute.@float( index + 0 ),
                        attribute.@float( index + 1 ),
                        attribute.@float( index + 2 ),
                        attribute.@float( index + 3 ) );
            }

            var data = new UserData() {
                integer = attribute.@int( 0 ),
                text = hasString ? attribute.@string( 0 ) : null,
                point = point,
                rect = rect,
            };
            part.Root.NotifyUserData( part, data );
        }
        /// <summary>
        /// 処理
        /// </summary>
        /// <param name="part"></param>
        public static void OnUpdate(SpritePart part, AttributeBase attribute)
        {
            bool hasInt    = attribute.@bool(0);
            bool hasPoint  = attribute.@bool(1);
            bool hasRect   = attribute.@bool(2);
            bool hasString = attribute.@bool(3);

            Vector2 point = Vector2.zero;
            Rect    rect  = new Rect();

            int index = 0;

            if (hasPoint)
            {
                point = new Vector2(attribute.@float(0), attribute.@float(1));
                index = 2;
            }
            if (hasRect)
            {
                rect = new Rect(
                    attribute.@float(index + 0),
                    attribute.@float(index + 1),
                    attribute.@float(index + 2),
                    attribute.@float(index + 3));
            }

            var data = new UserData()
            {
                integer = attribute.@int(0),
                text    = hasString ? attribute.@string(0) : null,
                point   = point,
                rect    = rect,
            };

            part.Root.NotifyUserData(part, data);
        }
Esempio n. 3
0
 /// <summary>
 /// 処理
 /// </summary>
 /// <param name="part"></param>
 public static void OnUpdate(SpritePart part, AttributeBase attribute)
 {
     part.Priority = attribute.@int(0);
 }
 /// <summary>
 /// 処理
 /// </summary>
 /// <param name="part"></param>
 public static void OnUpdate( SpritePart part, AttributeBase attribute )
 {
     part.Priority = attribute.@int( 0 );
 }
 /// <summary>
 /// 処理
 /// </summary>
 /// <param name="part"></param>
 public static void OnUpdate(SpritePart part, AttributeBase attribute)
 {
     part.SetCellMap(attribute.@int(0), attribute.@int(1));
 }
 /// <summary>
 /// 処理
 /// </summary>
 /// <param name="part"></param>
 public static void OnUpdate( SpritePart part, AttributeBase attribute )
 {
     part.SetCellMap( attribute.@int( 0 ), attribute.@int( 1 ) );
 }