本文整理汇总了C#中Script.LoadFromFile方法的典型用法代码示例。如果您正苦于以下问题:C# Script.LoadFromFile方法的具体用法?C# Script.LoadFromFile怎么用?C# Script.LoadFromFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Script
的用法示例。
在下文中一共展示了Script.LoadFromFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main()
{
ClutterRun.Init ();
script = new Script ();
script.LoadFromData (test_behaviour);
script.LoadFromFile ("test-script.json");
merge_id = script.LoadFromData (test_unmerge);
Stage stage = script.GetObject<Stage>("main-stage");
Actor blue_button = script.GetObject<Actor>("blue-button");
Actor red_button = script.GetObject<Actor>("red-button");
blue_button.ButtonPressEvent += delegate
{
Console.WriteLine("Unmerging");
script.UnmergeObjects(merge_id);
};
red_button.ButtonPressEvent += delegate
{
Console.WriteLine ("Changing timeline state");
Timeline timeline = script.GetObject<Timeline> ("main-timeline");
if (!timeline.IsPlaying)
timeline.Start ();
else
timeline.Pause ();
};
stage.Unrealized += delegate { Clutter.Main.Quit (); };
stage.KeyPressEvent += delegate { Clutter.Main.Quit (); };
stage.ShowAll ();
ClutterRun.Main ();
}