Unity2019.3API教程(九)Transform.hasChanged

语法:public bool hasChanged;
判断GameObject对象Transform组件的属性是否被修改过,注意。如果修改了一个和原来相同的值,返回依然为true,演示如下:

   using UnityEngine;
   class hasChangedTest
   {
        void Start()
      {
           if (transform.hasChanged)
                {
                print("The transform has changed.");
                transform.hasChanged = false;
                }
             else
             {
                 print("The transform has not changed.");
                 transform.pos
             }
       }
    }

你可能感兴趣的:(Unity,API,c#,开发语言)