public static bool UseProp(PropsConf propsConf) { switch (propsConf.type) { case PropType.GOODS: Buff buff = GetBuff(propsConf.buff)[0]; GameManage.Instance.role.CalculateBuff(buff); GameManage.Instance.role.buffList.Add(buff); UIManage.CreateTips("使用物品成功!"); MainView.Instance.Change(); return(true); case PropType.SKILL: if (GameManage.Instance.userData.skills.Find(a => a.id == int.Parse(propsConf.buff)) == null) { Skill skill = new Skill(int.Parse(propsConf.buff), 1); GameManage.Instance.userData.skills.Add(skill); UIManage.CreateTips("学习技能成功!"); return(true); } else { UIManage.CreateTips("该技能已学习!"); return(false); } } return(false); }
public void OnClickUpLevel() { if (skill.level == 5) { UIManage.CreateTips("该技能已升到满级!"); } if (GameManage.Instance.userData.props.Find(a => a.conf.type == PropType.SKILL && a.conf.buff == skill.id.ToString()) != null) { GameManage.Instance.userData.skills.Find(a => a.id == skill.id).level++; Prop prop = GameManage.Instance.userData.props.Find(a => a.conf.type == PropType.SKILL && a.conf.buff == skill.id.ToString()); if (prop.num == 1) { GameManage.Instance.userData.props.Remove(prop); } else { prop.num--; } UIManage.CreateTips("技能升级成功!"); SkillView.Instance.CreateItem(); } else { UIManage.CreateTips("技能书不足!"); } }
private void Awake() { if (instance == null) { instance = this; } }
private void Start() { List <GameData> talentConfs = XMLData.GameDatas; Instance = this; CreateGround(); UIManage.CreateView(new SelectRoleController()); IsMyRound = true; }
public override void Dead() { if (isDead) { return; } isDead = true; int score = XMLData.GameDatas[0].score + GameManage.Instance.round + GameManage.Instance.score; Debug.LogError(XMLData.GameDatas[0].score + " " + GameManage.Instance.round + " " + GameManage.Instance.score); XMLData.SetGameData(score, XMLData.GameDatas[0].talent); UIManage.CreateView(new EndController()); }
private void Awake() { _instance = this; prefab1 = Resources.Load("Prefeb/UITrogleModel") as GameObject; //Wprefab1.transform.parent = this.transform; Vector3 TempPos = new Vector3(0f, -0f, -5f); Vector3 TempRot = new Vector3(0f, 1f, 0f); Instantiate(prefab1, TempPos, Quaternion.AngleAxis(0, TempRot)); //Vector3 TempPos = new Vector3(0f, 0f, 0f); //Text tempText = Instantiate(Tip_Text, TempPos, Quaternion.identity) as Text; //tempText.GetComponent<Transform>().SetParent(GameObject.Find("Canvas").GetComponent<Transform>(), false); //tempText.text = "aaa"; }
/// <summary> /// 初始化 /// </summary> private void Initialize() { //管理类单例 m_manage = UIManage.Instance; m_SceneManage = SceneStateController.Instance; //系统 uiEvent = new UIEventSystem(this); stageSystem = new StageSystem(this); cardManage = new CardManageSystem(this); attackSystem = new AttackSystem(this); //其他 serialize = new Serialize(this); deserialization = Deserialization.Instance; }
private void Awake() { Application.targetFrameRate = 60; QualitySettings.vSyncCount = 0; // Screen.SetResolution(720, 1280, true); if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
public static void GetPorp(int id, int num = 1) { if (XMLData.PropsConfs.Find(a => a.id == id) == null) { UIManage.CreateTips("不存在该物品!"); } if (GameManage.Instance.userData.props.Find(a => a.conf.id == id) != null) { GameManage.Instance.userData.props.Find(a => a.conf.id == id).num += num; } else { Prop prop = new Prop(); prop.conf = XMLData.PropsConfs.Find(a => a.id == id); prop.num = num; GameManage.Instance.userData.props.Add(prop); } }
public bool ChangeEqu(Equipment equipment) { if (type == equipment.Conf.equipmentType) { if (equipment.level <= GameManage.Instance.role.level) { switch (type) { case EquipmentType.armor: GameTools.ChangeEquipment(GameManage.Instance.userData.armor, equipment); GameManage.Instance.userData.armor = equipment; break; case EquipmentType.helmet: GameTools.ChangeEquipment(GameManage.Instance.userData.helmet, equipment); GameManage.Instance.userData.helmet = equipment; break; case EquipmentType.shoes: GameTools.ChangeEquipment(GameManage.Instance.userData.shoes, equipment); GameManage.Instance.userData.shoes = equipment; break; } GameManage.Instance.userData.equipments.Remove(equipment); EquView.Instance.Refrsh(); return(true); } UIManage.CreateTips("角色等级不足!"); return(false); } else { UIManage.CreateTips("装备类型不对!"); return(false); } }
void Awake() { m_Instance = this; }
private void Awake() { Instance = this; sonMebers = new Dictionary <string, Dictionary <string, GameObject> >(); }
public void Start() { Instance = this; MainController mainController = new MainController(); UIBaseView view = CreateView(mainController); }
// Use this for initialization void Start() { Instance = this; }
//启动项 private void GameInit() { m_SceneStateController = SceneStateController.Instance; gameManage = GameManage.Instance; uIManage = UIManage.Instance; }