public void LoadCharacterModelFromProfile() { PlayerProfile profile = GameManagers.GetProfile(); Debug.Log("LoadCharacterModelFromProfile called: " + profile.modelId); LoadCharacterModel(profile.modelId); }
private void InstantiateNetworkPrint() { PlayerProfile profile = GameManagers.GetProfile(); //Size is based on player profile size object[] data = new object[2]; //0 index used for profile as the first item is gun data[0] = profile.itemIds[0]; data[1] = profile.modelId; Debug.Log("(2) MultiplayerManager: InstantiateNetworkPrint called"); GameObject go = PhotonNetwork.Instantiate("NetworkPrint", Vector3.zero, Quaternion.identity, 0, data) as GameObject; }
private void OnEnable() { camera.position = cameraPositions[0].position; camera.rotation = cameraPositions[0].rotation; currentCat = CategorySelection.none; clothes = GameManagers.GetResourcesManager().GetAllClothItems(); weapons = GameManagers.GetResourcesManager().GetAllWeapons(); string modelId = GameManagers.GetProfile().modelId; string primaryWeapon = GameManagers.GetProfile().itemIds[0]; string secondaryWeapon = GameManagers.GetProfile().itemIds[1]; for (int i = 0; i < clothes.Count; i++) { if (string.Equals(clothes[i].name, modelId)) { clothIndex = i; break; } } for (int i = 0; i < weapons.Count; i++) { if (string.Equals(weapons[i].name, primaryWeapon)) { primaryWeaponIndex = i; break; } if (string.Equals(weapons[i].name, secondaryWeapon)) { secondaryWeaponIndex = i; break; } } offlineState.LoadCharacterModel(clothes[clothIndex].name); if (primaryWeaponObject != null) { Destroy(primaryWeaponObject); } primaryWeaponObject = CreateWeapon(weapons[primaryWeaponIndex], primaryWeaponParent); if (secondaryWeaponObject != null) { Destroy(secondaryWeaponObject); } secondaryWeaponObject = CreateWeapon(weapons[secondaryWeaponIndex], secondaryWeaponParent); }
public void PreviousOrNextItem(bool prev) { int modifier = (prev) ? -1 : 1; switch (currentCat) { case CategorySelection.none: break; case CategorySelection.clothes: clothIndex += modifier; if (clothIndex > clothes.Count - 1) { clothIndex = 0; } if (clothIndex < 0) { clothIndex = clothes.Count - 1; } GameManagers.GetProfile().modelId = clothes[clothIndex].name; offlineState.LoadCharacterModel(clothes[clothIndex].name); break; case CategorySelection.primaryWeapon: primaryWeaponIndex += modifier; if (primaryWeaponIndex > weapons.Count - 1) { primaryWeaponIndex = 0; } if (primaryWeaponIndex < 0) { primaryWeaponIndex = weapons.Count - 1; } GameManagers.GetProfile().itemIds[0] = weapons[primaryWeaponIndex].name; if (primaryWeaponObject != null) { Destroy(primaryWeaponObject); } primaryWeaponObject = CreateWeapon(weapons[primaryWeaponIndex], primaryWeaponParent); break; case CategorySelection.secondaryWeapon: secondaryWeaponIndex += modifier; if (secondaryWeaponIndex > weapons.Count - 1) { secondaryWeaponIndex = 0; } if (secondaryWeaponIndex < 0) { secondaryWeaponIndex = weapons.Count - 1; } if (secondaryWeaponObject != null) { Destroy(secondaryWeaponObject); } secondaryWeaponObject = CreateWeapon(weapons[secondaryWeaponIndex], secondaryWeaponParent); GameManagers.GetProfile().itemIds[1] = weapons[secondaryWeaponIndex].name; break; default: break; } }