using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using Beginner_s_Tutorial.ui;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
using UnityEngine.Video;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Beginner's Tutorial")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Beginner's Tutorial")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("643cc4d2-11e8-49c8-97ed-3b9e8d10245c")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace Beginner_s_Tutorial
{
[BepInPlugin("pig_trotters.TutorialPlugin", "TutorialPlugin", "1.0.0")]
public class TutorialPlugin : BaseUnityPlugin
{
private Harmony _harmony;
public static TutorialPlugin Instance;
private bool _f3WasDown;
private void Awake()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
Instance = this;
_harmony = new Harmony("pig_trotters.TutorialPlugin");
_harmony.PatchAll();
TutorialUI.Init();
((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin pig_trotters.TutorialPlugin is loaded! Press F3 to toggle the tutorial book.");
}
private void Update()
{
bool keyDown = Input.GetKeyDown((KeyCode)284);
if (keyDown && !_f3WasDown)
{
TutorialUI.Toggle();
}
_f3WasDown = keyDown;
}
public static void LogInfo(string message)
{
if ((Object)(object)Instance != (Object)null)
{
((BaseUnityPlugin)Instance).Logger.LogInfo((object)message);
}
}
}
[HarmonyPatch(typeof(CharacterMovement), "CameraLook")]
public static class CharacterMovement_CameraLook_Patch
{
[HarmonyPrefix]
private static bool Prefix()
{
return !TutorialUI.IsVisible;
}
}
[HarmonyPatch(typeof(CursorHandler), "Update")]
public static class CursorHandler_Update_Patch
{
[HarmonyPrefix]
private static bool Prefix()
{
return !TutorialUI.IsVisible;
}
}
public static class PluginInfo
{
public const string PLUGIN_GUID = "pig_trotters.TutorialPlugin";
public const string PLUGIN_NAME = "TutorialPlugin";
public const string PLUGIN_VERSION = "1.0.0";
}
}
namespace Beginner_s_Tutorial.ui
{
public static class TutorialUI
{
private class PageItem
{
public string Label;
public string TargetKey;
}
private class PageData
{
public string Key;
public string Title;
public string LeftHint;
public string LeftVideoPath;
public string LeftImagePath;
public string ConceptText;
public string HowToText;
public string TheoryText;
public string NoteText;
public List<PageItem> Items;
}
private class VideoCache
{
public string Path;
public VideoPlayer Player;
public RenderTexture Texture;
public bool Prepared;
public bool Ready => Prepared && (Object)(object)Player != (Object)null;
}
private class PageDriver : MonoBehaviour
{
}
[CompilerGenerated]
private static class <>O
{
public static UnityAction <0>__OnBackClicked;
public static UnityAction <1>__Hide;
}
private const float BookWidth = 1180f;
private const float BookHeight = 700f;
private const float LeatherBorder = 22f;
private const float SpineWidth = 10f;
private static readonly Color LeatherColor = new Color(0.24f, 0.17f, 0.11f, 1f);
private static readonly Color LeatherInner = new Color(0.35f, 0.26f, 0.17f, 1f);
private static readonly Color ParchmentColor = new Color(0.95f, 0.89f, 0.76f, 1f);
private static readonly Color ParchmentEdge = new Color(0.87f, 0.79f, 0.62f, 1f);
private static readonly Color TextColor = new Color(0.25f, 0.15f, 0.08f, 1f);
private static readonly Color DividerColor = new Color(0.55f, 0.42f, 0.25f, 0.5f);
private static readonly Color ButtonNormal = new Color(0.92f, 0.85f, 0.7f, 0.6f);
private static readonly Color ButtonHover = new Color(0.88f, 0.72f, 0.45f, 0.85f);
private static readonly Color ButtonPressed = new Color(0.8f, 0.62f, 0.35f, 0.9f);
private static readonly Color BackBtnColor = new Color(0.35f, 0.25f, 0.15f, 0.9f);
private static readonly List<PageData> Pages = new List<PageData>();
private static readonly Dictionary<string, int> KeyToIndex = new Dictionary<string, int>();
private static GameObject _canvasGO;
private static RectTransform _leftPageContent;
private static RectTransform _rightPageContent;
private static RectTransform _scrollContent;
private static ScrollRect _scrollRect;
private static Text _titleText;
private static RectTransform _backBtnRect;
private static CanvasGroup _pageFade;
private static RawImage _leftVideoRaw;
private static VideoPlayer _videoPlayer;
private static Image _leftPlaceholder;
private static Text _leftPlaceholderLabel;
private static PageDriver _driver;
private static bool _isVisible;
private static Font _cachedFont;
private static readonly Stack<int> _navStack = new Stack<int>();
private static int _currentPage;
private static CursorLockMode _savedLockMode;
private static bool _savedCursorVisible;
private static float _savedTimeScale = 1f;
private static bool _videosPreloaded;
private static readonly Dictionary<string, VideoCache> _videoCache = new Dictionary<string, VideoCache>();
private static string _currentVideoKey = "";
public static bool IsVisible => _isVisible;
private static void BuildPageData()
{
Pages.Clear();
KeyToIndex.Clear();
Add("toc", new PageData
{
Title = "目 录",
LeftHint = "山峰插画",
Items = new List<PageItem>
{
new PageItem
{
Label = "1. 常用技巧",
TargetKey = "cat_basics"
},
new PageItem
{
Label = "2. 场景技巧",
TargetKey = "cat_scenes"
},
new PageItem
{
Label = "3. 爬山攻略",
TargetKey = "cat_routes"
}
}
});
Add("cat_basics", new PageData
{
Title = "常用技巧",
LeftHint = "常用技巧图示",
Items = new List<PageItem>
{
new PageItem
{
Label = "大跳",
TargetKey = "d_bigjump"
},
new PageItem
{
Label = "小跳",
TargetKey = "d_smalljump"
},
new PageItem
{
Label = "抓爬",
TargetKey = "d_grab"
},
new PageItem
{
Label = "侧爬",
TargetKey = "d_sideclimb"
},
new PageItem
{
Label = "登墙扑",
TargetKey = "d_wallleap"
},
new PageItem
{
Label = "兔子跳",
TargetKey = "d_rabbitjump"
},
new PageItem
{
Label = "跳点",
TargetKey = "d_jumppoint"
},
new PageItem
{
Label = "二段跳",
TargetKey = "d_doublejump"
},
new PageItem
{
Label = "二段大跳",
TargetKey = "d_doublebigjump"
},
new PageItem
{
Label = "二段冲刺",
TargetKey = "d_doubleshift"
}
}
});
Add("cat_scenes", new PageData
{
Title = "场景技巧",
LeftHint = "场景技巧图示",
Items = new List<PageItem>
{
new PageItem
{
Label = "绳结跳",
TargetKey = "d_ropejump"
},
new PageItem
{
Label = "晒伤遮挡",
TargetKey = "d_sunblock"
},
new PageItem
{
Label = "快速缓冲",
TargetKey = "d_fastbrake"
},
new PageItem
{
Label = "雾沼围栏",
TargetKey = "d_fogfence"
},
new PageItem
{
Label = "飞雷神",
TargetKey = "d_FlyingThunderGod"
},
new PageItem
{
Label = "挤出缝隙",
TargetKey = "d_SqueezingGaps"
},
new PageItem
{
Label = "消除诅咒",
TargetKey = "d_RemoveCurse"
},
new PageItem
{
Label = "消除昏睡",
TargetKey = "d_RemoveSleep"
},
new PageItem
{
Label = "拾取不可携带的物品",
TargetKey = "d_PickUpNonPortableItems"
},
new PageItem
{
Label = "超级跳跃",
TargetKey = "d_superJump"
},
new PageItem
{
Label = "诅咒头骨",
TargetKey = "d_CurseTheSkull"
},
new PageItem
{
Label = "潘多拉使用法则",
TargetKey = "d_Pandora"
},
new PageItem
{
Label = "消除骷髅诅咒",
TargetKey = "d_RemoveSkullCurse"
},
new PageItem
{
Label = "更多站立点",
TargetKey = "d_moreStand"
},
new PageItem
{
Label = "城塞箭矢",
TargetKey = "d_arrow"
}
}
});
Add("cat_routes", new PageData
{
Title = "爬山攻略",
LeftHint = "路线图",
Items = new List<PageItem>
{
new PageItem
{
Label = "观察路线",
TargetKey = "d_obsroute"
},
new PageItem
{
Label = "体力管理",
TargetKey = "d_stamina"
},
new PageItem
{
Label = "道具使用",
TargetKey = "d_anchor"
},
new PageItem
{
Label = "技巧搭配",
TargetKey = "d_SkillMatching"
}
}
});
Add("d_bigjump", new PageData
{
LeftVideoPath = "大跳.mp4",
Title = "大跳",
LeftHint = "大跳图示",
ConceptText = "大跳是指在奔跑状态下按住冲刺键(Shift)再跳跃,获得比普通跳跃更远的水平距离。",
HowToText = "1. 按住 W 向前跑动\n2. 按住 Shift 进入冲刺状态\n3. 在冲刺中按空格跳跃\n关键:保持 Shift 不松开直到落地。",
TheoryText = "冲刺状态下角色水平移动速度提升,跳跃初速度叠加冲刺速度,因此抛物线更远。大跳适合跨越宽阔沟壑或快速到达对面平台。",
NoteText = "大跳适用于要从高向低处跳下距离较远时使用,但体力消耗较大,在可以判断与落点距离且非必要使用大跳的情况下优先使用小跳,或者用二段大跳(同样的体力消耗但跳跃距离更远)"
});
Add("d_smalljump", new PageData
{
LeftVideoPath = "小跳.mp4",
Title = "小跳",
LeftHint = "小跳图示",
ConceptText = "小跳是先起跳再按冲刺键,在空中获得一次中等距离的水平推进,体力消耗较少。",
HowToText = "1. 按下w与空格向前跳跃\n2. 在空中按住 Shift。",
TheoryText = "当在空中按下shift后,角色会获得一个向视角方向的推力,该推力不会消耗体力但可以给角色一个加速度,以实现比普通跳跃更远的距离,与大跳的区别就是体力效果要少,但距离也要短,适合快速的连续跳跃。",
NoteText = "shift要按住,切记shift比空格触发要晚,如果同时或过早按下会变为大跳。"
});
Add("d_grab", new PageData
{
LeftVideoPath = "抓爬.mp4",
Title = "抓爬",
LeftHint = "抓爬图示",
ConceptText = "抓爬是指用有节奏的方式反复点击鼠标左键,在岩壁上交替抓握以减少体力消耗并更快上升(抓爬时一定尽量保持视角垂直于攀爬的墙壁,且可以进行一个10-15度范围的视角上下微调以达到更好的效果,具体参考左侧示例)。",
HowToText = "1. 按住w与shift然后点击鼠标左键进入攀爬状态\n2. 有节奏地松-抓-松去点击墙壁,节奏大约每秒 1-2 次。",
TheoryText = "持续按住左键攀爬会以恒定速率消耗体力,而抓爬利用了游戏机制:每次松开左键会有极短的触发体力恢复的时间窗口且重置恒定速率的体力消耗,而当再次按住左键时又会开始新一轮计算消耗,就这样重置-计算-重置,从而达到每次都以刚开始攀爬时的消耗为基准,从而实现更少体力消耗;shift键可以保证人物可以贴近墙面并且给予角色一个向墙壁的推力;视角的上下微调是利用shift可以向视角所看方向增加推力的原理实现向上进行更高且体力消耗更少的攀爬效果(注意:视角调整要适度,过度调整会触发shift的冲刺机制从而会消耗更多的体力)。",
NoteText = "视角一定要垂直于你所攀爬的墙壁(例:攀爬墙壁与水平面呈100度夹角,那么你的视角就应该与这100度进行垂直后再进行细微视角调整),不可攀爬墙壁与水平面呈小于90度的面(反斜面),当小于90度时每次抓爬的w与shift给予玩家向上向前的力会被头上斜面的法线所抵消从而会导致爬了许久根本没有上升多少高度,如果是反斜面的情况慢慢爬要比抓爬效果好"
});
Add("d_sideclimb", new PageData
{
LeftVideoPath = "侧爬.mp4",
Title = "侧爬",
LeftHint = "侧爬图示",
ConceptText = "侧爬是指在悬挂状态下在墙壁上的左右移动,沿岩壁横向转移位置,用于达到墙壁无攀爬点时的另一端。",
HowToText = "1. 悬挂在岩壁上\n2. 按 A 或 D 同时按住shift和w键向左右移动\n3. 配合<抓爬>技巧且视角向攀爬侧看,视角的角度尽量与所攀爬墙壁的夹角处于45度左右\n4.攀爬时视角可以适当调整以达到最佳效果。",
TheoryText = "利用抓爬省体力原理,去进行在墙壁上向左或向右的移动,w可保持角色一直处于向上状态且不会在攀爬时向下缓慢掉落,shift可保持角色贴近墙面且给予角色一个向视角侧一个推力(如与墙壁夹角处于45度时会向攀爬方向的视角所看的地方给予推力而不是直接向墙壁去推,以达到更远距离的效果)。",
NoteText = "在攀爬反斜面时,视角调整要更加谨慎,角度过大就会触发shift冲刺机制从而导致体力消耗增加,可以利用每次抓爬时重置视角的操作来降低体力过多消耗的情况,如<视角垂直墙壁90度后再向攀爬方向增加15度达到105度> - 抓 - <视角重置为垂直墙壁90度> - 松 - <视角垂直墙壁90度后再向攀爬方向增加15度达到105度> - 抓。"
});
Add("d_wallleap", new PageData
{
LeftVideoPath = "登墙扑.mp4",
Title = "登墙扑",
LeftHint = "登墙扑图示",
ConceptText = "登墙扑是在体力耗尽前的一瞬间,通过松-抓-冲刺,实现无体力状态下的向上爆发移动。",
HowToText = "1. 在岩壁上爬到体力即将耗尽\n2. 松开左键让角色短暂脱离墙面\n3. 立刻调整视角向上至可点击的极限距离点击鼠标左键并按一下shift\n4. 角色向上前方扑出一段距离后如果处于可站立的边缘连续狂点空格以达到强制站上可站立位置的效果。",
TheoryText = "在体力耗尽前会触发一个0.5s的缓冲窗口期,在该窗口期时不会立刻锁死攀爬行为,利用该窗口以达到再次点击左键实现抓墙壁的效果(视角越向上攀爬效果越好)和shift的冲刺效果,用来实现无体力状态下的向上爆发移动,而狂点空格行为是为了让角色能够稳定站立在可站立的位置上,因为如果角色站在墙壁边缘时会缓慢给予一个向下的力,如果不点空格来重置身位则会导致无法站立边缘。",
NoteText = "一定要卡好时机,可以过早但不能过晚,过晚触发会导致shift冲刺失败。"
});
Add("d_rabbitjump", new PageData
{
LeftVideoPath = "兔子跳.mp4",
Title = "兔子跳",
LeftHint = "兔子跳图示",
ConceptText = "兔子跳是在体力耗尽时,按住前进和冲刺键连续小跳,实现比走路更快的地面移动方式。",
HowToText = "1. 按住 W + Shift\n3. 快速连续点击空格\n角色会像兔子一样连续跳跃前进。",
TheoryText = "地面奔跑有最大速度上限,但跳跃时的水平速度衰减较慢。连续短跳可以让角色反复获得跳跃初速度,维持在较高的移动速度,达到与纯奔跑相差无几的速度效果。"
});
Add("d_jumppoint", new PageData
{
LeftVideoPath = "跳点.mp4",
Title = "跳点",
LeftHint = "跳点图示",
ConceptText = "跳点是利用体力耗尽时仍可点击墙壁的机制,强制将身位重置到所点击位置的上方可站立位置。",
HowToText = "1. 体力耗尽\n2. 按住w与shift并点击墙壁\n3. 身位向上重置后连点空格。",
TheoryText = "w与shift给予玩家一个向上向前的力,而点击墙壁则会触发身位重置机制,两者结合将会让角色向上进行一次伪攀爬效果,而连点空格可参考登墙扑(重置身位直到可稳定站立至边缘)。",
NoteText = "目标墙壁一定要是较低且上方可站立,过高的墙壁会导致身位重置失败。"
});
Add("d_doublejump", new PageData
{
LeftVideoPath = "二段跳.mp4",
Title = "二段跳(后空翻)",
LeftHint = "二段跳图示",
ConceptText = "二段跳是指利用后空翻动作在空中按下空格键,用一个空格的体力实现两个空格的高度效果。",
HowToText = "1. 按r键选择动作栏第二页除后空翻外的任何表情\n2. 再次按下r键选择后空翻表情\n3. 在后空翻动作达到最高点时按下空格键。",
TheoryText = "后空翻可以使玩家离开地面一定高度,而在最高点时按下空格即可达到一个腾空的效果;第1步做除后空翻外的其他动作是为了保留第一个动作的后摇,从而达到取消后空翻动作有概率摔倒的后摇,实现百分百后空翻不摔倒。",
NoteText = "第1与第2步中间衔接不可太慢,太慢会导致第1步后摇结束从而增加后空翻摔倒的风险;第2与第3步的中间要延迟大概三四百毫秒然后再按空格键,过早或过晚都会导致空格键无法按出,具体延迟多久需自己把握。"
});
Add("d_doublebigjump", new PageData
{
LeftVideoPath = "二段大跳.mp4",
Title = "二段大跳",
LeftHint = "二段大跳图示",
ConceptText = "二段大跳是在二段跳的基础上同时配合冲刺和向前输入,实现远距离的空中跨越。",
HowToText = "1. 做出二段跳的1、2步\n2. 按住w与shift\n3. 按下空格键。",
TheoryText = "二段跳的上升速度叠加冲刺的水平速度后,抛物线比普通二段跳更平更远。这个组合技适合跨越较大的缺口,或从低处直接跃上高处平台,但需要准确的距离判断。",
NoteText = "二段跳一定要运用熟练,对比与二段跳,二段大跳只是多按一个shift键,但空格按下的时机在某些特殊位置的触发点范围会极短,建议在按空格的时机尽量早一些,二段大跳一般只是用来向前过远处跳跃,所以对空格过晚按下多增加的那点高度不是很在意。"
});
Add("d_doubleshift", new PageData
{
LeftVideoPath = "二段冲刺.mp4",
Title = "二段冲刺",
LeftHint = "二段冲刺图示",
ConceptText = "利用两段体力体力耗尽前的冲刺行为,用最少的体力进行较远攀爬的行为。",
HowToText = "1. 需保证有存在额外体力,即使额体很少\n2. 主体力耗尽前一刻按下冲刺\n3. 额外体力耗尽前再次按下冲刺。",
TheoryText = "利用体力可冲刺的原理,在两段体力每次快耗尽前做出冲刺动作。",
NoteText = "需把握好主体力耗尽前的时机,过晚按下会消耗额外体力从而会导致直接用额外体力去进行冲刺造成体力浪费(不可在主体力耗尽前用登墙扑技巧,因为登墙扑是利用体力耗尽前的窗口期进行,但如果存在额外体力,那么窗口期判断就会失效,从而直接开始消耗额外体力)。"
});
Add("d_ropejump", new PageData
{
LeftVideoPath = "绳结跳.mp4",
Title = "绳结跳",
LeftHint = "绳结跳图示",
ConceptText = "利用绳子以达到更高的位置。",
HowToText = "1. 按e抓住绳子\n2. 点击空格 \n3. 按住shift \n4. 按下鼠标左键开始攀爬。",
TheoryText = "利用二段跳可以把绳结打到非常高的位置,而角色视角可以直接抓到很高距离的绳结,利用此原理以实现达到比二段跳更高的位置。"
});
Add("d_sunblock", new PageData
{
LeftVideoPath = "晒伤遮挡.mp4",
Title = "晒伤遮挡",
LeftHint = "晒伤遮挡图示",
ConceptText = "用道具来遮挡方山阳光以免除晒伤debuff。",
HowToText = "1. 观察太阳位置\n2. 切出较大遮挡物面向太阳。",
TheoryText = "游戏道具都具有实体和阴影,可以利用较大物品的阴影来遮挡阳光(注意:遮挡物需要足够大,如背包、童军饼干、绿色宾邦等等)。"
});
Add("d_fastbrake", new PageData
{
LeftVideoPath = "快速缓冲.mp4",
Title = "快速缓冲",
LeftHint = "快速缓冲图示",
ConceptText = "从高处下落时连点左键以获得缓冲效果。",
HowToText = "1. 高处跳下时靠近墙面\n2. 贴近墙面连续点击左键。",
TheoryText = "游戏角色拥有重力效果,可以利用快速点击左键来每次重置少许惯性达到取消下落后摇或减少落地冲击的目的。"
});
Add("d_fogfence", new PageData
{
LeftVideoPath = "雾沼围栏.mp4",
Title = "雾沼围栏",
LeftHint = "雾沼围栏图示",
ConceptText = "利用围栏每隔一段距离出现的可站立铁柱,进行一个快速移动的操作。",
HowToText = "1. 站在首端铁柱上\n2. 利用二段大跳向下一个铁柱进行跳跃。",
TheoryText = "每个铁柱之间刚好可以容纳一个二段大跳的距离,利用这一点进行快速翻越。",
NoteText = "二段大跳一定要打出来,失误会导致跳跃过近从而落在尖锐处扣血,建议二段大跳熟练后尝试。"
});
Add("d_FlyingThunderGod", new PageData
{
LeftVideoPath = "飞雷神.mp4",
Title = "飞雷神",
LeftHint = "飞雷神图示",
ConceptText = "利用仙人球做出的快速飞行操作。",
HowToText = "1. 手持仙人球按住Q键并且拉满\n2. 同时按住鼠标左键。\n3. 松开Q键,但左键不要松。\n4. 视角一直跟随仙人球。",
TheoryText = "当松开q丢出仙人球时,手中仙人球会被销毁然后在丢出的起始位置生成一个新的仙人球并赋予其一个抛物线的力,而角色的左键本意为攀爬,按下时会向视角前射出一条射线以判断是否可攀爬,这条射线正好击中飞出的仙人球触发攀爬给予角色一个向仙人球的拉力,从而实现角色跟随仙人球飞跃的效果。",
NoteText = "版本更新后仙人球生成后的位置以及抛物线与略微变化,可以在丢出的一瞬间视角稍微下移来跟随仙人球,这样成功概率更大(向上角度尽量不要超过30度,且视角要使用看向仙人球以防止半空突然断开拉力然后掉下去)。"
});
Add("d_SqueezingGaps", new PageData
{
LeftVideoPath = "挤出缝隙.mp4",
Title = "挤出缝隙",
LeftHint = "挤出缝隙图示",
ConceptText = "利用切换手中道具从而达到钻过缝隙的操作。",
HowToText = "1. 按住w与shift\n2. 面向缝隙切换手中道具。\n3. 身体卡进墙壁后选择可攀爬的墙面攀爬并按下shift然后再次切换物品",
TheoryText = "切换出物品时会有3帧的无碰撞检测,且结束后会重置角色身体姿态达到向前挤压的现象,从而实现切换物品以达到挤过缝隙的操作。",
NoteText = "当缝隙过小时手中切换物品不宜过大,过大的物品碰撞开启检测后会将角色向后推出;卡进墙壁后尽量找攀爬点让自己的身体进一步固定然后再切换物品。"
});
Add("d_RemoveCurse", new PageData
{
LeftVideoPath = "消除诅咒.mp4",
Title = "消除诅咒",
LeftHint = "消除诅咒图示",
ConceptText = "曼德拉草消除诅咒。",
HowToText = "1. 将曼德拉草烤熟服用。",
TheoryText = "曼德拉草烤熟后可消除诅咒,可通过关闭声音里的音效来消除曼德拉草的昏睡效果。"
});
Add("d_RemoveSleep", new PageData
{
LeftVideoPath = "消除昏睡.mp4",
Title = "消除昏睡",
LeftHint = "消除昏睡图示",
ConceptText = "能量饮料可以重置当前昏睡值。",
HowToText = "1. 在昏睡值过多时喝下能量饮料。",
TheoryText = "喝下能量饮料后会清空目前所有睡眠。",
NoteText = "睡眠过多时使用更好(除非想要饮料的冲刺效果)。"
});
Add("d_PickUpNonPortableItems", new PageData
{
LeftVideoPath = "拾取不可携带的物品.mp4",
Title = "拾取不可携带的物品",
LeftHint = "拾取不可携带的物品图示",
ConceptText = "利用绳结等物品可将不可携带的物品装入手中快捷栏。",
HowToText = "1. 抓在绳结等物品上。\n2. 对着不可携带的物品按下e",
TheoryText = "角色处于攀爬状态时isClimbing为true,但如果角色处于绳索、链锁或藤蔓上时只会触发isRopeClimbing的true,而拾取物品只会检测isClimbing,相当于角色在绳索上时会绕过拾取不可携带物品时的isClimbing判断机制,从而直接拾取不可携带物品。",
NoteText = "包括但不限于绳子、链锁、藤蔓、绳索炮等等。"
});
Add("d_superJump", new PageData
{
LeftVideoPath = "超级跳跃.mp4",
Title = "超级跳跃",
LeftHint = "超级跳跃图示",
ConceptText = "反重力效果遇上弹力菇的上升加速度增强。",
HowToText = "1. 角色存在反重力效果。\n2. 踩下弹力菇",
TheoryText = "反重力效果会放大跳跃效果,增加滞空时长,当与弹力菇的向上加速度结合时会产生更强的上升效果。",
NoteText = "除了宝石,森蕈的蘑菇有时也会有反重力效果;不妨试试森蕈的蘑菇,会发生不一样的化学反应。"
});
Add("d_CurseTheSkull", new PageData
{
LeftVideoPath = "诅咒头骨.mp4",
Title = "诅咒头骨",
LeftHint = "诅咒头骨图示",
ConceptText = "摧毁头骨以实现效果。",
HowToText = "1. 将头骨丢入岩浆中",
TheoryText = "只要摧毁头骨就可以实现效果,并不局限于献祭玩家,除了岩浆外,任何其他的可以摧毁头骨都可以触发,如炸弹等。"
});
Add("d_Pandora", new PageData
{
LeftVideoPath = "潘多拉使用法则.mp4",
Title = "潘多拉使用法则",
LeftHint = "潘多拉使用法则图示",
ConceptText = "合理使用潘多拉以获取最佳状态。",
HowToText = "1. 在状态不健康时使用潘多拉",
TheoryText = "潘多拉的判定会先消除当前所有负面效果,然后随机给予角色正负面状态以及每个状态的随机数值,虽然是在赌概率,但往往在不健康时使用都可以达到较好状态(重生之我是赌狗!)。",
NoteText = "切记不要在状态良好时使用,这样收益最低。"
});
Add("d_RemoveSkullCurse", new PageData
{
LeftVideoPath = "消除骷髅诅咒.mp4",
Title = "消除骷髅诅咒",
LeftHint = "消除骷髅诅咒图示",
ConceptText = "消除骷髅诅咒。",
HowToText = "1. 食用奶白金。\n2. 食用潘多拉",
TheoryText = "骷髅状态是对掉血敏感,但奶白金的无敌效果可以免除伤害,利用这一点可以在不会死亡的情况下重置当前诅咒状态。"
});
Add("d_moreStand", new PageData
{
LeftVideoPath = "更多站立点.mp4",
Title = "更多站立点",
LeftHint = "更多站立点图示",
ConceptText = "利用墙上生长物品以达到站立目的。",
HowToText = "1. 站在物品上对准墙壁按住w。",
TheoryText = "墙上所生长物品都具有碰撞箱,利用这一点以达到勉强站立且回体效果。"
});
Add("d_arrow", new PageData
{
LeftVideoPath = "城塞箭矢.mp4",
Title = "城塞箭矢",
LeftHint = "城塞箭矢图示",
ConceptText = "利用道具引导箭矢以安全通过。",
HowToText = "1. 让物品经过箭矢瞄准线。",
TheoryText = "箭矢的瞄准只会检测具有碰撞箱的物品,所以可以将物品放置过经过瞄准线即可引导出箭矢发射。",
NoteText = "箭矢只会发射三根,且发射后会有几秒的延迟,延迟过后仍可继续发射。"
});
Add("d_obsroute", new PageData
{
Title = "观察路线",
LeftHint = "观察路线图示",
ConceptText = "通过观察路线来规划攀爬路径。",
HowToText = "1. 开始时观察整座山体,判断左中右哪里更好爬\n2. 在攀爬过程中根据实际情况调整路线\n3. 向上优先级高于向左或向右\n4.在决定要攀爬哪个方向时一定要看后续衔接的路线是否可行。",
NoteText = "爬山不是一直走一个方向就可以登顶的事情,而是需要根据实际情况调整路线,灵活运用技巧使你可选择的路线更多,体力充足时可以根据经验判断头顶较高点或其他方向无法看到后续路线的位置是否可站立,可先攀爬一半距离观看后续路线是否可行,然后回头等体力拉满再决定是否进行攀爬(尽量留足额外体力以防止技巧失误带来的更多体力消耗)。"
});
Add("d_stamina", new PageData
{
Title = "体力管理",
LeftHint = "管理体力图示",
ConceptText = "体力是爬山的核心资源,合理管理体力才能有利于后续的攀爬。",
HowToText = "1.尽量不要在同一个位置逗留,这样会持续饥饿\n2. 合理拿取道具,只留需要的就可以,不要看到箱子就要去开\n3. 多观察所攀爬的路线上是否存在孢子、毒球等,避免负面状态\n4. 额外体力尽量保留,有利于后续攀爬失误时保命。",
NoteText = "持续饥饿会影响后续攀爬,尽量做到利用路线上的食物补充而不是依赖去开箱,箱子如果顺路可以开,但如果在较远的地方要根据当前情况再决定是否过去,比如需要道具、医疗等等,非必要情况尽量不要为了开箱而开箱,而是为了道具而开箱,道具只是辅助物品,良好的体力才是决定能否轻松攀爬的关键(比如在某处逗留过久,本来之前可以爬上的位置现在无法上去,导致来回更换路线然后饥饿造成恶性循环)。"
});
Add("d_anchor", new PageData
{
Title = "道具使用",
LeftHint = "道具使用图示",
ConceptText = "合理利用道具来辅助攀爬。",
HowToText = "1. 如果面前路线不太好上但是后续路线可行,及时使用道具不要省\n2. 根据个人喜好对道具进行优先级选择,果断放弃不太适用的道具\n3. 留下至少一个保命道具\n4. 道具不要携带太多。",
NoteText = "道具作为辅助工具,合理使用可以大大加快攀爬进度或可以攀爬至无法到达的地方,道具不要省,该用就要用,后续攀爬过程中也还会遇到新的道具,让道具流通起来才能发挥道具的最大作用,平常用不到的道具可以直接抛弃以保持良好的负重,或者先留下如果到体力不足以攀爬上去时再考虑丢弃或使用,常在手中留下一个保命道具(如潘多拉、万灵药等),以防止失误带来的直接晕倒行为。"
});
Add("d_SkillMatching", new PageData
{
Title = "技巧搭配",
LeftHint = "技巧搭配图示",
ConceptText = "合理的技巧搭配可以实现1+1大于2的效果。",
HowToText = "1. 攀爬时可以按照 <二段跳>-<抓爬>-<登墙扑> 的操作流程解决几乎大部分的墙面。\n2. <兔子跳>_<二段跳>_<二段大跳>搭配<跳点> 来实现类似于海岛的近乎连续小坡面的快速攀爬跳跃。\n3. <二段跳>-<抓爬>-<二段冲刺>-<登墙扑>的搭配适用于有额外体力的情况下攀爬极高的墙面时使用(要在额外体力耗尽前使用登墙扑)。\n4. <小跳>_<二段跳>_<二段大跳>搭配<跳点>适用于需要留存一定体力的情况使用。",
NoteText = "当快速攀爬体力耗尽时下一个攀爬点较高时可以通过二段跳(省去空格)加登墙扑的搭配来实现少体力通过较高墙壁的效果,根据攀爬点位和体力情况灵活运用二段省去空格的行为,有时会发挥出更好的效果;技巧的搭配千变万化,但所有的初衷都是为了省下体力以达到更快更好的攀爬,对于不同的场景不同的路线灵活搭配才能发挥出技巧的最大作用。"
});
static void Add(string key, PageData page)
{
page.Key = key;
KeyToIndex[key] = Pages.Count;
Pages.Add(page);
}
}
public static void Init()
{
if ((Object)(object)_canvasGO != (Object)null)
{
Show();
return;
}
BuildPageData();
Build();
}
public static void Show()
{
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)_canvasGO == (Object)null)
{
Init();
}
if (!((Object)(object)_canvasGO == (Object)null))
{
_savedLockMode = Cursor.lockState;
_savedCursorVisible = Cursor.visible;
Cursor.lockState = (CursorLockMode)0;
Cursor.visible = true;
_canvasGO.SetActive(true);
_isVisible = true;
if (!_videosPreloaded)
{
_videosPreloaded = true;
PreloadVideos();
}
_navStack.Clear();
_currentPage = KeyToIndex["toc"];
((MonoBehaviour)_driver).StartCoroutine(AnimatePageIn(0f));
}
}
public static void Hide()
{
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)_canvasGO != (Object)null)
{
_canvasGO.SetActive(false);
}
_isVisible = false;
Cursor.lockState = _savedLockMode;
Cursor.visible = _savedCursorVisible;
}
public static void Toggle()
{
if (_isVisible)
{
Hide();
}
else
{
Show();
}
}
private static void Build()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Expected O, but got Unknown
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_010f: Unknown result type (might be due to invalid IL or missing references)
//IL_014c: Unknown result type (might be due to invalid IL or missing references)
//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
//IL_021a: Unknown result type (might be due to invalid IL or missing references)
//IL_0269: Unknown result type (might be due to invalid IL or missing references)
//IL_0280: Unknown result type (might be due to invalid IL or missing references)
//IL_0297: Unknown result type (might be due to invalid IL or missing references)
//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
//IL_0301: Unknown result type (might be due to invalid IL or missing references)
//IL_0318: Unknown result type (might be due to invalid IL or missing references)
//IL_032f: Unknown result type (might be due to invalid IL or missing references)
//IL_033c: Unknown result type (might be due to invalid IL or missing references)
//IL_034d: Unknown result type (might be due to invalid IL or missing references)
//IL_0368: Unknown result type (might be due to invalid IL or missing references)
//IL_0394: Unknown result type (might be due to invalid IL or missing references)
//IL_039b: Expected O, but got Unknown
//IL_0447: Unknown result type (might be due to invalid IL or missing references)
//IL_04cf: Unknown result type (might be due to invalid IL or missing references)
//IL_05b8: Unknown result type (might be due to invalid IL or missing references)
//IL_05cf: Unknown result type (might be due to invalid IL or missing references)
//IL_05e6: Unknown result type (might be due to invalid IL or missing references)
//IL_05fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0614: Unknown result type (might be due to invalid IL or missing references)
//IL_065e: Unknown result type (might be due to invalid IL or missing references)
//IL_06b1: Unknown result type (might be due to invalid IL or missing references)
//IL_06c8: Unknown result type (might be due to invalid IL or missing references)
//IL_06f0: Unknown result type (might be due to invalid IL or missing references)
//IL_0707: Unknown result type (might be due to invalid IL or missing references)
//IL_071e: Unknown result type (might be due to invalid IL or missing references)
//IL_0735: Unknown result type (might be due to invalid IL or missing references)
//IL_074c: Unknown result type (might be due to invalid IL or missing references)
//IL_0767: Unknown result type (might be due to invalid IL or missing references)
//IL_07ba: Unknown result type (might be due to invalid IL or missing references)
//IL_07d1: Unknown result type (might be due to invalid IL or missing references)
//IL_07e8: Unknown result type (might be due to invalid IL or missing references)
//IL_07fc: Unknown result type (might be due to invalid IL or missing references)
//IL_080d: Unknown result type (might be due to invalid IL or missing references)
//IL_086d: Unknown result type (might be due to invalid IL or missing references)
//IL_087a: Unknown result type (might be due to invalid IL or missing references)
//IL_0887: Unknown result type (might be due to invalid IL or missing references)
//IL_089e: Unknown result type (might be due to invalid IL or missing references)
//IL_08da: Unknown result type (might be due to invalid IL or missing references)
//IL_0908: Unknown result type (might be due to invalid IL or missing references)
//IL_091f: Unknown result type (might be due to invalid IL or missing references)
//IL_0936: Unknown result type (might be due to invalid IL or missing references)
//IL_094a: Unknown result type (might be due to invalid IL or missing references)
//IL_0990: Unknown result type (might be due to invalid IL or missing references)
//IL_09a7: Unknown result type (might be due to invalid IL or missing references)
//IL_09be: Unknown result type (might be due to invalid IL or missing references)
//IL_09d5: Unknown result type (might be due to invalid IL or missing references)
//IL_09ec: Unknown result type (might be due to invalid IL or missing references)
//IL_0a27: Unknown result type (might be due to invalid IL or missing references)
//IL_0a34: Unknown result type (might be due to invalid IL or missing references)
//IL_0a41: Unknown result type (might be due to invalid IL or missing references)
//IL_0a7f: Unknown result type (might be due to invalid IL or missing references)
//IL_0aad: Unknown result type (might be due to invalid IL or missing references)
//IL_0ac4: Unknown result type (might be due to invalid IL or missing references)
//IL_0adb: Unknown result type (might be due to invalid IL or missing references)
//IL_0b0a: Unknown result type (might be due to invalid IL or missing references)
//IL_0b8a: Unknown result type (might be due to invalid IL or missing references)
//IL_0ba1: Unknown result type (might be due to invalid IL or missing references)
//IL_0bb8: Unknown result type (might be due to invalid IL or missing references)
//IL_0bcf: Unknown result type (might be due to invalid IL or missing references)
//IL_0be6: Unknown result type (might be due to invalid IL or missing references)
//IL_0c08: Unknown result type (might be due to invalid IL or missing references)
//IL_0c36: Unknown result type (might be due to invalid IL or missing references)
//IL_0c3b: Unknown result type (might be due to invalid IL or missing references)
//IL_0c3f: Unknown result type (might be due to invalid IL or missing references)
//IL_0c60: Unknown result type (might be due to invalid IL or missing references)
//IL_0c81: Unknown result type (might be due to invalid IL or missing references)
//IL_0c9b: Unknown result type (might be due to invalid IL or missing references)
//IL_0d0d: Unknown result type (might be due to invalid IL or missing references)
//IL_0d5a: Unknown result type (might be due to invalid IL or missing references)
//IL_0d71: Unknown result type (might be due to invalid IL or missing references)
//IL_0d88: Unknown result type (might be due to invalid IL or missing references)
//IL_0d9f: Unknown result type (might be due to invalid IL or missing references)
//IL_0db6: Unknown result type (might be due to invalid IL or missing references)
//IL_0de5: Unknown result type (might be due to invalid IL or missing references)
//IL_0e13: Unknown result type (might be due to invalid IL or missing references)
//IL_0e18: Unknown result type (might be due to invalid IL or missing references)
//IL_0e30: Unknown result type (might be due to invalid IL or missing references)
//IL_0e51: Unknown result type (might be due to invalid IL or missing references)
//IL_0e72: Unknown result type (might be due to invalid IL or missing references)
//IL_0e8c: Unknown result type (might be due to invalid IL or missing references)
//IL_0cba: Unknown result type (might be due to invalid IL or missing references)
//IL_0cbf: Unknown result type (might be due to invalid IL or missing references)
//IL_0cc5: Expected O, but got Unknown
//IL_0f07: Unknown result type (might be due to invalid IL or missing references)
//IL_0f54: Unknown result type (might be due to invalid IL or missing references)
//IL_0f6b: Unknown result type (might be due to invalid IL or missing references)
//IL_0f82: Unknown result type (might be due to invalid IL or missing references)
//IL_0f99: Unknown result type (might be due to invalid IL or missing references)
//IL_0fb0: Unknown result type (might be due to invalid IL or missing references)
//IL_1005: Unknown result type (might be due to invalid IL or missing references)
//IL_0eab: Unknown result type (might be due to invalid IL or missing references)
//IL_0eb0: Unknown result type (might be due to invalid IL or missing references)
//IL_0eb6: Expected O, but got Unknown
_canvasGO = new GameObject("TutorialUICanvas");
Object.DontDestroyOnLoad((Object)(object)_canvasGO);
Canvas val = _canvasGO.AddComponent<Canvas>();
val.renderMode = (RenderMode)0;
val.sortingOrder = 9999;
CanvasScaler val2 = _canvasGO.AddComponent<CanvasScaler>();
val2.uiScaleMode = (ScaleMode)1;
val2.referenceResolution = new Vector2(1920f, 1080f);
val2.matchWidthOrHeight = 0.5f;
_canvasGO.AddComponent<GraphicRaycaster>();
_driver = _canvasGO.AddComponent<PageDriver>();
RectTransform val3 = CreateUIRect("Book", _canvasGO.transform);
val3.anchorMin = new Vector2(0.5f, 0.5f);
val3.anchorMax = new Vector2(0.5f, 0.5f);
val3.pivot = new Vector2(0.5f, 0.5f);
val3.anchoredPosition = Vector2.zero;
val3.sizeDelta = new Vector2(1180f, 700f);
Image val4 = ((Component)val3).gameObject.AddComponent<Image>();
((Graphic)val4).color = LeatherColor;
((Graphic)val4).raycastTarget = true;
RectTransform val5 = CreateUIRect("LeatherInner", (Transform)(object)val3);
Stretch(val5, 11f);
Image val6 = ((Component)val5).gameObject.AddComponent<Image>();
((Graphic)val6).color = LeatherInner;
((Graphic)val6).raycastTarget = false;
RectTransform val7 = CreateUIRect("Pages", (Transform)(object)val5);
Stretch(val7, 6.6000004f);
float num = 1122.8f;
float num2 = 642.8f;
float num3 = (num - 10f) / 2f;
RectTransform val8 = CreateUIRect("LeftPage", (Transform)(object)val7);
val8.anchorMin = new Vector2(0f, 0.5f);
val8.anchorMax = new Vector2(0f, 0.5f);
val8.pivot = new Vector2(0f, 0.5f);
val8.anchoredPosition = Vector2.zero;
val8.sizeDelta = new Vector2(num3, num2);
Image val9 = ((Component)val8).gameObject.AddComponent<Image>();
((Graphic)val9).color = ParchmentColor;
((Graphic)val9).raycastTarget = false;
_leftPageContent = CreateUIRect("LeftContent", (Transform)(object)val8);
Stretch(_leftPageContent, 0f);
RectTransform val10 = CreateUIRect("Spine", (Transform)(object)val7);
val10.anchorMin = new Vector2(0.5f, 0.5f);
val10.anchorMax = new Vector2(0.5f, 0.5f);
val10.pivot = new Vector2(0.5f, 0.5f);
val10.anchoredPosition = Vector2.zero;
val10.sizeDelta = new Vector2(10f, num2);
Image val11 = ((Component)val10).gameObject.AddComponent<Image>();
((Graphic)val11).color = LeatherColor;
((Graphic)val11).raycastTarget = false;
RectTransform val12 = CreateUIRect("RightPage", (Transform)(object)val7);
val12.anchorMin = new Vector2(1f, 0.5f);
val12.anchorMax = new Vector2(1f, 0.5f);
val12.pivot = new Vector2(1f, 0.5f);
val12.anchoredPosition = Vector2.zero;
val12.sizeDelta = new Vector2(num3, num2);
Image val13 = ((Component)val12).gameObject.AddComponent<Image>();
((Graphic)val13).color = ParchmentColor;
((Graphic)val13).raycastTarget = false;
GameObject val14 = new GameObject("RightContent", new Type[1] { typeof(RectTransform) });
val14.transform.SetParent((Transform)(object)val12, false);
_rightPageContent = val14.GetComponent<RectTransform>();
Stretch(_rightPageContent, 0f);
_pageFade = val14.AddComponent<CanvasGroup>();
CanvasGroup val15 = ((Component)_leftPageContent).gameObject.AddComponent<CanvasGroup>();
RectTransform val16 = CreateUIRect("MediaArea", (Transform)(object)_leftPageContent);
Stretch(val16, 50f, 60f, 50f, 50f);
_leftPlaceholder = ((Component)val16).gameObject.AddComponent<Image>();
_leftPlaceholder.preserveAspect = true;
((Graphic)_leftPlaceholder).color = new Color(0.72f, 0.65f, 0.52f, 0.45f);
((Graphic)_leftPlaceholder).raycastTarget = false;
RectTransform val17 = CreateUIRect("PhLabel", (Transform)(object)val16);
Stretch(val17, 0f);
_leftPlaceholderLabel = ((Component)val17).gameObject.AddComponent<Text>();
_leftPlaceholderLabel.font = LoadFont();
_leftPlaceholderLabel.fontSize = 20;
((Graphic)_leftPlaceholderLabel).color = new Color(TextColor.r, TextColor.g, TextColor.b, 0.45f);
_leftPlaceholderLabel.alignment = (TextAnchor)4;
_leftPlaceholderLabel.horizontalOverflow = (HorizontalWrapMode)0;
((Graphic)_leftPlaceholderLabel).raycastTarget = false;
RectTransform val18 = CreateUIRect("VideoDisplay", (Transform)(object)val16);
Stretch(val18, 0f);
_leftVideoRaw = ((Component)val18).gameObject.AddComponent<RawImage>();
((Graphic)_leftVideoRaw).raycastTarget = false;
((Behaviour)_leftVideoRaw).enabled = false;
_videoPlayer = ((Component)val16).gameObject.AddComponent<VideoPlayer>();
_videoPlayer.playOnAwake = false;
_videoPlayer.isLooping = true;
_videoPlayer.renderMode = (VideoRenderMode)2;
_videoPlayer.targetMaterialRenderer = null;
_videoPlayer.controlledAudioTrackCount = 0;
_videoPlayer.skipOnDrop = true;
RectTransform val19 = CreateUIRect("Title", (Transform)(object)_rightPageContent);
val19.anchorMin = new Vector2(0.5f, 1f);
val19.anchorMax = new Vector2(0.5f, 1f);
val19.pivot = new Vector2(0.5f, 1f);
val19.anchoredPosition = new Vector2(0f, -45f);
val19.sizeDelta = new Vector2(440f, 55f);
_titleText = ((Component)val19).gameObject.AddComponent<Text>();
_titleText.font = LoadFont();
_titleText.fontSize = 38;
_titleText.fontStyle = (FontStyle)1;
((Graphic)_titleText).color = TextColor;
_titleText.alignment = (TextAnchor)4;
_titleText.horizontalOverflow = (HorizontalWrapMode)1;
((Graphic)_titleText).raycastTarget = false;
Outline val20 = ((Component)val19).gameObject.AddComponent<Outline>();
((Shadow)val20).effectColor = new Color(1f, 1f, 1f, 0.25f);
((Shadow)val20).effectDistance = new Vector2(1f, -1f);
RectTransform val21 = CreateUIRect("TitleLine", (Transform)(object)_rightPageContent);
val21.anchorMin = new Vector2(0.5f, 1f);
val21.anchorMax = new Vector2(0.5f, 1f);
val21.pivot = new Vector2(0.5f, 1f);
val21.anchoredPosition = new Vector2(0f, -108f);
val21.sizeDelta = new Vector2(380f, 2f);
Image val22 = ((Component)val21).gameObject.AddComponent<Image>();
((Graphic)val22).color = DividerColor;
((Graphic)val22).raycastTarget = false;
float num4 = -130f;
float num5 = 60f;
float num6 = num2 + num4 - num5;
float num7 = num3 - 36f;
RectTransform val23 = CreateUIRect("ScrollArea", (Transform)(object)_rightPageContent);
val23.anchorMin = new Vector2(0.5f, 1f);
val23.anchorMax = new Vector2(0.5f, 1f);
val23.pivot = new Vector2(0.5f, 1f);
val23.anchoredPosition = new Vector2(0f, num4);
val23.sizeDelta = new Vector2(num7, num6);
_scrollRect = ((Component)val23).gameObject.AddComponent<ScrollRect>();
_scrollRect.horizontal = false;
_scrollRect.vertical = true;
_scrollRect.movementType = (MovementType)2;
_scrollRect.scrollSensitivity = 25f;
RectTransform val24 = CreateUIRect("Viewport", (Transform)(object)val23);
val24.anchorMin = Vector2.zero;
val24.anchorMax = Vector2.one;
val24.sizeDelta = Vector2.zero;
val24.pivot = new Vector2(0.5f, 0.5f);
((Component)val24).gameObject.AddComponent<RectMask2D>();
Image val25 = ((Component)val24).gameObject.AddComponent<Image>();
((Graphic)val25).color = new Color(0f, 0f, 0f, 0f);
((Graphic)val25).raycastTarget = true;
RectTransform val26 = CreateUIRect("Content", (Transform)(object)val24);
val26.anchorMin = new Vector2(0f, 1f);
val26.anchorMax = new Vector2(1f, 1f);
val26.pivot = new Vector2(0.5f, 1f);
val26.sizeDelta = new Vector2(0f, num6);
_scrollContent = val26;
_scrollRect.content = val26;
_scrollRect.viewport = val24;
RectTransform val27 = CreateUIRect("Scrollbar", (Transform)(object)val23);
val27.anchorMin = new Vector2(1f, 0f);
val27.anchorMax = new Vector2(1f, 1f);
val27.pivot = new Vector2(1f, 0.5f);
val27.sizeDelta = new Vector2(10f, 0f);
val27.anchoredPosition = new Vector2(-2f, 0f);
Scrollbar val28 = ((Component)val27).gameObject.AddComponent<Scrollbar>();
val28.direction = (Direction)2;
((Selectable)val28).targetGraphic = null;
RectTransform val29 = CreateUIRect("Sliding Area", (Transform)(object)val27);
val29.anchorMin = Vector2.zero;
val29.anchorMax = Vector2.one;
val29.sizeDelta = Vector2.zero;
Image val30 = ((Component)val29).gameObject.AddComponent<Image>();
((Graphic)val30).color = new Color(LeatherColor.r, LeatherColor.g, LeatherColor.b, 0.3f);
((Graphic)val30).raycastTarget = false;
RectTransform val31 = CreateUIRect("Handle", (Transform)(object)val29);
val31.anchorMin = new Vector2(0f, 0f);
val31.anchorMax = new Vector2(1f, 1f);
val31.sizeDelta = new Vector2(-4f, -4f);
Image val32 = ((Component)val31).gameObject.AddComponent<Image>();
((Graphic)val32).color = new Color(0.45f, 0.33f, 0.2f, 0.8f);
((Graphic)val32).raycastTarget = true;
val28.handleRect = val31;
_scrollRect.verticalScrollbar = val28;
_scrollRect.verticalScrollbarVisibility = (ScrollbarVisibility)1;
((UnityEvent<Vector2>)(object)_scrollRect.onValueChanged).AddListener((UnityAction<Vector2>)delegate
{
});
RectTransform val33 = CreateUIRect("BackButton", (Transform)(object)val12);
val33.anchorMin = new Vector2(0f, 0f);
val33.anchorMax = new Vector2(0f, 0f);
val33.pivot = new Vector2(0f, 0f);
val33.anchoredPosition = new Vector2(20f, 16f);
val33.sizeDelta = new Vector2(120f, 40f);
_backBtnRect = val33;
Image val34 = ((Component)val33).gameObject.AddComponent<Image>();
((Graphic)val34).color = BackBtnColor;
((Graphic)val34).raycastTarget = true;
Button val35 = ((Component)val33).gameObject.AddComponent<Button>();
((Selectable)val35).targetGraphic = (Graphic)(object)val34;
ColorBlock colors = ((Selectable)val35).colors;
((ColorBlock)(ref colors)).normalColor = BackBtnColor;
((ColorBlock)(ref colors)).highlightedColor = new Color(0.45f, 0.33f, 0.2f, 1f);
((ColorBlock)(ref colors)).pressedColor = new Color(0.3f, 0.2f, 0.12f, 1f);
((ColorBlock)(ref colors)).fadeDuration = 0.1f;
((Selectable)val35).colors = colors;
ButtonClickedEvent onClick = val35.onClick;
object obj = <>O.<0>__OnBackClicked;
if (obj == null)
{
UnityAction val36 = OnBackClicked;
<>O.<0>__OnBackClicked = val36;
obj = (object)val36;
}
((UnityEvent)onClick).AddListener((UnityAction)obj);
RectTransform val37 = CreateUIRect("BackText", (Transform)(object)val33);
Stretch(val37, 0f);
Text val38 = ((Component)val37).gameObject.AddComponent<Text>();
val38.font = LoadFont();
val38.fontSize = 20;
((Graphic)val38).color = Color.white;
val38.alignment = (TextAnchor)4;
val38.horizontalOverflow = (HorizontalWrapMode)1;
((Graphic)val38).raycastTarget = false;
val38.text = "← 返回";
RectTransform val39 = CreateUIRect("CloseButton", (Transform)(object)val12);
val39.anchorMin = new Vector2(1f, 1f);
val39.anchorMax = new Vector2(1f, 1f);
val39.pivot = new Vector2(1f, 1f);
val39.anchoredPosition = new Vector2(-12f, -12f);
val39.sizeDelta = new Vector2(36f, 36f);
Image val40 = ((Component)val39).gameObject.AddComponent<Image>();
((Graphic)val40).color = new Color(0.5f, 0.2f, 0.15f, 0.85f);
((Graphic)val40).raycastTarget = true;
Button val41 = ((Component)val39).gameObject.AddComponent<Button>();
((Selectable)val41).targetGraphic = (Graphic)(object)val40;
ColorBlock colors2 = ((Selectable)val41).colors;
((ColorBlock)(ref colors2)).normalColor = new Color(0.5f, 0.2f, 0.15f, 0.85f);
((ColorBlock)(ref colors2)).highlightedColor = new Color(0.7f, 0.25f, 0.2f, 1f);
((ColorBlock)(ref colors2)).pressedColor = new Color(0.35f, 0.12f, 0.1f, 1f);
((ColorBlock)(ref colors2)).fadeDuration = 0.1f;
((Selectable)val41).colors = colors2;
ButtonClickedEvent onClick2 = val41.onClick;
object obj2 = <>O.<1>__Hide;
if (obj2 == null)
{
UnityAction val42 = Hide;
<>O.<1>__Hide = val42;
obj2 = (object)val42;
}
((UnityEvent)onClick2).AddListener((UnityAction)obj2);
RectTransform val43 = CreateUIRect("CloseText", (Transform)(object)val39);
Stretch(val43, 0f);
Text val44 = ((Component)val43).gameObject.AddComponent<Text>();
val44.font = LoadFont();
val44.fontSize = 22;
val44.fontStyle = (FontStyle)1;
((Graphic)val44).color = Color.white;
val44.alignment = (TextAnchor)4;
val44.horizontalOverflow = (HorizontalWrapMode)1;
((Graphic)val44).raycastTarget = false;
val44.text = "×";
RectTransform val45 = CreateUIRect("Hint", (Transform)(object)val12);
val45.anchorMin = new Vector2(1f, 0f);
val45.anchorMax = new Vector2(1f, 0f);
val45.pivot = new Vector2(1f, 0f);
val45.anchoredPosition = new Vector2(-20f, 16f);
val45.sizeDelta = new Vector2(160f, 30f);
Text val46 = ((Component)val45).gameObject.AddComponent<Text>();
val46.font = LoadFont();
val46.fontSize = 15;
((Graphic)val46).color = new Color(TextColor.r, TextColor.g, TextColor.b, 0.45f);
val46.alignment = (TextAnchor)8;
val46.horizontalOverflow = (HorizontalWrapMode)1;
((Graphic)val46).raycastTarget = false;
val46.text = "F3 关闭";
_canvasGO.SetActive(false);
_isVisible = false;
TutorialPlugin.LogInfo("[TutorialUI] 书本 UI 框架构建完成");
}
private static void RenderPage(int pageIndex)
{
ClearChildren(_scrollContent);
PageData pageData = Pages[pageIndex];
UpdateLeftMedia(pageData);
_titleText.text = pageData.Title;
if (pageData.Items != null)
{
RenderItemList(pageData);
}
else
{
RenderDetailContent(pageData);
}
_scrollRect.verticalNormalizedPosition = 1f;
((Component)_backBtnRect).gameObject.SetActive(_navStack.Count > 0);
}
public static void PreloadVideos()
{
((MonoBehaviour)_driver).StartCoroutine(PreloadVideosRoutine());
}
private static IEnumerator PreloadVideosRoutine()
{
string baseDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
foreach (PageData page in Pages)
{
if (string.IsNullOrEmpty(page.LeftVideoPath))
{
continue;
}
string fullPath = Path.Combine(baseDir, "videos/" + page.LeftVideoPath);
if (File.Exists(fullPath) && !_videoCache.ContainsKey(fullPath))
{
GameObject go = new GameObject("Video_" + page.LeftVideoPath);
go.transform.SetParent(_canvasGO.transform, false);
VideoPlayer vp = go.AddComponent<VideoPlayer>();
vp.playOnAwake = false;
vp.isLooping = true;
vp.renderMode = (VideoRenderMode)2;
vp.controlledAudioTrackCount = 0;
vp.skipOnDrop = true;
vp.timeUpdateMode = (VideoTimeUpdateMode)2;
vp.url = fullPath;
RenderTexture rt = (vp.targetTexture = new RenderTexture(480, 270, 0));
VideoCache cache = new VideoCache
{
Path = fullPath,
Player = vp,
Texture = rt
};
vp.prepareCompleted += (EventHandler)delegate
{
cache.Prepared = true;
};
vp.Prepare();
_videoCache[fullPath] = cache;
yield return null;
}
}
}
private static void UpdateLeftMedia(PageData page)
{
//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
//IL_0211: Unknown result type (might be due to invalid IL or missing references)
//IL_0218: Expected O, but got Unknown
//IL_0178: Unknown result type (might be due to invalid IL or missing references)
//IL_0182: Expected O, but got Unknown
//IL_0270: Unknown result type (might be due to invalid IL or missing references)
//IL_027f: Unknown result type (might be due to invalid IL or missing references)
//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
if (!string.IsNullOrEmpty(page.LeftVideoPath))
{
string fullPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "videos/" + page.LeftVideoPath);
if (!File.Exists(fullPath) || !_videoCache.TryGetValue(fullPath, out var cache))
{
StopAllVideos();
_currentVideoKey = "";
((Behaviour)_leftVideoRaw).enabled = false;
((Behaviour)_leftPlaceholder).enabled = true;
((Behaviour)_leftPlaceholderLabel).enabled = true;
_leftPlaceholderLabel.text = page.LeftHint;
return;
}
((Behaviour)_leftPlaceholder).enabled = false;
((Behaviour)_leftVideoRaw).enabled = true;
if (_currentVideoKey == fullPath)
{
return;
}
_currentVideoKey = fullPath;
StopAllVideos();
if (cache.Ready)
{
_leftVideoRaw.texture = (Texture)(object)cache.Texture;
cache.Player.Play();
((Behaviour)_leftPlaceholderLabel).enabled = false;
return;
}
((Behaviour)_leftPlaceholderLabel).enabled = true;
_leftPlaceholderLabel.text = "视频加载中...";
cache.Player.prepareCompleted += (EventHandler)delegate
{
if (_currentVideoKey == fullPath)
{
_leftVideoRaw.texture = (Texture)(object)cache.Texture;
cache.Player.Play();
((Behaviour)_leftPlaceholderLabel).enabled = false;
}
};
return;
}
StopAllVideos();
_currentVideoKey = "";
((Behaviour)_leftVideoRaw).enabled = false;
string text = (string.IsNullOrEmpty(page.LeftImagePath) ? "left_image.png" : page.LeftImagePath);
string text2 = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "images/" + text);
if (File.Exists(text2))
{
WWW val = new WWW("file:///" + text2.Replace("\\", "/"));
while (!val.isDone)
{
}
if ((Object)(object)val.texture != (Object)null)
{
_leftPlaceholder.sprite = Sprite.Create(val.texture, new Rect(0f, 0f, (float)((Texture)val.texture).width, (float)((Texture)val.texture).height), new Vector2(0.5f, 0.5f));
((Behaviour)_leftPlaceholder).enabled = true;
((Graphic)_leftPlaceholder).color = Color.white;
((Behaviour)_leftPlaceholderLabel).enabled = false;
return;
}
}
_leftPlaceholder.sprite = null;
((Behaviour)_leftPlaceholder).enabled = true;
((Graphic)_leftPlaceholder).color = new Color(0.72f, 0.65f, 0.52f, 0.45f);
((Behaviour)_leftPlaceholderLabel).enabled = true;
_leftPlaceholderLabel.text = page.LeftHint;
}
private static void StopAllVideos()
{
foreach (KeyValuePair<string, VideoCache> item in _videoCache)
{
if ((Object)(object)item.Value.Player != (Object)null && item.Value.Player.isPlaying)
{
item.Value.Player.Stop();
}
}
}
private static void RenderItemList(PageData page)
{
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_0115: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: Unknown result type (might be due to invalid IL or missing references)
//IL_0140: Unknown result type (might be due to invalid IL or missing references)
//IL_015a: Unknown result type (might be due to invalid IL or missing references)
//IL_017a: Unknown result type (might be due to invalid IL or missing references)
//IL_0184: Expected O, but got Unknown
//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
//IL_0225: Unknown result type (might be due to invalid IL or missing references)
//IL_023c: Unknown result type (might be due to invalid IL or missing references)
//IL_0253: Unknown result type (might be due to invalid IL or missing references)
//IL_026a: Unknown result type (might be due to invalid IL or missing references)
//IL_0281: Unknown result type (might be due to invalid IL or missing references)
//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
//IL_0359: Unknown result type (might be due to invalid IL or missing references)
float num = 58f;
float num2 = 14f;
float num3 = 10f;
float num4 = 20f;
for (int i = 0; i < page.Items.Count; i++)
{
PageItem pageItem = page.Items[i];
string targetKey = pageItem.TargetKey;
RectTransform val = CreateUIRect($"Btn_{i}", (Transform)(object)_scrollContent);
val.anchorMin = new Vector2(0f, 1f);
val.anchorMax = new Vector2(1f, 1f);
val.pivot = new Vector2(0.5f, 1f);
val.anchoredPosition = new Vector2(0f, 0f - (num3 + (float)i * (num + num2)));
val.sizeDelta = new Vector2(-20f, num);
Image val2 = ((Component)val).gameObject.AddComponent<Image>();
((Graphic)val2).color = ButtonNormal;
((Graphic)val2).raycastTarget = true;
Button val3 = ((Component)val).gameObject.AddComponent<Button>();
((Selectable)val3).targetGraphic = (Graphic)(object)val2;
ColorBlock colors = ((Selectable)val3).colors;
((ColorBlock)(ref colors)).normalColor = ButtonNormal;
((ColorBlock)(ref colors)).highlightedColor = ButtonHover;
((ColorBlock)(ref colors)).pressedColor = ButtonPressed;
((ColorBlock)(ref colors)).selectedColor = ButtonHover;
((ColorBlock)(ref colors)).fadeDuration = 0.08f;
((Selectable)val3).colors = colors;
string capturedKey = targetKey;
((UnityEvent)val3.onClick).AddListener((UnityAction)delegate
{
OnItemClicked(capturedKey);
});
RectTransform val4 = CreateUIRect("Label", (Transform)(object)val);
Stretch(val4, 25f, 15f, 0f, 0f);
Text val5 = ((Component)val4).gameObject.AddComponent<Text>();
val5.font = LoadFont();
val5.fontSize = 24;
((Graphic)val5).color = TextColor;
val5.alignment = (TextAnchor)3;
val5.horizontalOverflow = (HorizontalWrapMode)1;
((Graphic)val5).raycastTarget = false;
val5.text = pageItem.Label;
RectTransform val6 = CreateUIRect("Arrow", (Transform)(object)val);
val6.anchorMin = new Vector2(1f, 0.5f);
val6.anchorMax = new Vector2(1f, 0.5f);
val6.pivot = new Vector2(1f, 0.5f);
val6.anchoredPosition = new Vector2(-15f, 0f);
val6.sizeDelta = new Vector2(20f, 20f);
Text val7 = ((Component)val6).gameObject.AddComponent<Text>();
val7.font = LoadFont();
val7.fontSize = 22;
((Graphic)val7).color = new Color(TextColor.r, TextColor.g, TextColor.b, 0.5f);
val7.alignment = (TextAnchor)4;
val7.horizontalOverflow = (HorizontalWrapMode)1;
((Graphic)val7).raycastTarget = false;
val7.text = "›";
}
float num5 = num3 + (float)page.Items.Count * num + (float)(page.Items.Count - 1) * num2 + num4;
_scrollContent.sizeDelta = new Vector2(0f, num5);
}
private static void RenderDetailContent(PageData page)
{
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
float y = 10f;
y = AddSection("【概念】", page.ConceptText ?? "", y);
y = AddSection("【实现】", page.HowToText ?? "", y);
if (!string.IsNullOrEmpty(page.TheoryText))
{
y = AddSection("【原理】", page.TheoryText, y);
}
if (!string.IsNullOrEmpty(page.NoteText))
{
y = AddSection("【注意】", page.NoteText, y);
}
y += 20f;
_scrollContent.sizeDelta = new Vector2(0f, y);
}
private static float AddSection(string heading, string body, float y)
{
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Unknown result type (might be due to invalid IL or missing references)
//IL_011f: Unknown result type (might be due to invalid IL or missing references)
//IL_0135: Unknown result type (might be due to invalid IL or missing references)
//IL_0148: Unknown result type (might be due to invalid IL or missing references)
//IL_015e: Unknown result type (might be due to invalid IL or missing references)
//IL_018b: Unknown result type (might be due to invalid IL or missing references)
//IL_01da: Unknown result type (might be due to invalid IL or missing references)
//IL_020e: Unknown result type (might be due to invalid IL or missing references)
//IL_0225: Unknown result type (might be due to invalid IL or missing references)
//IL_023c: Unknown result type (might be due to invalid IL or missing references)
//IL_0250: Unknown result type (might be due to invalid IL or missing references)
//IL_0267: Unknown result type (might be due to invalid IL or missing references)
//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
RectTransform val = CreateUIRect("SectionHead", (Transform)(object)_scrollContent);
val.anchorMin = new Vector2(0f, 1f);
val.anchorMax = new Vector2(1f, 1f);
val.pivot = new Vector2(0f, 1f);
val.anchoredPosition = new Vector2(0f, 0f - y);
val.sizeDelta = new Vector2(-20f, 30f);
Text val2 = ((Component)val).gameObject.AddComponent<Text>();
val2.font = LoadFont();
val2.fontSize = 22;
val2.fontStyle = (FontStyle)1;
((Graphic)val2).color = new Color(0.35f, 0.22f, 0.1f, 1f);
val2.alignment = (TextAnchor)0;
val2.horizontalOverflow = (HorizontalWrapMode)1;
((Graphic)val2).raycastTarget = false;
val2.text = heading;
y += 34f;
RectTransform val3 = CreateUIRect("SectionBody", (Transform)(object)_scrollContent);
val3.anchorMin = new Vector2(0f, 1f);
val3.anchorMax = new Vector2(1f, 1f);
val3.pivot = new Vector2(0f, 1f);
val3.anchoredPosition = new Vector2(0f, 0f - y);
val3.sizeDelta = new Vector2(-30f, 30f);
Text val4 = ((Component)val3).gameObject.AddComponent<Text>();
val4.font = LoadFont();
val4.fontSize = 19;
((Graphic)val4).color = TextColor;
val4.alignment = (TextAnchor)0;
val4.horizontalOverflow = (HorizontalWrapMode)0;
val4.verticalOverflow = (VerticalWrapMode)1;
((Graphic)val4).raycastTarget = false;
val4.text = body;
val4.font = LoadFont();
float preferredHeight = val4.preferredHeight;
val3.sizeDelta = new Vector2(-30f, preferredHeight);
y += preferredHeight + 18f;
RectTransform val5 = CreateUIRect("SectionDivider", (Transform)(object)_scrollContent);
val5.anchorMin = new Vector2(0f, 1f);
val5.anchorMax = new Vector2(1f, 1f);
val5.pivot = new Vector2(0f, 1f);
val5.anchoredPosition = new Vector2(0f, 0f - y);
val5.sizeDelta = new Vector2(-40f, 1f);
Image val6 = ((Component)val5).gameObject.AddComponent<Image>();
((Graphic)val6).color = new Color(DividerColor.r, DividerColor.g, DividerColor.b, 0.5f);
((Graphic)val6).raycastTarget = false;
y += 12f;
return y;
}
private static void OnItemClicked(string targetKey)
{
if (!string.IsNullOrEmpty(targetKey) && KeyToIndex.TryGetValue(targetKey, out var value))
{
_navStack.Push(_currentPage);
_currentPage = value;
((MonoBehaviour)_driver).StartCoroutine(AnimatePageForward());
}
}
private static void OnBackClicked()
{
if (_navStack.Count != 0)
{
int currentPage = _navStack.Pop();
_currentPage = currentPage;
((MonoBehaviour)_driver).StartCoroutine(AnimatePageBack());
}
}
private static IEnumerator AnimatePageForward()
{
yield return FadeSlide(1f, 25f, 0.18f);
RenderPage(_currentPage);
yield return FadeSlide(0f, -25f, 0.18f);
}
private static IEnumerator AnimatePageBack()
{
yield return FadeSlide(-1f, -25f, 0.18f);
RenderPage(_currentPage);
yield return FadeSlide(0f, 25f, 0.18f);
}
private static IEnumerator AnimatePageIn(float startDelay)
{
if (startDelay > 0f)
{
yield return (object)new WaitForSecondsRealtime(startDelay);
}
RenderPage(_currentPage);
yield return FadeSlide(0f, 0f, 0.25f);
}
private static IEnumerator FadeSlide(float fromDir, float offsetX, float duration)
{
float timer = 0f;
float startAlpha = ((fromDir == 0f) ? 0f : 1f);
float endAlpha = ((fromDir == 0f) ? 1f : 0f);
while (timer < duration)
{
timer += Time.unscaledDeltaTime;
float t = Mathf.Clamp01(timer / duration);
t = t * t * (3f - 2f * t);
float alpha = Mathf.Lerp(startAlpha, endAlpha, t);
float xOffset = Mathf.Lerp(offsetX, 0f, (fromDir == 0f) ? t : (1f - t));
_pageFade.alpha = alpha;
_rightPageContent.anchoredPosition = new Vector2(xOffset, 0f);
yield return null;
}
_pageFade.alpha = endAlpha;
_rightPageContent.anchoredPosition = Vector2.zero;
}
private static void ClearChildren(RectTransform parent)
{
for (int num = ((Transform)parent).childCount - 1; num >= 0; num--)
{
Object.Destroy((Object)(object)((Component)((Transform)parent).GetChild(num)).gameObject);
}
}
private static RectTransform CreateUIRect(string name, Transform parent)
{
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
GameObject val = new GameObject(name, new Type[1] { typeof(RectTransform) });
val.transform.SetParent(parent, false);
return val.GetComponent<RectTransform>();
}
private static void Stretch(RectTransform rt, float padding)
{
Stretch(rt, padding, padding, padding, padding);
}
private static void Stretch(RectTransform rt, float left, float right, float top, float bottom)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
rt.anchorMin = Vector2.zero;
rt.anchorMax = Vector2.one;
rt.offsetMin = new Vector2(left, bottom);
rt.offsetMax = new Vector2(0f - right, 0f - top);
}
private static Font LoadFont()
{
if ((Object)(object)_cachedFont != (Object)null)
{
return _cachedFont;
}
try
{
_cachedFont = Resources.GetBuiltinResource<Font>("LegacyRuntime.ttf");
if (Object.op_Implicit((Object)(object)_cachedFont))
{
return _cachedFont;
}
}
catch
{
}
try
{
_cachedFont = Resources.GetBuiltinResource<Font>("Arial.ttf");
}
catch
{
}
return _cachedFont;
}
}
}