protected virtual void Awake()
        {
            string assetPath = "StandardAssets/Textures";

            if (logoLightTheme == null)
            {
                logoLightTheme = (Texture2D)AssetDatabase.LoadAssetAtPath(MixedRealityToolkitFiles.MapRelativeFilePath($"{assetPath}/MRTK_Logo_Black.png"), typeof(Texture2D));
            }

            if (logoDarkTheme == null)
            {
                logoDarkTheme = (Texture2D)AssetDatabase.LoadAssetAtPath(MixedRealityToolkitFiles.MapRelativeFilePath($"{assetPath}/MRTK_Logo_White.png"), typeof(Texture2D));
            }

            if (helpIcon == null)
            {
                helpIcon = EditorGUIUtility.IconContent("_Help").image;
            }

            if (WarningIconContent == null)
            {
                WarningIconContent = new GUIContent(EditorGUIUtility.IconContent("console.warnicon").image,
                                                    "This profile is part of the default set from the Mixed Reality Toolkit SDK. You can make a copy of this profile, and customize it if needed.");
            }
        }
        private static void LoadTexture(ref Texture2D tex, string filename)
        {
            const string assetPath = "StandardAssets/Textures";

            if (tex == null)
            {
                tex = (Texture2D)AssetDatabase.LoadAssetAtPath(MixedRealityToolkitFiles.MapRelativeFilePath(Path.Combine(assetPath, filename)), typeof(Texture2D));
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Load pose data from files.
        /// </summary>
        public static void LoadGesturePoses()
        {
            string[] gestureNames = Enum.GetNames(typeof(GestureId));
            string   basePath     = Path.Combine("InputSimulation", "ArticulatedHandPoses");

            for (int i = 0; i < gestureNames.Length; ++i)
            {
                string relPath = Path.Combine(basePath, String.Format("ArticulatedHandPose_{0}.json", gestureNames[i]));
                string absPath = MixedRealityToolkitFiles.MapRelativeFilePath(MixedRealityToolkitModuleType.Services, relPath);
                LoadGesturePose((GestureId)i, absPath);
            }
        }
        protected virtual void Awake()
        {
            string assetPath = "StandardAssets/Textures";

            if (logoLightTheme == null)
            {
                logoLightTheme = (Texture2D)AssetDatabase.LoadAssetAtPath(MixedRealityToolkitFiles.MapRelativeFilePath($"{assetPath}/MRTK_Logo_Black.png"), typeof(Texture2D));
            }

            if (logoDarkTheme == null)
            {
                logoDarkTheme = (Texture2D)AssetDatabase.LoadAssetAtPath(MixedRealityToolkitFiles.MapRelativeFilePath($"{assetPath}/MRTK_Logo_White.png"), typeof(Texture2D));
            }
        }
        public void StartUp()
        {
            FindShaders();

            string assetPath = "StandardAssets/Textures";

            if (logoLightTheme == null)
            {
                logoLightTheme = (Texture2D)AssetDatabase.LoadAssetAtPath(MixedRealityToolkitFiles.MapRelativeFilePath($"{assetPath}/MRTK_Logo_Black.png"), typeof(Texture2D));
            }

            if (logoDarkTheme == null)
            {
                logoDarkTheme = (Texture2D)AssetDatabase.LoadAssetAtPath(MixedRealityToolkitFiles.MapRelativeFilePath($"{assetPath}/MRTK_Logo_White.png"), typeof(Texture2D));
            }
        }
        private static Texture2D GetControllerTextureInternal(string relativeTexturePath, Handedness handedness, string suffix)
        {
            string handednessSuffix = string.Empty;

            if (handedness == Handedness.Left)
            {
                handednessSuffix = "_left";
            }
            else if (handedness == Handedness.Right)
            {
                handednessSuffix = "_right";
            }

            string themeSuffix = EditorGUIUtility.isProSkin ? "_white" : "_black";

            string fullTexturePath = MixedRealityToolkitFiles.MapRelativeFilePath(MixedRealityToolkitModuleType.StandardAssets, $"{relativeTexturePath}{handednessSuffix}{themeSuffix}{suffix}.png");

            return((Texture2D)AssetDatabase.LoadAssetAtPath(fullTexturePath, typeof(Texture2D)));
        }