#pragma strictprivate var m_nframecount:int = 0;private var m_issubcount:int = 0;//falsefunction Update () { var f Speed:float = 1.0f;var Fangle:float = 50.0f;var Pcurrentpoint:vector3 = Transform.position;var Paxis:vector3 = new Vector3 (1.0f,0.0f,0.0f);//move Pcurrentpoint.x-= time.deltatime * Fspeed;transform.position = pcurrentpoint;//along the x-axis Rotates the transform along the given axis. Rotate (Paxis,time.deltatime*fangle);//transform. Rotate (Paxis*time.deltatime*fangle);//transform. Rotate (transform.forward*time.deltatime*fangle);//transform.localscale + = new Vector3 (2.0f,0.0f,0.0f);// Zoom in at 100 frames if (m_nframecount>=100) {Transform.localscale = new Vector3 (0.5f,1.0f,1.0f); m_nframecount = 100;m_ Issubcount = 1;} else if (m_nframecount <= 0) {Transform.localscale = new Vector3 (1.0f,1.0f,1.0f); m_nframecount = 0;m_issubcount = 0;} if (M_issubcount = = 1) {--m_nframecount;} Else{++m_nframecount;}}
The path of unity3d cultivation: moving and scaling a simple object cube