public void init(string txt, eSuperDanmuType type, FightingDanmuGameMode gameMode) { this.gameMode = gameMode; this.txt = txt; this.Type = type; rect = (RectTransform)transform; anim = GetComponent <Animator>(); anim.Play("FadeIn"); anim.ResetTrigger("anim"); Activated = false; HasDisapeared = false; NeedDestroy = false; destroying = false; HpLeft = 5; hengfuSize = txt.Length * 20 + 10; BindView(); RegisterEvent(); view.Content.text = txt; AdjustWidth(); }
public override void RegisterEvent() { base.RegisterEvent(); view.OKBtn.onClick.AddListener(delegate { FightingDanmuGameMode gameMode = GameMain.GetInstance().GetModule <CoreManager>().GetGameMode() as FightingDanmuGameMode; Debug.Log(gameMode.mUICtrl == null); mUIMgr.CloseCertainPanel(gameMode.mUICtrl); mUIMgr.CloseCertainPanel(this); GameMain.GetInstance().GetModule <CoreManager>().ChangeScene("Main"); }); }
public virtual void init(string txt, bool isBad, FightingDanmuGameMode gameMode) { rect = (RectTransform)transform; RootCanvasGroup = GetComponent <CanvasGroup>(); this.gameMode = gameMode; this.isBad = isBad; isBig = false; anim = GetComponent <Animator>(); NeedDestroy = false; strength = 1; left = 1; //color = getRandomColor(); BindView(); RegisterEvent(); this.danmuType = eDanmu2Type.NORMAL; view.SpeMark.gameObject.SetActive(false); anim.Play("Normal"); destroying = false; RootCanvasGroup.alpha = 1; if (isBad) { view.Content.color = Color.white; view.BadBG.gameObject.SetActive(true); } else { view.Content.color = Color.black; view.BadBG.gameObject.SetActive(false); } //view.Content.color = Color.white; //view.BadBG.gameObject.SetActive(false); view.Content.fontSize = NormalSize; //view.Content.fontSize += Random.Range(0, 6); view.Hengfu.raycastTarget = true; view.Content.text = txt; view.Hengfu.rectTransform.sizeDelta = new Vector2(txt.Length * view.Content.fontSize + 10, view.Hengfu.rectTransform.sizeDelta.y); }
public override void Init() { mResLoader = GameMain.GetInstance().GetModule <ResLoader>(); gameMode = GameMain.GetInstance().GetModule <CoreManager>().GetGameMode() as FightingDanmuGameMode; }