长知识啦!字符也可以作为下标!

展开阅读全文
博主设置当前文章不允许评论。

【Unity新闻】啦啦啦,Unity也开源啦

08-29

最近Unity新闻不断,一会开大会,一会新版本,一会又开源,真忙呀~~rnrn其中很让人关注的就是Unity的[url=http://blogs.unity3d.com/2014/08/20/more-open-source-initiatives-from-unity/?utm_source=marketo&utm_medium=email&utm_campaign=unity_news_august_2014&mkt_tok=3RkMMJWWfF9wsRojs6nPZKXonjHpfsX57%2B0tXaC3iokz2EFye%2BLIHETpodcMScpnPa%2BTFAwTG5toziV8R7TFLs15ycYQWhTk]开源计划[/url]![img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/46.gif][/img]rnrn去年12月,Unity公布了他们的新工具——Unity Test Tools。和以往的官方工具不同,这次的测试工具是按照开源的方式公布的,按我的理解,它就像Unity的很多插件那样,以一个扩展包的方式在Unity里工作,而开发者可以查看、修改这些代码。虽然它很小。。。rnrn前几天,Unity宣布发布了[url=http://unity3d.com/unity/beta/4.6]Unity 4.6 beta版[/url],除了增加更更多Shader这类必不可少的支持外,另一个主角UI也登场了,发布了[url=http://unity3d.com/learn/tutorials/modules/beginner/ui?utm_source=marketo&utm_medium=email&utm_campaign=unity_news_august_2014&mkt_tok=3RkMMJWWfF9wsRojs6nPZKXonjHpfsX57%2B0tXaC3iokz2EFye%2BLIHETpodcMScpnPa%2BTFAwTG5toziV8R7TFLs15ycYQWhTk]UI教程[/url],Unity也作出承诺,将在不久之后发布UI的源码~这个比测试工具更引人注目啊!之前Unity原生界面大部分都是用onGUI这个鸡肋函数实现的,做出来都没有商业项目用啊。。。最火的界面插件NGUI钻了空隙火了半边天,当然人家的源码也是公开滴!rnrn哎,4.6刚出,5.0也不远了,Unity的功能越来越强大,很多人说Unity上手快(包括我也这么说。),但实际上这个大家伙想用得好其实要花很多很多功夫。也有人说,它的图形和渲染能力不好,但其实它的发展已经可以支持很多非常棒的3D游戏了,画面细腻度绝对令人称赞,只是我等不知何时可以掌握呀~[url=http://unity3d.com/showcase]Showcase[/url]里有很多,可以去膜拜下rnrn[img=https://img-bbs.csdn.net/upload/201408/29/1409298255_429483.jpg][/img]rn 论坛

标题一定要长...长...长...长...长...长...长...长...长...长...长...长...长...长...长...长...长...长

10-31

[code=Java]rnimport java.awt.Dimension;rnimport java.awt.Point;rnimport java.awt.Toolkit;rnimport java.awt.event.WindowAdapter;rnimport java.awt.event.WindowEvent;rnimport java.awt.event.WindowStateListener;rnimport java.util.ArrayList;rnimport java.util.List;rnrnimport javax.imageio.ImageIO;rnimport javax.swing.ImageIcon;rnimport javax.swing.JFrame;rnimport javax.swing.JLabel;rnimport javax.swing.SwingUtilities;rnrnimport com.sun.awt.AWTUtilities;rnimport java.awt.event.KeyAdapter;rnimport java.awt.event.KeyEvent;rnrnpublic class FlowerRain extends JFrame rnrn private static final long serialVersionUID = -8037287523655159012L;rnrn private int num = 99;// 花朵数量rn private int speed = 3;// 下降速度rn private boolean flag = true;rn private List labelList = new ArrayList(num);rn private Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();rn private ImageIcon icon = new ImageIcon(ImageIO.read(this.getClass().getResourceAsStream("flower.gif")));// 花朵图片rnrn public FlowerRain() throws Exception rnrn getContentPane().setLayout(null);rn setTitle("漫天花雨");rn setSize(screenSize);rn setResizable(false);rn setUndecorated(true);rn setAlwaysOnTop(true);rn setLocationRelativeTo(null);rn setIconImage(icon.getImage());rn AWTUtilities.setWindowOpaque(this, false);rn setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);rnrn // 防止最小化rn addWindowStateListener(new WindowStateListener() rn public void windowStateChanged(WindowEvent e) rn if (getState() == 1) rn setState(0);rn rn rn );rnrn // Ctrl + E 关闭窗口rn addKeyListener(new KeyAdapter() rn public void keyPressed(KeyEvent e) rn if (e.isControlDown() && e.getKeyCode() == KeyEvent.VK_E) rn dispatchEvent(new WindowEvent(FlowerRain.this, WindowEvent.WINDOW_CLOSING));rn rn rn );rnrn addWindowListener(new WindowAdapter() rn @Overridern public void windowClosing(WindowEvent e) rn flag = false;// 将线程循环标志置为falsern rn );rnrn for (int i = 0; i < num; i++) rn JLabel jlbl = new JLabel(icon);rn jlbl.setSize(20, 20);rn jlbl.setLocation(random(screenSize.width), random(screenSize.height));rnrn labelList.add(jlbl);rn add(jlbl);rn rnrn rnrn public void move() rn new Thread() rn public void run() rn while (flag) rn try rn SwingUtilities.invokeLater(new Runnable() rn public void run() rn for (int i = 0; i < labelList.size(); i++) rn JLabel jlbl = labelList.get(i);rn Point location = jlbl.getLocation();rnrn jlbl.setLocation(location.x + (i % 5 - 2), location.y + speed);rnrn location = jlbl.getLocation();rn if (location.y >= screenSize.height || location.x <= 0 || location.x >= screenSize.width) rn jlbl.setLocation(random(screenSize.width), 0);rn rn rn rn );rn Thread.sleep(100);rn catch (Exception e) rn e.printStackTrace();rn rn rn ;rn .start();rnrn rnrn public void start() rn SwingUtilities.invokeLater(new Runnable() rn public void run() rn try rn setVisible(true);rn move();rn catch (Exception e) rn e.printStackTrace();rn rn rn );rn rnrn public int random(int max) rn return (int) (Math.random() * max);rn rnrn public int random(int min, int max) rn return random(max - min) + min;rn rnrn public static void main(String[] args) throws Exception rn new FlowerRain().start();rn rnrn[/code]rnrn[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/63.gif][/img] 论坛

没有更多推荐了,返回首页