摘要: public class CameraShake : MonoBehaviour { // Use this for initialization Matrix4x4 originalProjection; float timer; void Start () { originalProjection = camera.projectionMatrix; //StartCoroutine(Shake(0.5f)); } // Update is called once per frame vo... 阅读全文
posted @ 2013-10-16 17:07 小薇林 阅读(469) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine;using System.Collections;public class StoryCamera_19 : MonoBehaviour { // Use this for initialization public Camera camera; public GameObject MainCamera; public GUISkin Story_01; private string[] DialogText_0; private string[] DialogText_1; private ... 阅读全文
posted @ 2013-10-16 16:12 小薇林 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 一种以欧拉角度量的旋转。transform.eulerAngles(x,y,z);表示绕x,y,z分别旋转的度数。注意,只能对其设置绝对角度值,不建议使用+=来设置角度,因为超过360度会出现错误,若需要使用+=建议使用Transform.rotate(x,y,z)。且建议每次赋值都赋全(x,y,z)三个参数。即不建议使用诸如eulerAngles.x=10这样的赋值。demo:publicTransformtarget;publicfloatyRotation=5f;publicfloatxRotation=5f;//UsethisforinitializationvoidStart(){} 阅读全文
posted @ 2013-10-16 15:56 小薇林 阅读(209) 评论(0) 推荐(0) 编辑
摘要: public float CalFPS() { ++FPS_frames; float timeNow = Time.realtimeSinceStartup; if (timeNow > FPS_lastInterval + FPS_updateInterval) { FPS_fps = (float)(FPS_frames / (timeNow - FPS_lastInterval)); FPS_frames = 0; ... 阅读全文
posted @ 2013-10-16 15:13 小薇林 阅读(237) 评论(0) 推荐(0) 编辑