public void InitSuperDanmu() { //fix number for (int i = 0; i < state.SuperDanmus.Count; i++) { if (state.SuperDanmus[i].HasDisapeared) { continue; } state.SuperDanmus[i].Disappear(); //mResLoader.ReleaseGO("Zhibo/SuperDanmu", state.SuperDanmus[i].gameObject); } state.SuperDanmus.Clear(); mUICtrl.ClearSuperDanmu(); state.SuperDanmuShowTimeList = PickRandomTime(3, 25, 5); for (int i = 0; i < state.SuperDanmuShowTimeList.Count; i++) { SuperDanmu sDanmu = mUICtrl.ShowSuperDanmu(); if (sDanmu != null) { state.SuperDanmus.Add(sDanmu); } } mUICtrl.AdjustSuperDanmuOrder(); }
public void DestroySuperDanmu(SuperDanmu danmu) { //if (!danmu.isBad) //{ // GainScore(danmu.isBig ? 3 : 1); // danmu.view.textField.color = Color.gray; // danmu.view.textField.raycastTarget = false; // mUICtrl.ShowDanmuEffect(danmu.transform.position); //} //else //{ // danmu.OnDestroy(); // state.Danmus.Remove(danmu); //} AutoDisappear(danmu); }
public SuperDanmu ShowSuperDanmu() { if (EmptySuperDanmuSlot.Count == 0) { return(null); } GameObject danmuGo = mResLoader.Instantiate("Zhibo/SuperDanmu", view.SuperDanmuPreview); SuperDanmu danmu = danmuGo.GetComponent <SuperDanmu>(); // int randSlot = EmptySuperDanmuSlot[Random.Range(0, EmptySuperDanmuSlot.Count)]; EmptySuperDanmuSlot.Remove(randSlot); SuperDanmuSlots[randSlot] = danmu; danmu.transform.localPosition = new Vector3(0, randSlot * -80f, 0); danmu.init("maybe sssss asd", "0", gameMode); return(danmu); }
private void AutoDisappear(SuperDanmu danmu) { mResLoader.ReleaseGO("Zhibo/SuperDanmu", danmu.gameObject); }
public void MoveSuperDanmu(SuperDanmu toMove) { toMove.transform.SetParent(view.DanmuFieldSuper, true); }