@float() public méthode

小数パラメータの取得
public @float ( int no ) : float
no int
Résultat float
        /// <summary>
        ///
        /// </summary>
        /// <param name="part"></param>
        /// <param name="attribute"></param>
        public static void OnUpdateZ(SpritePart part, AttributeBase attribute)
        {
            var position = part.transform.localPosition;

            position.z = attribute.@float(0);
            part.transform.localPosition = position;
        }
        /// <summary>
        /// 処理
        /// </summary>
        /// <param name="part"></param>
        public static void OnUpdate( SpritePart part, AttributeBase attribute )
        {
            Vector2 lt = new Vector2( attribute.@float( 0 ), attribute.@float( 1 ) );
            Vector2 rt = new Vector2( attribute.@float( 2 ), attribute.@float( 3 ) );
            Vector2 lb = new Vector2( attribute.@float( 4 ), attribute.@float( 5 ) );
            Vector2 rb = new Vector2( attribute.@float( 6 ), attribute.@float( 7 ) );

            part.TransformVertices( lt, rt, lb, rb );
        }
Exemple #3
0
        /// <summary>
        /// 処理
        /// </summary>
        /// <param name="part"></param>
        public static void OnUpdate(SpritePart part, AttributeBase attribute)
        {
            Vector2 lt = new Vector2(attribute.@float(0), attribute.@float(1));
            Vector2 rt = new Vector2(attribute.@float(2), attribute.@float(3));
            Vector2 lb = new Vector2(attribute.@float(4), attribute.@float(5));
            Vector2 rb = new Vector2(attribute.@float(6), attribute.@float(7));

            part.TransformVertices(lt, rt, lb, rb);
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="part"></param>
 /// <param name="attribute"></param>
 public static void OnUpdateZ( SpritePart part, AttributeBase attribute )
 {
     var rotation = part.transform.localRotation;
     var angles = rotation.eulerAngles;
     angles.z = attribute.@float( 0 );
     rotation.eulerAngles = angles;
     part.transform.localRotation = rotation;
 }
Exemple #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="part"></param>
        /// <param name="attribute"></param>
        public static void OnUpdateZ(SpritePart part, AttributeBase attribute)
        {
            var rotation = part.transform.localRotation;
            var angles   = rotation.eulerAngles;

            angles.z                     = attribute.@float(0);
            rotation.eulerAngles         = angles;
            part.transform.localRotation = rotation;
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="part"></param>
 /// <param name="attribute"></param>
 public static void OnUpdateY( SpritePart part, AttributeBase attribute )
 {
     float value = attribute.@float( 0 );
     var scaling = part.transform.localScale;
     float old = scaling.y;
     float v = old < 0 ? -value : value;
     scaling.y = v;
     //scaling.z = v;
     part.transform.localScale = scaling;
 }
Exemple #7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="part"></param>
        /// <param name="attribute"></param>
        public static void OnUpdateY(SpritePart part, AttributeBase attribute)
        {
            float value   = attribute.@float(0);
            var   scaling = part.transform.localScale;
            float old     = scaling.y;
            float v       = old < 0 ? -value : value;

            scaling.y = v;
            //scaling.z = v;
            part.transform.localScale = scaling;
        }
        /// <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);
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="part"></param>
 /// <param name="attribute"></param>
 public static void OnUpdateV( SpritePart part, AttributeBase attribute )
 {
     float value = attribute.@float( 0 );
     part.UpdateTexCoordV( value );
 }
 /// <summary>
 /// 処理
 /// </summary>
 /// <param name="part"></param>
 public static void OnUpdate(SpritePart part, AttributeBase attribute)
 {
     part.Alpha = attribute.@float(0);
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="part"></param>
        /// <param name="attribute"></param>
        public static void OnUpdateV(SpritePart part, AttributeBase attribute)
        {
            float value = attribute.@float(0);

            part.UpdateTexCoordV(value);
        }
 /// <summary>
 /// 処理
 /// </summary>
 /// <param name="part"></param>
 public static void OnUpdate( SpritePart part, AttributeBase attribute )
 {
     part.Alpha = attribute.@float( 0 );
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="part"></param>
 /// <param name="attribute"></param>
 public static void OnUpdateZ( SpritePart part, AttributeBase attribute )
 {
     var position = part.transform.localPosition;
     position.z = attribute.@float( 0 );
     part.transform.localPosition = position;
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="part"></param>
 /// <param name="attribute"></param>
 public static void OnUpdateY(SpritePart part, AttributeBase attribute)
 {
     float value = attribute.@float(0);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="part"></param>
 /// <param name="attribute"></param>
 public static void OnUpdateY( SpritePart part, AttributeBase attribute )
 {
     float value = attribute.@float( 0 );
 }