RefreshShader() public static method

/// 得到类型 /// 刷新shader
public static RefreshShader ( AssetBundle assetBundle ) : void
assetBundle UnityEngine.AssetBundle
return void
示例#1
0
        /// <summary>
        /// Instantiate Object
        /// </summary>
        /// <param name="original"></param>
        /// <returns></returns>
        public static GameObject Instantiate(GameObject original)
        {
            GameObject clone = GameObject.Instantiate(original);

#if UNITY_EDITOR
            LuaHelper.RefreshShader(clone as GameObject);
#endif
            return(clone);
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="original"></param>
        /// <param name="parent"></param>
        /// <returns></returns>
        public static GameObject InstantiateGlobal(GameObject original, GameObject parent = null)
        {
            var        tranformTa = original.transform;
            var        pos        = tranformTa.position;
            Quaternion rota       = tranformTa.rotation;
            Vector3    scale      = tranformTa.localScale;
            GameObject clone      = (GameObject)GameObject.Instantiate(original);

#if UNITY_EDITOR
            if (clone is GameObject)
            {
                LuaHelper.RefreshShader(clone as GameObject);
            }
#endif
            var transform = clone.transform;
            if (parent != null)
            {
                clone.transform.SetParent(parent.transform);
            }
            transform.position   = pos;
            transform.localScale = scale;
            transform.rotation   = rota;
            return(clone);
        }