首页 > 其他 > 详细

Transform

时间:2017-08-27 10:37:56      阅读:207      评论:0      收藏:0      [点我收藏+]
 1 public class PlayerControll : MonoBehaviour
 2 {
 3     Transform playerTransform;
 4     Animation playerAnimation;
 5     Rigidbody playerRigidbody;
 6     public float moveSpeed;
 7     public float jumpAbility;
 8     bool canJump;
 9 
10     void Start()
11     {
12         //playerTransform = gameObject.transform;
13         //playerTransform = this.transform;
14         //playerTransform = transform;
15         playerTransform = GetComponent<Transform>();
16         playerAnimation = GetComponent<Animation>();
17         playerRigidbody = GetComponent<Rigidbody>();
18         Debug.Log(playerTransform.name);
19     }
20 }

12、13、14、15 都可以获取游戏对象的Transform。

Transform

原文:http://www.cnblogs.com/Peng18233754457/p/7439683.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!