override protected void HandleGuest(GuestVO guest) { if (guest != null && guest == _guest) { bool activate = guest.Action != null; gameObject.SetActive(activate); if (activate) { GuestActionIcon icon; GuestActionVO action = guest.Action; foreach (ActionMap map in Actions) { activate = map.ActionType == action.Type; map.View.SetActive(activate); if (activate) { icon = map.View.GetComponent <GuestActionIcon>(); if (icon != null) { icon.SetAction(action); } } } } } }
public override void SetAction(GuestActionVO action) { _action = action; gameObject.SetActive(_action != null && _action.Type == "Lead"); if (gameObject.activeSelf) { Reward.sprite = RewardIcons.GetSprite(action.Tags[0]); Meter.fillAmount = 0f; } }
public GuestActionVO(GuestActionVO action) { this.Type = action.Type; this.Rounds = action.Rounds; if (action.Tags != null) { this.Tags = new string[action.Tags.Length]; Array.Copy(action.Tags, this.Tags, action.Tags.Length); } if (action.Values != null) { this.Values = new Dictionary <string, int>(action.Values); } this.Chance = action.Chance; this.Difficulty = action.Difficulty; }
override public void OnEnterState() { MapModel map = AmbitionApp.GetModel <MapModel>(); UController controller = _machine._uflow.GetController(_machine); GuestVO guest = map.Room.Guests[controller.transform.GetSiblingIndex()]; PartyModel model = AmbitionApp.GetModel <PartyModel>(); GuestActionVO action = AmbitionApp.Create <string, GuestActionVO>("Interest"); action.Tags = new string[] { guest.Like, "" }; int index = Util.RNG.Generate(1, model.Interests.Length); if (guest.Like == model.Interests[index]) { index = 0; } guest.Like = model.Interests[index]; guest.Dislike = model.Interests[(index + 1) % model.Interests.Length]; action.Tags[1] = guest.Like; guest.Action = action; AmbitionApp.SendMessage(guest); }
void OnDisable() { AmbitionApp.Unsubscribe <int>(PartyMessages.ROUND, HandleRound); StopAllCoroutines(); _action = null; }
public abstract void SetAction(GuestActionVO action);
public override void SetAction(GuestActionVO action) { FromInterest.sprite = InterestSprites.GetSprite(action.Tags[0]); ToInterest.sprite = InterestSprites.GetSprite(action.Tags[1]); }