// Use this for initialization void Start() { Debug.Log(testText.text); textLoader = new TextLoader(testText.text); resourceLoader.Initialize(this); sounder = new SoundProcessor(); sounder.Initialize(resourceLoader); varProcessor = new VariableProcessor(); varProcessor.Initialize(textLoader); sceneProcessor = new SceneProcessor(); sceneProcessor.Initialize(this, resourceLoader); messenger.Initialize(textLoader, varProcessor); imager.Initialize(resourceLoader); processorList = new List <CommandProcessor>(); processorList.Add(messenger); processorList.Add(imager); processorList.Add(sounder); processorList.Add(varProcessor); processorList.Add(sceneProcessor); processIndex = -1; OnEnd = false; }
public void Initialize(TextLoader loader, VariableProcessor vProcessor) { trigger = 'm'; commandList = new List <Func <bool> >(); commandList.Add(WriteMessage);//default command commandList.Add(WaitInitialize); commandList.Add(Wait); commandList.Add(InitializeBox); commandList.Add(ChangeSpeed); commandList.Add(AddChoice);//[m\5\〇〇] commandList.Add(WaitSelect); commandList.Add(EnableAuto); commandList.Add(DisableAuto); waitCursor.SetActive(false); messageWaiter = new Waiter(defaultCount); inputWaiter = new Waiter(inputWaitCount); messageLengthCounter = new Counter(1, true); messageBoxCounter = new Counter(500); lineCounter = new Counter(maxLineCount); lineUpCounter = new Counter(10); autoWaitLim = 30; autoWaiter = new Waiter(autoWaitLim); choicesCounter = new Counter(0); FocusChoice(choicesCounter.Now, true); foreach (Transform t in choicesTransform) { EventTrigger trigger = t.gameObject.AddComponent <EventTrigger>(); trigger.triggers = new List <EventTrigger.Entry>(); EventTrigger.Entry entry = new EventTrigger.Entry(); entry.eventID = EventTriggerType.PointerEnter; entry.callback.AddListener(x => ChangeChoice(t.GetSiblingIndex())); trigger.triggers.Add(entry); t.GetComponent <Button>().onClick.AddListener(ClickChoice); t.gameObject.SetActive(false); } this.loader = loader; varProcessor = vProcessor; }