/// <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 ) { 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; }
/// <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; }
/// <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 ) { part.IsVisible = attribute.@bool( 0 ); }
/// <summary> /// 処理 /// </summary> /// <param name="part"></param> public static void OnUpdate(SpritePart part, AttributeBase attribute) { part.IsVisible = attribute.@bool(0); }