// Use this for initialization void Start() { //this.enabled = false; _FileLocation=Application.persistentDataPath + "/"; _FileName="SaveData"; DataManager d = new DataManager(); DebugScreen.Get().addMsg("File Location " + _FileLocation); //d.Weapons.Add(new ItemWeapon("Ultimate Justice", BattleCore.elements.Earth ,10,1)); //d.Weapons.Add(new ItemWeapon("Ash Bringer", BattleCore.elements.Earth ,10,1)); //SaveData(d,"ItemData.xml"); TextAsset tAsset = Resources.Load("ItemData") as TextAsset; d = (DataManager)DeserializeObject(tAsset.text,d);//(DataManager)LoadData("ItemData.xml",d); GameManager.dataManager = d; ItemArmour arm = new ItemArmour(BattleCore.elements.Earth,10); DebugScreen.Get().addMsg("User Data Initializing " + Time.realtimeSinceStartup); InitializeUserData(); /* arm.ItemDescription = "A basic defender."; arm.ItemPrice = 10; arm.ItemID = 10; arm.ItemName = "Cloth Armor"; d.Armour.Add(arm); SaveData(d,"ItemData.xml"); */ DebugScreen.Get().addMsg("User Data Initialized " + Time.realtimeSinceStartup); }
// Use this for initialization public virtual void Start() { controller = GetComponent<CharacterController>(); if (!controller) { Debug.LogError("Unit.Start() " + name + "has no character controller."); enabled = false; } // Load Resources // Initialize Data _CurHP = MaxHP; Weapon = new ItemWeapon(BattleCore.elements.None,1,1f); Armour = new ItemArmour(BattleCore.elements.None,0); targetForward = this.transform.forward; }