Ejemplo n.º 1
0
        private IEnumerable <Tuple <TAVerb, CoStateInfo> > CreateCoStateList(IEnumerable <TAVerb> verbs)
        {
            CoStateInfo prev = null;

            foreach (TAVerb coState in verbs)
            {
                CoStateInfo next = new CoStateInfo();
                if (prev != null)
                {
                    prev.Next = next;
                }
                else
                {
                    FirstStateInfos.Add(next);
                }
                StateInfos.Add(next);
                prev            = next;
                next.StateIndex = TotalStates++;
                next.StateExpr  = new LazyExpression();
                yield return(Tuple.Create(coState, next));
            }
        }
        protected override void Start()
        {
            base.Start();
            if (YarnScript != null)
            {
                GameManager.Instance.DialogueManager.AddYarnFile(YarnScript);
            }
            Acquaintances = new Dictionary <Agent, float>();

            ImportantPeople.ForEach(p => Acquaintances.Add(p, 1.0f));

            Quests         = new List <Quest>();
            CurrentReplies = new List <Information>();

            if (Inventory == null)
            {
                Inventory = new List <Item>();
            }

            if (StateInfos == null)
            {
                StateInfos = new List <InformationEntry>();
            }

            transform.Find("Inventory").GetComponentsInChildren <Item>().ToList().ForEach(i => PickUpItem(i));

            Inventory.Where(i => i.IsVisible).ToList().ForEach(i =>
            {
                StateInfos.Add(new InformationEntry(
                                   this, InformationVerb.Has, i, 0, null, false));
                if (i.gameObject.CompareTag("Weapon"))
                {
                    StateInfos.Add(new InformationEntry(
                                       this, InformationVerb.Is, i, Adjectives.Armed, null, false));
                }
            });
        }
 public override void InitialiseEventManager()
 {
     StateInfos.Add(-2010423537, new StateInfo(-2010423537, 0, "Base Layer", "Base Layer.Walking", "", 1f, false, false, "Walk", 1.208333f));
     StateInfos.Add(1432961145, new StateInfo(1432961145, 0, "Base Layer", "Base Layer.Idle", "", 1f, false, false, "Idle", 2.708333f));
     StateInfos.Add(-117804301, new StateInfo(-117804301, 0, "Base Layer", "Base Layer.Yawning", "", 1f, false, false, "Yawn", 2.291667f));
     StateInfos.Add(-1407378526, new StateInfo(-1407378526, 0, "Base Layer", "Base Layer.Jumping", "", 1f, false, false, "Jump", 0.7916667f));
     StateInfos.Add(-1817809755, new StateInfo(-1817809755, 1, "Rot", "Rot.Rotate-Left", "", 1f, false, false, "Rotate-Left", 0.1666667f));
     StateInfos.Add(1375079058, new StateInfo(1375079058, 1, "Rot", "Rot.Rotate-Right", "", 1f, false, false, "Rotate-Right", 0.1666667f));
     StateInfos.Add(-1799351532, new StateInfo(-1799351532, 1, "Rot", "Rot.Centered", "", 1f, false, false, "Centered", 0.1666667f));
     TransitionInfos.Add(708569559, new TransitionInfo(708569559, "Base Layer.Walking -> Base Layer.Idle", 0, "Base Layer", -2010423537, 1432961145, true, 0.2068965f, false, 0f, false));
     TransitionInfos.Add(-2057610033, new TransitionInfo(-2057610033, "Base Layer.Walking -> Base Layer.Jumping", 0, "Base Layer", -2010423537, -1407378526, true, 0.2068965f, false, 0f, false));
     TransitionInfos.Add(856518066, new TransitionInfo(856518066, "Base Layer.Idle -> Base Layer.Walking", 0, "Base Layer", 1432961145, -2010423537, true, 0.09230769f, false, 0f, false));
     TransitionInfos.Add(1138507854, new TransitionInfo(1138507854, "Base Layer.Idle -> Base Layer.Yawning", 0, "Base Layer", 1432961145, -117804301, true, 0.09230769f, false, 0f, false));
     TransitionInfos.Add(389753119, new TransitionInfo(389753119, "Base Layer.Idle -> Base Layer.Jumping", 0, "Base Layer", 1432961145, -1407378526, true, 0.09230769f, false, 0f, false));
     TransitionInfos.Add(781957174, new TransitionInfo(781957174, "Base Layer.Yawning -> Base Layer.Idle", 0, "Base Layer", -117804301, 1432961145, true, 0.1090909f, false, 0f, false));
     TransitionInfos.Add(1298684863, new TransitionInfo(1298684863, "Base Layer.Jumping -> Base Layer.Idle", 0, "Base Layer", -1407378526, 1432961145, true, 0.3157895f, false, 0f, false));
     TransitionInfos.Add(-1019719959, new TransitionInfo(-1019719959, "Base Layer.Jumping -> Base Layer.Walking", 0, "Base Layer", -1407378526, -2010423537, true, 0.3157895f, false, 0f, false));
     TransitionInfos.Add(796133751, new TransitionInfo(796133751, "Rot.Rotate-Left -> Rot.Rotate-Right", 1, "Rot", -1817809755, 1375079058, true, 0.75f, false, 0f, false));
     TransitionInfos.Add(-1706334441, new TransitionInfo(-1706334441, "Rot.Rotate-Left -> Rot.Centered", 1, "Rot", -1817809755, -1799351532, false, 0.4559997f, false, 0f, false));
     TransitionInfos.Add(-1985854260, new TransitionInfo(-1985854260, "Rot.Rotate-Right -> Rot.Rotate-Left", 1, "Rot", 1375079058, -1817809755, true, 0.75f, false, 0f, false));
     TransitionInfos.Add(-1394703878, new TransitionInfo(-1394703878, "Rot.Rotate-Right -> Rot.Centered", 1, "Rot", 1375079058, -1799351532, false, 0.2279998f, false, 0f, false));
     TransitionInfos.Add(699184725, new TransitionInfo(699184725, "Rot.Centered -> Rot.Rotate-Right", 1, "Rot", -1799351532, 1375079058, true, 0.7415018f, false, 0.001918154f, false));
     TransitionInfos.Add(-825030163, new TransitionInfo(-825030163, "Rot.Centered -> Rot.Rotate-Left", 1, "Rot", -1799351532, -1817809755, true, 0.25f, false, 0f, false));
 }