摘要: function Start () { animation.wrapMode = WrapMode.Loop; animation["jump"].wrapMode = WrapMode.Once; animation["jump"].layer = 1; animation.Stop();}function Update () { if (Mathf.Abs(Input.GetAxis("Vertical")) 0.1) animation.CrossFade("run"); else animation.CrossFade("walk"); if (Input.GetKeyDown ( 阅读全文
posted @ 2010-12-15 16:39 softimagewht 阅读(241) 评论(0) 推荐(0)
摘要: ------------读取外部文本---------------------------var MyText: TextAsset; function OnGUI () {GUI.Label(Rect(10, 10, 500, 500), Text2.text);}-----------GUI函数 判断鼠标按下------------- if((Event.current.type == EventType.mouseDown) && (Event.current.button == 0)) { print("asdasdasd"); }-----------------------跳--- 阅读全文
posted @ 2010-12-09 09:05 softimagewht 阅读(296) 评论(0) 推荐(0)
摘要: class GUIWindowDemo extends EditorWindow{var windowRect = Rect (100,100,200,200);function OnGUI () {BeginWindows ();windowRect = GUILayout.Window (1, windowRect, DoWindow, "Hi There"); EndWindows (); }function DoWindow () {GUILayout.Button ("Hi");GUI.DragWindow (); }@MenuItem ("Test/GUIWindow Demo") 阅读全文
posted @ 2010-12-08 14:50 softimagewht 阅读(292) 评论(0) 推荐(0)
摘要: function OnMouseDown () {var hinges : HingeJoint[] = FindObjectsOfType(HingeJoint) as HingeJoint[];for (var hinge : HingeJoint in hinges) {hinge.useSpring = false;}}----------------------------------------------------//将场景中所有模型名写入数组getAllNamevar getAllName = new Array ();function Start() {var hinges 阅读全文
posted @ 2010-12-03 23:27 softimagewht 阅读(209) 评论(0) 推荐(0)
摘要: -----------------调用外部的EXE-----------------------using UnityEngine;using System.Collections;public class openexe: MonoBehaviour {// Use this for initializationvoid Start () { System.Diagnostics.Process... 阅读全文
posted @ 2010-12-01 14:21 softimagewht 阅读(234) 评论(0) 推荐(0)
摘要: -------------Player的代码------------------------var bullet:GameObject; //子弹var Dummy:GameObject;//虚拟体var playerSpeed:float;//左右移动操作速度static var fire=false; //是否开火function Update () { //操作代码 var antmove:... 阅读全文
posted @ 2010-12-01 10:30 softimagewht 阅读(287) 评论(0) 推荐(0)
摘要: public var fadeOutTexture : Texture2D;public var fadeSpeed = 0.3;var drawDepth = -1000;private var alpha = 1.0;private var fadeDir = -1;function OnGUI(){ alpha += fadeDir * fadeSpeed * Time.deltaTime;... 阅读全文
posted @ 2010-11-30 09:13 softimagewht 阅读(359) 评论(0) 推荐(0)
摘要: using UnityEngine;using System.Collections;public class Magnetic : MonoBehaviour{ public LayerMask m_MagneticLayers; //定义层 public Vector3 m_Position; //定义向量 public float m_Radius; //定义半径 public float ... 阅读全文
posted @ 2010-11-19 11:46 softimagewht 阅读(317) 评论(0) 推荐(0)
摘要: while $.numverts != 0 do( $.EditablePoly.SetSelection #Face #{1} $.EditablePoly.ConvertSelection #Face #Element polyOp.detachFaces $ $.selectedfaces asNode:on delete:on name:"object01")delete $ 阅读全文
posted @ 2010-11-19 10:28 softimagewht 阅读(201) 评论(0) 推荐(0)
摘要: 让Unity的js编辑器SciTEG永久支持中文假如你的代码中有中文这个设置是很爽的。以后注释也可以中文了。方法:1.用记事本打开C:\Program Files\Unity\Editor\Data\Tools\UniSciTE\SciTEGlobal.properties2.找到# Internationalisation 这一行下面的都是设置编码的(鄙视一下居然是Japanese )3.可以把... 阅读全文
posted @ 2010-11-17 16:00 softimagewht 阅读(4220) 评论(0) 推荐(1)