public static AmmoBeltView Load() { AmmoBeltView view = UIView.Load("Views/AmmoBeltView", OverriddenViewController.Instance.transform) as AmmoBeltView; view.name = "AmmoBeltView"; return(view); }
protected override void OnInit() { base.OnInit(); if (Instance == null) { Instance = this; } else { Destroy(gameObject); } }
protected override void OnActivate() { base.OnActivate(); // test stats //Avatar.Instance.SetAvatarStats(5, 5, 5); InitStats(); AvatarImage.sprite = AssetLookUp.Instance.GetAvatarBody(Database.Instance.GetBodyAssetForBodyType(Avatar.Instance.BodyType)); Database.Instance.BuildCurrentFaceList(); Database.Instance.BuildCurrentHairList(); Database.Instance.BuildCurrentGearList(); AvatarImage.color = Colors.HexToColor(Avatar.Instance.SkinColor); if (Avatar.Instance.FaceAsset != null && Avatar.Instance.FaceAsset != "") { FaceImage.sprite = AssetLookUp.Instance.GetAvatarFace(Avatar.Instance.FaceAsset); } else { FaceImage.sprite = AssetLookUp.Instance.GetAvatarFace(Database.Instance.GetCurrentFaceList()[0].ObjectId); } FaceImage.color = Colors.HexToColor(Database.Instance.GetFaceColorForSkinColor(Avatar.Instance.SkinColor)); HairImage.sprite = AssetLookUp.Instance.GetAvatarHair(Avatar.Instance.HairAsset); //Debug.Log("1 set hair sprite to " + HairImage.sprite); HairImage.color = Colors.HexToColor(Avatar.Instance.HairColor); ShirtImage.sprite = AssetLookUp.Instance.GetAvatarClothes(Database.Instance.GetShirtAssetForBodyType(Avatar.Instance.BodyType)); if (Avatar.Instance.Color == TeamColor.RED) { ShirtImage.color = Colors.RedShirtColor; } else { ShirtImage.color = Colors.BlueShirtColor; } ShortsImage.sprite = AssetLookUp.Instance.GetAvatarClothes(Database.Instance.GetShortsAssetForBodyType(Avatar.Instance.BodyType)); DisplayEquippedGear(); _state = AvatarViewState.MAIN; UIViewController.ActivateUIView(CoinsGemsView.Load()); UIViewController.ActivateUIView(AmmoBeltView.Load()); if (!PlayerPrefs.HasKey("AvatarViewTutorial") || PlayerPrefs.GetInt("AvatarViewTutorial") != 1) { ClickTutorial(); PlayerPrefs.SetInt("AvatarViewTutorial", 1); } }
public void ClickAmmoEquip() { SoundManager.Instance.PlaySoundEffect(SoundType.BUTTON_CLICK); AvatarView.Instance.State = AvatarViewState.AMMO; UIViewController.ActivateUIView(AmmoEquipView.Load()); UIViewController.ActivateUIView(AmmoBeltView.Load()); UIViewController.DeactivateUIView("GearEquipView"); UIViewController.DeactivateUIView("StoreView"); NavButtons[0].Enable(); NavButtons[0].transform.localScale = Vector3.one; NavButtons[1].Disable(); NavButtons[1].transform.localScale = new Vector3(1.2f, 1.2f, 1.2f); CoinsGemsView.Instance.MoveToFront(); StoreRefreshButtonObj.transform.SetAsLastSibling(); if (_displayedItem != null) { RemoveGear(_displayedItem); } _state = AvatarViewState.AMMO; }