This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
obs = obslua | |
source_name = "" | |
format_text = "" | |
start_number = 0 | |
step_number = 0 | |
now_count = 0 | |
last_text = "" | |
activated = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Section: Object, RealmSectionModelType { | |
public typealias Item = RowItem | |
public let item = List<Item>() | |
@objc dynamic var title = "" | |
} | |
public class RowItem: Object { | |
@objc dynamic var title = "" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func heightForStringDrawing2(myString: String, myFont: NSFont, myWidth: CGFloat) -> CGFloat { | |
let paragraphStyle = NSMutableParagraphStyle() | |
paragraphStyle.lineBreakMode = .byWordWrapping | |
let attribute: [String : Any] = [ | |
NSFontAttributeName: myFont, | |
NSParagraphStyleAttributeName: paragraphStyle | |
] | |
let constraintsSize = CGSize(width: myWidth, height: CGFloat(FLT_MAX)) | |
let textSize = NSString(string: myString).boundingRect(with: constraintsSize, options: .usesLineFragmentOrigin, attributes: attribute, context: nil) | |
return textSize.height |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Unityでエラーとなるコード(Ver4.6.3f1で確認 ) | |
public enum EnumType { | |
Default, | |
TypeA, | |
} | |
public class Hoge<T> { | |
public void test() { | |
Found(); //!< OK | |
NotFound(); //!< error CS0103: The name 'NotFound' does not exist in the current context |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// uGUIのボタンなどにイベントを設定するスクリプト例 | |
using UnityEngine; | |
using UnityEngine.EventSystems; | |
using System.Collections.Generic; | |
public class HogeScript : MonoBehaviour { | |
void Start() { | |
var trigger = gameObject.AddComponent<EventTrigger>(); | |
trigger.delegates = new List<EventTrigger.Entry>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool HelloWorld::init() | |
{ | |
// ... | |
auto listener = EventListenerTouchOneByOne::create(); | |
listener->onTouchBegan = CC_CALLBACK_2(HelloWorld::onTouchBegan, this); | |
listener->onTouchMoved = CC_CALLBACK_2(HelloWorld::onTouchMoved, this); | |
listener->onTouchEnded = CC_CALLBACK_2(HelloWorld::onTouchEnded, this); | |
this->getEventDispatcher()->addEventListenerWithSceneGraphPriority(listener, this); | |
// ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func heightForStringDrawing(myString: String, myFont: NSFont, myWidth: CGFloat) -> CGFloat | |
{ | |
var textStorage = NSTextStorage(string: myString) | |
var textContainer = NSTextContainer(containerSize: NSMakeSize(myWidth, CGFloat(FLT_MAX))) | |
var layoutManager = NSLayoutManager() | |
layoutManager.addTextContainer(textContainer) | |
textStorage.addLayoutManager(layoutManager) | |
textStorage.addAttribute(NSFontAttributeName, value:myFont, range:NSMakeRange(0, textStorage.length)); | |
textContainer.lineFragmentPadding = 0.0 |