private void Start() { gamedatas = DataManager._instance.Get(DataType._gamedata) as gamedata; DataManager._instance.AddDataWatch(DataType._gamedata, OnRefresh); btnSound.onClick.AddListener(btnSoundClick); btnVibrate.onClick.AddListener(btnVibrateClick); btnClose.onClick.AddListener(btnCloseClick); if (gamedatas.sound == 1) { btnSound.GetComponent <Image>().enabled = false; btnSound.transform.GetChild(0).gameObject.SetActive(true); } else { btnSound.GetComponent <Image>().enabled = true; btnSound.transform.GetChild(0).gameObject.SetActive(false); } if (gamedatas.vibrate == 1) { btnVibrate.GetComponent <Image>().enabled = false; btnVibrate.transform.GetChild(0).gameObject.SetActive(true); } else { btnVibrate.GetComponent <Image>().enabled = false; btnVibrate.transform.GetChild(0).gameObject.SetActive(true); } }
private void Start() { gamedatas = DataManager._instance.Get(DataType._gamedata) as gamedata; DataManager._instance.AddDataWatch(DataType._gamedata, OnRefresh); }
private void Start() { isMove = true; isMove_test = true; gamedatas = DataManager._instance.Get(DataType._gamedata) as gamedata; DataManager._instance.AddDataWatch(DataType._gamedata, OnRefresh); }
public void Start() { ball = GameObject.Find("ball"); //gamedatas = new gamedata(); //Debug.Log(gameObject.name); gamedatas = DataManager._instance.Get(DataType._gamedata) as gamedata; DataManager._instance.AddDataWatch(DataType._gamedata, OnRefresh); }
// Start is called before the first frame update void Start() { _instance = this; gamedatas = DataManager._instance.Get(DataType._gamedata) as gamedata; Init(); DataManager._instance.AddDataWatch(DataType._gamedata, OnRefresh); setGameMap(); }
void Start() { gamedatas = DataManager._instance.Get(DataType._gamedata) as gamedata; DataManager._instance.AddDataWatch(DataType._gamedata, OnRefresh); btnClose.onClick.AddListener(btnCloseClick); btnSelect.onClick.AddListener(btnSelectClick); getTask(); init(); }
private bool doesIdenticalObjectExist(gamedataObject obj, gamedata rhsData) { gamedataObject otherObject = rhsData.getItemByID(obj.uuid); if (otherObject == null) { return(false); } if (!obj.Equals(otherObject)) { return(false); } return(true); }
void Awake() { _instance = this; gamedatas = new gamedata(); gamedatas = DataManager._instance.Get(DataType._gamedata) as gamedata; DataManager._instance.AddDataWatch(DataType._gamedata, OnRefresh); ///任务数据检查 checkLoginDay(); init(); }
// Start is called before the first frame update void Start() { _instance = this; gamedatas = DataManager._instance.Get(DataType._gamedata) as gamedata; DataManager._instance.AddDataWatch(DataType._gamedata, OnRefresh); UIPanelManager panelManager = UIPanelManager.Instance; panelManager.PushPanel(UIPanelType.start); txt_gold.text = gamedatas.GameGoldValue.ToString(); }
private void Awake() { isMove = true; initPosition = transform.position; _rigidbody = transform.GetComponent <Rigidbody>(); gamedatas = DataManager._instance.Get(DataType._gamedata) as gamedata; //walkSpeed = ((float)ballData.speed - (float)GameDataManager._instance.getBallSkillForLevel(gamedatas.aiBallReduceSpeedLevel).speedDown); DataManager._instance.AddDataWatch(DataType._gamedata, OnRefresh); //随机一个待机动作 RandomAction(); }
private void Awake() { gamedatas = DataManager._instance.Get(DataType._gamedata) as gamedata; DataManager._instance.AddDataWatch(DataType._gamedata, OnRefresh); ball = GameObject.Find("ball").transform.GetChild(0).gameObject; btn_continue_watchAds.onClick.AddListener(btn_continue_watchAdsClick); btn_continue_noAds.onClick.AddListener(btn_continue_noAdsClick); btn_over_DoubleGold.onClick.AddListener(btn_over_DoubleGoldClick); btn_over_NoAds.onClick.AddListener(btn_over_NoAdsClick); }
private void Start() { gamedatas = DataManager._instance.Get(DataType._gamedata) as gamedata; DataManager._instance.AddDataWatch(DataType._gamedata, OnRefresh); cloneAI(); foreach (var item in transform.GetComponentsInChildren <Transform>()) { if (item.gameObject.tag == "gameover") { item.gameObject.AddComponent <gameoverCube>(); item.gameObject.GetComponent <gameoverCube>().mapComponent = transform; } } }
public void Loaddata() { if (File.Exists(datafilepath)) { FileStream fs = new FileStream(datafilepath, FileMode.Open); data = (gamedata)bf.Deserialize(fs); ui.txtCoinCount.text = "x" + data.coinCount; ui.level.text = "Level: " + data.level.ToString(); data.health_now = data.health_total; ui.exp.text = data.exp_percentage.ToString() + " %"; data.health_now = data.health_total; fs.Close(); } }
public override void OnEnter() { gamedatas = DataManager._instance.Get(DataType._gamedata) as gamedata; DataManager._instance.AddDataWatch(DataType._gamedata, OnRefresh); gameObject.SetActive(true); joystick = transform.GetComponent <Joystick>(); move ball = GameObject.Find("ball").GetComponent <move>(); joystick.OnValueChanged.AddListener(ball.onJoystickValueChanged); ///初始化信息显示 txt_gameProgress.text = gamedatas.curGameProgressValue.ToString("F2") + " %"; }
private bool doIdenticalRelatedObjectsExist(gamedata lhsData, gamedata rhsData, string datatype, filterDelegate filter) { foreach (gamedataObject lhsObject in lhsData.Items.Where <gamedataObject>(iter => [email protected](datatype) && iter.deleted == "False" && filter(iter))) { if (!doesIdenticalObjectExist(lhsObject, rhsData)) { return(false); } } foreach (gamedataObject rhsObject in rhsData.Items.Where <gamedataObject>(iter => [email protected](datatype) && iter.deleted == "False" && filter(iter))) { if (!doesIdenticalObjectExist(rhsObject, lhsData)) { return(false); } } return(true); }
public override void OnEnter() { gamedatas = DataManager._instance.Get(DataType._gamedata) as gamedata; DataManager._instance.AddDataWatch(DataType._gamedata, OnRefresh); gamedatas.gameState = GAMESTATE.start; gameObject.SetActive(true); ///开始界面的数据 更新 /// gamedatas.curGameGoldValue = 0; if (gamedatas.isTest == true) { testObj.SetActive(true); } else { testObj.SetActive(false); } }
private void MenuItem_MergeFile(object sender, RoutedEventArgs e) { var ofDialog = new OpenFileDialog() { Title = "Select game data file to merge into this file", DefaultExt = ".xml", }; bool?dialogResult = ofDialog.ShowDialog(this); if (dialogResult == true) { XmlSerializer serializer = new XmlSerializer(typeof(gamedata)); XmlReader reader = XmlReader.Create(ofDialog.FileName); gamedata fileToMerge = (gamedata)serializer.Deserialize(reader); reader.Dispose(); MergeDialog inputDialog = new MergeDialog(GameDataViewObject.root, fileToMerge); if (inputDialog.ShowDialog() == true) { inputDialog.commitMerge(); GameDataViewObject.root = GameDataViewObject.root; //Retriggers the setter FIXME make this cleaner } } }
public MergeDialog(gamedata original, gamedata merge) { InitializeComponent(); MergeProcessorObject.setData(original, merge); }
public void setData(gamedata originalData, gamedata mergeData) { _originalData = originalData; _mergeData = mergeData; foreach (gamedataObject originalObject in originalData.Items) { originalObject.associatedRootData = originalData; } foreach (gamedataObject mergeObject in mergeData.Items) { mergeObject.associatedRootData = mergeData; } //Create the merge tree here. _mergeTree = new ObservableCollection <MergeTreeItem>(); MergeTree.Clear(); var elementList = new List <string> { "ItemTypeData", "ItemData", "StatData", "QuestData", "StatGroupData", "HenchmanData", "LocationData", "NPCData", "StartingCharacterInfoData", "IntegerConstantData", "StringConstantData" }; foreach (String elementClass in elementList) { int substringOffset = elementClass.LastIndexOf("Data"); string elementClassShortName = elementClass.Substring(0, substringOffset); MergeTreeItem classNode = new MergeTreeItem() { Name = elementClassShortName, OriginalObjectRef = null, MergeObjectRef = null }; Dictionary <string, MergeTreeItem> itemsByID = new Dictionary <string, MergeTreeItem>(); foreach (gamedataObject originalObject in originalData.Items.Where <gamedataObject>(iter => [email protected](elementClass) && iter.deleted == "False")) { MergeTreeItem childNode = new MergeTreeItem() { OriginalObjectRef = originalObject }; itemsByID.Add(originalObject.uuid, childNode); } foreach (gamedataObject mergeObject in mergeData.Items.Where <gamedataObject>(iter => [email protected](elementClass) && iter.deleted == "False")) { if (itemsByID.ContainsKey(mergeObject.uuid)) { itemsByID[mergeObject.uuid].MergeObjectRef = mergeObject; if (itemsByID[mergeObject.uuid].MergeObjectRef.Equals(itemsByID[mergeObject.uuid].OriginalObjectRef)) { //The items are identical, so remove the listing before displaying the merge tree. itemsByID.Remove(mergeObject.uuid); } } else { MergeTreeItem childNode = new MergeTreeItem() { MergeObjectRef = mergeObject }; itemsByID.Add(mergeObject.uuid, childNode); } } foreach (MergeTreeItem childNode in itemsByID.Values) { childNode.PropertyChanged += ChildNode_PropertyChanged; classNode.Children.Add(childNode); } MergeTree.Add(classNode); } NotifyPropertyChanged("MergeTree"); }