Beispiel #1
0
 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;
     }
 }
Beispiel #3
0
 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;
 }
Beispiel #6
0
 public abstract void SetAction(GuestActionVO action);
Beispiel #7
0
 public override void SetAction(GuestActionVO action)
 {
     FromInterest.sprite = InterestSprites.GetSprite(action.Tags[0]);
     ToInterest.sprite   = InterestSprites.GetSprite(action.Tags[1]);
 }