Unity小技巧

Unity小技巧

安卓手机连接Unity Profiler

adb forward tcp:54999 localabstract:Unity-com.tencent.tmgp.ztj

文件默认打开方式

#if UNITY_EDITOR
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEngine;

public class OpenFileEx {

    [OnOpenAsset]
    public static bool OpenShaderAsset(int instanceID, int line)
    {
        if (EditorUtility.InstanceIDToObject(instanceID) is Shader)
        {
            string assetPath = AssetDatabase.GetAssetPath(instanceID);
            System.Diagnostics.Process.Start(Application.dataPath + "/../" + assetPath);
            return true;
        }
        return false;
    }
}
#endif

脚本生命周期

Unity脚本生命周期

Donate
  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
  • Copyrights © 2022 Mr.Yao
  • Visitors: | Views:

请我喝杯咖啡吧~

支付宝
微信