@bool() public method

真偽値パラメータの取得
public @bool ( int no ) : bool
no int
return bool
コード例 #1
0
        /// <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 );
        }
コード例 #2
0
 /// <summary>
 /// 処理
 /// 縦反転
 /// </summary>
 /// <param name="part"></param>
 /// <param name="attribute"></param>
 public static void OnUpdateV( SpritePart part, AttributeBase attribute )
 {
     bool isFlip = attribute.@bool( 0 );
     var scale = part.transform.localScale;
     if ( isFlip ) {
         scale.y = -Mathf.Abs( scale.y );
     } else {
         scale.y = Mathf.Abs( scale.y );
     }
     part.transform.localScale = scale;
 }
コード例 #3
0
        /// <summary>
        /// 処理
        /// 縦反転
        /// </summary>
        /// <param name="part"></param>
        /// <param name="attribute"></param>
        public static void OnUpdateV(SpritePart part, AttributeBase attribute)
        {
            bool isFlip = attribute.@bool(0);
            var  scale  = part.transform.localScale;

            if (isFlip)
            {
                scale.y = -Mathf.Abs(scale.y);
            }
            else
            {
                scale.y = Mathf.Abs(scale.y);
            }
            part.transform.localScale = scale;
        }
コード例 #4
0
        /// <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);
        }
コード例 #5
0
 /// <summary>
 /// 処理
 /// </summary>
 /// <param name="part"></param>
 public static void OnUpdate( SpritePart part, AttributeBase attribute )
 {
     part.IsVisible = attribute.@bool( 0 );
 }
コード例 #6
0
 /// <summary>
 /// 処理
 /// </summary>
 /// <param name="part"></param>
 public static void OnUpdate(SpritePart part, AttributeBase attribute)
 {
     part.IsVisible = attribute.@bool(0);
 }