public override void LoadDynamicRes() { base.LoadDynamicRes(); Table.SCENE sceneTable = SceneManager.CurrentSceneTable; Resource res = ResourceManager.Instance.LoadResource(string.Format("{0}.unity3d", sceneTable.hero_name), false); res.onLoaded += OnHeroLoaded; }
public override void Init() { base.Init(); Level.Instance.Init(); Level.Instance.onTriggerFinish -= OnTriggerFinish; Level.Instance.onTriggerFinish += OnTriggerFinish; CopyUI.Instance.Show(); Table.SCENE sceneTable = SceneManager.CurrentSceneTable; PlayerAttr.Instance.Init(sceneTable.blood, sceneTable.jump_count, OnPlayerAttrChange); }
/// <summary> /// 切换带有场景的状态 /// </summary> /// <param name="sceneID"></param> public void ChangeStateWithScene(uint iSceneID) { m_LastSceneTable = m_CurrentSceneTable; if (SceneTableManager.Instance.TryGetValue(iSceneID, out m_CurrentSceneTable) == false) { return; } GameStateManager.Instance.ChangeState(CopyState.Instance); }
/// <summary> /// 刷新属性 /// </summary> public void RefreshAttr() { Table.SCENE sceneTable = SceneManager.CurrentSceneTable; m_lbBlood.text = PlayerAttr.Instance.Blood.ToString(); int blood = PlayerAttr.Instance.Blood - sceneTable.blood; if (blood != 0) { m_lbBlood.text += string.Format("({0}{1}[-])", blood > 0 ? "[00FF00]+" : "[FF0000]", blood); } m_lbJump.text = PlayerAttr.Instance.JumpCount.ToString(); int jump = PlayerAttr.Instance.JumpCount - sceneTable.jump_count; if (jump != 0) { m_lbJump.text += string.Format("({0}{1}[-])", jump > 0 ? "[00FF00]+" : "[FF0000]", jump); } m_lbScore.text = CopyState.Instance.Score.ToString(); }