纳金网

标题: 不间断绘制立方体代码 [打印本页]

作者: 烟雨    时间: 2015-5-29 02:51
标题: 不间断绘制立方体代码
  1. using UnityEngine;
  2. using System.Collections;

  3. public class sssss : MonoBehaviour {
  4.     float t1 = 0;
  5.     int count = 0;
  6.         // Use this for initialization
  7.         void Start () {
  8.         
  9.         }
  10.         
  11.         // Update is called once per frame
  12.         void Update () {
  13.       
  14.         }
  15.     void FixedUpdate()
  16.     {
  17.         Ss();
  18.     }
  19.     void Ss()
  20.     {
  21.         t1 += 0.16f;

  22.         if (t1 > 1f)
  23.         {
  24.             print("s");
  25.             transform.Rotate(90, 0, 0);
  26.             t1 = 0f;
  27.             count++;

  28.         }
  29.         if (count == 5)
  30.         {
  31.             transform.Rotate(-90, 0, 0);
  32.             transform.Rotate(0, -90, 0);
  33.             count = 0;
  34.         } transform.Translate(0, 0, 1);
  35.     }
  36.    
  37. }
复制代码





欢迎光临 纳金网 (http://go.narkii.com/club/) Powered by Discuz! X2.5