上一页 1 2 3 4 5 6 ··· 18 下一页
摘要: renderer.material 物理材质实现二维图上的人物动作新建Material,选择Shader(著色器)为transparent/diffuse(背景透明),将上图拉到背景图选项中。创建plane(片),将片的材质改为新建的material,调整tiling x和y的值(为1/列数和1/行数),offset为偏移量mainTextureScale(Vector2)纹理缩放 int i ; int j ; public int w, h ;//w,h可变,适应其它图片 public float stepTime ; // Use this for init... 阅读全文
posted @ 2013-08-22 17:59 追逐. 阅读(394) 评论(0) 推荐(0) 编辑
摘要: http://u3d.as/content/pixelplacement/i-tween/1s9downloadhttp://itween.pixelplacement.com/documentation.php#MoveToapi iTween.MoveTo(gameObject, iTween.Hash("x", 5, "time", 5, "easetype", iTween.EaseType.easeInBack)) ; 添加的物体(gameObject)以某一动作(easetype)移动到某一位置(hash(x, y, z) 阅读全文
posted @ 2013-08-22 13:48 追逐. 阅读(858) 评论(0) 推荐(0) 编辑
摘要: 移动: 1、SimpleMove(Vector3: vector3&speed) 简单移动,可以根据vector3方向移动,物体不需要添加刚体即受重力影响,不需要添加碰撞器即可以产生碰撞,但无法推动其它物体。 2、Move(Vector3: vector3&speed) 移动,根据vector3方向移动,速度比SimpleMove快许多,不受重力影响,但可以在不添加碰撞器的情况下产生碰撞,无法推动其它物体。sampleusing UnityEngine;using System.Collections;public class CharControl : MonoBehavio 阅读全文
posted @ 2013-08-21 10:09 追逐. 阅读(2803) 评论(0) 推荐(0) 编辑
摘要: Camera跟随物体: import Scripts包,Component中的camera control会有smooth follow脚本,添加到Main Camera中,在脚本的target属性中拖入要跟随的物体。(ctrl+shift+f固定Main Camera视角)Rigidbody刚体 Component->physics 添加了刚体就使Gameobject有了物理属性 Mass 质量 Drag 阻力 AngularDrag 角阻力rigidbody.AddForce(Vector3.forward*1000) ;添加一个向前的力 rigidbody.velo... 阅读全文
posted @ 2013-08-19 11:14 追逐. 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 调用其它组件中成员 通过GameObject(游戏物体)。 Base class for all entities in Unity scenes。 是Unity场景里面所有实体的基类。 可以理解为两个类间的访问,定义一个超类用其中一个类实现。 默认的gameObject为当前组件。transform为变换,有常用属性position(Vector3三维向量)。 熟记transform下属性和方法作用。transform.translate() 平移,给定vector3,给定坐标系'物体坐标系或者世界坐标系'。由于每秒执行60次,可以用Time.deltaTime(增量时间:以 阅读全文
posted @ 2013-08-15 17:50 追逐. 阅读(649) 评论(0) 推荐(0) 编辑
摘要: http://unity3d.com/资源站http://docs.unity3d.com/Documentation/ScriptReference/index.html 最新APInew Rect(100f/1024*Screen.width, 160f/768*Screen.height, 800, 580) 格式化分辨率(不靠谱。以后可以用插件) public enum Menu {start=1, option, help, quite}//枚举 可以规定起始值 默认为0(Menu option_t = Menu.option ; option_t.GetHashCode()=2)V 阅读全文
posted @ 2013-08-14 17:00 追逐. 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 以combobox为例。 假如一行里面只有一个combobox。 //在类中声明一个控件数组 private ComboBox[] cmds = null; //initview中调用dao组件获得显示的对象列表 List plist = idao.queryIndicators(); //根据对象列表个数new一组cmds cmds=new ComboBox[plist.Count]; //在view的SelectedIndexChanged事件中 if (this.listView1.SelectedItems.Count > 0) ... 阅读全文
posted @ 2013-08-08 12:55 追逐. 阅读(367) 评论(0) 推荐(0) 编辑
摘要: Winform窗口中,控件listview是无法设置行高的。以加入一个imagelist(图片列表控件)实现行高的设置。ImageList imageList = new ImageList();imageList.ImageSize = new System.Drawing.Size(10, 20); //分别是宽和高listView1.SmallImageList = imageList; 阅读全文
posted @ 2013-08-08 12:40 追逐. 阅读(1429) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4366 给定后继关系,寻找后继者满足能力值大于被继承者中忠诚值最大的。 先将树形结构变为线性结构,用邻接表+dfs处理。然后对能力值大到小排序,保证查询时已经插入的一定是能力值大于该查询的值。 线段树功能转化为求解区间最值。 本来1Y的代码,结果loy和blt的输入搞反了!试了好多数据还没试出来!郁闷,这两天写的代码好多这种脑残错。。。code:#include<cstdlib>#include<cctype>#include<cstring>#include<cst 阅读全文
posted @ 2012-08-22 11:10 追逐. 阅读(357) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=4047 求给定区间连续k个值和的最大值,有单点更改和交换操作。 这题主要是建树,以每个节点开始的连续k个值的和作为一个节点,这样共有n-k+1个节点,更新时计算出更新的点所在节点的范围,更新值为 新值-旧值。 交换即为两次更新,线段树记录节点最大值。code:#include<cstdlib>#include<cctype>#include<cstring>#include<cstdio>#include<cmath>#include<algorithm>#includ 阅读全文
posted @ 2012-08-22 09:16 追逐. 阅读(198) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 18 下一页