spriterunity64位无法兼容unity吗

学习加复习
这几天做了一个特别简单的案例,万圣节南瓜鬼脸。
&&&&&&& 怎么说呢,我第一次接触Unity,给我的感觉还不错。从这个案例中我学到了很多东西。
&&&&&&&& 我要做一个总结
&&&&&&&&&&&&& 万圣节鬼脸的建立:
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 1:创建sprite。&也就是导入sprite&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 2:整理画面,调整镜头。
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 3:让bat抖动,接着对所有的sprite加入淡入效果,最后就是流程控制。&自己也当了导演!&
&&&&&&&&&&&&& 粒子系统
&&&&&&&&&&&&&&&&&&&&&& 学会了材质的创建,加入,以及粒子各个功能的调整。
&&&&&&&&&&&&&& 代码:
&&&&&&&&&&&&&&&&&&&&& Vector3&官网上找的&
&&&&&&&&&&&&&&&&&&&&&& Descriptation
&&&&&&&&&&&&&&&&&&&&&& Representation of 3D vectors and points.
&&&&&&&&&&&&&&&&&&&&& This structure is used throughout Unity to pass 3D positions and directions around.It also contains functions for doing common vector operations.
&&&&&&&&&&&&&&&&&&&&& Besides the functions listed below, other classes can be used to manipulate vectors and points as well.For example the
classes are useful& for rotating or transforming vectors and points.& x , y , z &.
&&&&&&&&&&&&&&&&&&&&& var
&&&&&&&&&&&&&&&&&&&&& var 是一种弱化类型的定义,定义了这个类型,编译器会自动判断该变量的类型。必须是这个形式var m = &asd& ,之后就无法给变量赋初始值类型不同的值了。这个变量是局部变量。
&&&&&&&&&&&&&&&&&&&&& Time.deltaTime(The time in seconds it took to complete the last frame (Read Only).)&每一帧完成的秒数&
&&&&&&&&&&& & & & & && If you add or subtract to a value every frame chances are you should multiply with Time.deltaTime. When you multiply with Time.deltaTime you essentially express: I want to move this object 10 meters per second instead of 10 meters
per frame.
&&&&&&&&&&&&&&&&&&&&&& GetComponent 我理解是获取内部的一个结构 ep.:GetComponent&spriteRanderer&获取sprite渲染器
&&&&&&&&&&&&&&&&&&&&&&& transform:Every object in a scene has a Transform.It's used to store and manipulate the position, rotation and scale of the object
&&&&&&&&&&&&&&&&&&&&&&&& 它被使用来储存和处理物体位置,旋转,物体的规模。ep.:var pos = transform.pos.x...............pos.y;
&&&&&&&&&&&&&&&&&&&&&& GameObject& :& Base class for all entities in Unity scenes.游戏里个体的基础集合。ep.:sp.SerActive(false);
&&&&&&&&&&&&&&&&&&&&&& Input.GetmouseButtonup(0),0代表鼠标左键。
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
排名:千里之外unity(7)
& & & & & & 一直在使用ngui做ui,不过发现尽然没有一个开关部件。开关应该算是比较常用的部件了,尽然没有,感觉有点小不科学,于是自己写了一个简单开关小部件。哎,现在还不会写插件,等自己功力长进了,就自己改ngui的代码,在widget里加入swtch开关好了。
& & & & & & &现在的话,就只能用最原始的方法创建一个开关咯。创建一个空的gameobject,并命名为Switch,然后需要加上我自己写的UISwitch组件(下面会有uiswitch的代码)。然后以Switch为父节点,加上两个sprite,分别作为开关打开和关闭时显示的sprite。这两个sprite最好命名为OffSprite和OnSprite,因为我的代码是按照这两个名字来查找的,如果不想拘泥于命名,也可以直接手动拖拽引用到UISwitch组件上。
& & 如图为层级窗口。
& & & & & & &&& & & & & &
& & & & & 下面详述了uiswitch代码,实现了一点简单的功能,基本够用。 & & & & & &&
using UnityE
using System.C
public class UISwitch : MonoBehaviour
//默认状态是开还是关
public bool isOn =
//会自动将sprite的位置移动到原点
public bool isAutoAdjustSpritePosition =
//会自动调整sprite的缩放比例
public bool isAutoAdjustSpriteScale =
//是否自动调整boxcollider:依据图片调整collider的大小
public bool isAutoAdjustCollider =
//开关关掉时的Sprite
public GameObject offS
//开关打开时的时间接收者
public GameObject onS
//开关关掉的事件接收者
public GameObject offEventR
//开关打开的事件接收者
public GameObject onEventR
//开关关掉的事件的方法名
public string offFunctionName = &OnSwitchOff&;
//开关打开的时间的方法名
public string onFunctionName = &OnSwitchOn&;
private Vector3 averageS
// Use this for initialization
void Start()
//如果没有手动引用,会自动寻找
if (offSprite == null) offSprite = transform.FindChild(&OffSprite&).gameO
if (onSprite == null) onSprite = transform.FindChild(&OnSprite&).gameO
if (isAutoAdjustSpritePosition) adjustSpritePosition();
if (isAutoAdjustSpriteScale) adjustSpriteScale();
if (isAutoAdjustCollider) adjustCollider();
updateSprite();
//将开关图片的localscale平均一下~
void adjustSpriteScale()
averageScale = (offSprite.transform.localScale + onSprite.transform.localScale) / 2f;
offSprite.transform.localScale = onSprite.transform.localScale = averageS
//调整到正中间
void adjustSpritePosition()
offSprite.transform.localPosition = Vector3.
onSprite.transform.localPosition = Vector3.
//如果没有boxcollider组件,会自动添加一个
//另外,将center设置为正中间,size设置为图片的平均localscale
void adjustCollider()
if(GetComponent&BoxCollider&()==null)
this.gameObject.AddComponent&BoxCollider&();
GetComponent&BoxCollider&().center = Vector3.
GetComponent&BoxCollider&().size = averageS
void OnClick()
isOn = !isOn;
OnSwitchOn();
OnSwitchOff();
updateSprite();
//切换一下开关图片
void updateSprite()
offSprite.SetActive(!isOn);
onSprite.SetActive(isOn);
void OnSwitchOn()
if (onEventReceiver != null)
onEventReceiver.SendMessage(onFunctionName);
void OnSwitchOff()
if (offEventReceiver != null)
offEventReceiver.SendMessage(offFunctionName);
好啦,设置好了之后,开关就可以使用了。
& & & &&& & &
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:10373次
排名:千里之外
原创:13篇
(2)(4)(1)(1)(5)174 of 179 people (97%) found this review helpful1 person found this review funny
Recommended
We used Spriter for all of the animations in We found the tool to be easy to use, and powerful. We were able to get seamless workflow between the animator and engine in Unity3D, and were able to produce a large variety of animated creatures and effects.We were able to achive two main technical goals using Spriter that would have been very difficult with traditional methods (e.g. sprite-sheets):1. We were able to present traditional-style 2D animation with far more stringent memory requirements than full sprite-sheet-based animations would have allowed. Since each animation is composed of many small sprites animated on a skeleton in Spriter, we were able to use far less memory at nominal performance cost to produce equivilent animations.2. We were able to do per-piece image swapouts, allowing us to do varied equipment and &reskin& monsters without special technology, we simply produced matching replacement images for the individual sub-sprites of a particular animation and swapped them out at runtime.Spriter was a solid tool that helped support a successful production release. We're very happy with Spriter, and are looking forward to using it in our upcoming projects.
We used Spriter for all of the animations in [url=/app/311720]Sproggiwood[/url]
We found the tool to be easy to use, and powerful. We were able to get seamless workflow between the animator and engine in Unity3D, and were able to produce a large variety of animated creatures and effects.
We were able to achive two main technical goals using Spriter that would have been very difficult with traditional methods (e.g. sprite-sheets):
1. We were able to present traditional-style 2D animation with far more stringent memory requirements than full sprite-sheet-based animations would have allowed. Since each animation is composed of many small sprites animated on a skeleton in Spriter, we were able to use far less memory at nominal performance cost to produce equivilent animations.
2. We were able to do per-piece image swapouts, allowing us to do varied equipment and &reskin& monsters without special technology, we simply produced matching replacement images for the individual sub-sprites of a particular animation and swapped them out at runtime.
Spriter was a solid tool that helped support a successful production release. We're very happy with Spriter, and are looking forward to using it in our upcoming projects.
Do you recommend this software?
Save Changes
Was this review helpful?
View mobile website

我要回帖

更多关于 win10 unity 不兼容 的文章

 

随机推荐