A game about forced loneliness, made by TACStudios
1#if UNITY_EDITOR && UNITY_2021_1_OR_NEWER
2#define CAN_USE_CUSTOM_HELP_URL
3#endif
4
5using System;
6using System.Diagnostics;
7using UnityEngine;
8
9namespace UnityEngine.Timeline
10{
11#if CAN_USE_CUSTOM_HELP_URL
12
13 using UnityEditor.PackageManager;
14
15 [Conditional("UNITY_EDITOR")]
16 class TimelineHelpURLAttribute : HelpURLAttribute
17 {
18 const string k_BaseURL = "https://docs.unity3d.com/Packages/com.unity.timeline@";
19 const string k_MidURL = "/api/";
20 const string k_EndURL = ".html";
21 const string k_FallbackVersion = "latest";
22
23 static readonly string k_PackageVersion;
24
25 static TimelineHelpURLAttribute()
26 {
27 PackageInfo packageInfo = PackageInfo.FindForAssembly(typeof(TimelineAsset).Assembly);
28 k_PackageVersion = packageInfo == null ? k_FallbackVersion : packageInfo.version.Substring(0, 3);
29 }
30
31 public TimelineHelpURLAttribute(Type type)
32 : base(HelpURL(type)) {}
33
34 static string HelpURL(Type type)
35 {
36 return $"{k_BaseURL}{k_PackageVersion}{k_MidURL}{type.FullName}{k_EndURL}";
37 }
38 }
39#else //HelpURL attribute is `sealed` in previous Unity versions
40 [Conditional("UNITY_EDITOR")]
41 class TimelineHelpURLAttribute : Attribute
42 {
43 public TimelineHelpURLAttribute(Type type) { }
44 }
45#endif
46}