public FishGame.ScenePreludes.ScenePrelude DoPrelude() { if (Config == null) { return(null); } var data = Config.ScenePreludes; var count = data.Length; if (count < 1) { return(null); } var index = IsRandomPrelude ? Random.Range(0, count) : ++PreludeIdxStart % count; var spPrefab = data[index]; if (spPrefab == null) { return(null); } var sp = Instantiate(spPrefab); sp.transform.parent = transform; var localPos = sp.transform.localPosition; localPos.z = 0F; sp.transform.localPosition = localPos; sp.Go(); CurPrelude = sp; return(sp); }
// Use this for initialization void Awake() { mSp = GetComponent <FishGame.ScenePreludes.ScenePrelude>(); if (mSp == null) { return; } var gdata = App.GetGameData <FishGameData>(); gdata.EvtFreezeBombActive += Handle_FreezeBombActive; gdata.EvtFreezeBombDeactive += Handle_FreezeBombDeactive; }