// Use this for initialization protected void AwakeInstantAction(ActionEnum.Instant Kind) { StartBASE(); text = GetComponentInChildren <Text>(); this.kind = Kind; need = gameObject.AddComponent <NeedFunciton>(); popUp = main.ActionPopUpPre.StartPopUp(gameObject, main.windowShowCanvas); release = gameObject.AddComponent <ReleaseFunction>(); release.StartFunction(gameObject, x => Sync(ref main.SR.released_instant[(int)kind], x), x => Sync(ref main.SR.completed_instant[(int)kind], x), x => Requires()); instant = gameObject.AddComponent <InstantFunction>(); instant.StartInstant(gameObject, Need); }
// Use this for initialization protected void AwakeLoopAction(ActionEnum.Loop Kind, double maxValue = 60, double plusValue = 1) { StartBASE(); text = GetComponentInChildren <Text>(); if (GetComponentInChildren <Slider>() != null) { slider = GetComponentInChildren <Slider>(); } this.kind = Kind; MaxValue = maxValue; PlusValue = plusValue; popUp = main.ActionPopUpPre.StartPopUp(gameObject, main.windowShowCanvas); need = gameObject.AddComponent <NeedFunciton>(); release = gameObject.AddComponent <ReleaseFunction>(); release.StartFunction(gameObject, x => Sync(ref main.SR.released_loop[(int)kind], x), x => Sync(ref main.SR.completed_loop[(int)kind], x), x => Requires()); progress = gameObject.AddComponent <ProgressFunction>(); progress.StartProgress(gameObject, Need, slider, x => Sync(ref main.SR.paid_loop[(int)kind], x), x => Sync(ref main.SR.currentValue_loop[(int)kind], x)); }