void Start() { suc = new Succession(this); // 各セクションを登録 var a1 = suc.Add(GetComponent <SectionA>().Initialize("a1")); var b1 = a1.Add(GetComponent <SectionB>().Initialize("b1")); var b2 = a1.Add(GetComponent <SectionB>().Initialize("b2")); var c1 = b2.Add(GetComponent <SectionC>().Initialize("c1")); var a2 = suc.Add(GetComponent <SectionA>().Initialize("a2")); // 全セクションへのパスを出力 suc.OutputAllSectionPath(); // セクション移動 suc.Goto("/a1"); }
private static void Prefix(ActorMenu __instance) { if (!Main.enabled) { return; } try { CharId oldTaiwuId = DateFile.instance.MianActorID(); CharId newTaiwuId = (int)typeof(ActorMenu).GetField("chooseNewActor", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); // 保存前后两代太吾的关系值 var succession = new Succession(); succession.predecessor = oldTaiwuId; succession.opinion = DateFile.instance.GetActorFavor(false, oldTaiwuId, newTaiwuId, false, false); taiwuOpinionsOfPredecessor.Add(newTaiwuId, succession); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }