public void Save(PlayerLookData data) { wrapper.SetString(CurrentBodyKey, data.CurrentBodyId); wrapper.SetString(CurrentBagKey, data.CurrentBagId); wrapper.SetString(CurrentStickKey, data.CurrentStickId); wrapper.SetString(CurrentGlassesKey, data.CurrentGlassesId); wrapper.SetString(CurrentBeardKey, data.CurrentBeardId); }
public static PlayerLookData PLDRandomizer() { // Gen player color Vector3 v = new Vector3(Random.value, Random.value, Random.value).normalized; PlayerLookData pld = new PlayerLookData(); var a = Resources.LoadAll <Sprite>("birdflyanim/"); var b = Resources.LoadAll <Sprite>("birdwalkanim/"); pld.walk = new Sprite[b.Length]; pld.fly = new Sprite[a.Length]; for (int i = 0; i != a.Length; ++i) { pld.fly[i] = Randomize(a[i], v); } for (int j = 0; j != b.Length; ++j) { pld.walk[j] = Randomize(b[j], v); } return(pld); }
public PlayerLookController(PlayerLookData playerLookData, PlayerLookLoader playerLookLoader, PlayerItemLoader playerItemLoader) { this.playerLookData = playerLookData; this.playerLookLoader = playerLookLoader; this.playerItemLoader = playerItemLoader; if (CurrentBodyId.Length > 0) { var currentItem = GetBody(CurrentBodyId); currentItem.Equipped = true; } if (CurrentBagId.Length > 0) { var currentItem = GetBag(CurrentBagId); currentItem.Equipped = true; } if (CurrentStickId.Length > 0) { var currentItem = GetStick(CurrentStickId); currentItem.Equipped = true; } if (CurrentGlassesId.Length > 0) { var currentItem = GetGlasses(CurrentGlassesId); currentItem.Equipped = true; } if (CurrentBeardId.Length > 0) { var currentItem = GetBeard(CurrentBeardId); currentItem.Equipped = true; } }