示例#1
0
    public void SendPopGuest(GuestType type, GuestPopPointerCtrl popPoint, Vector3 destination, GuestPopPointerCtrl goOutDestination)
    {
        if (ValidPopGuest(type))
        {
            Vector3 vecGoOutDestination = goOutDestination.transform.position;
            vecGoOutDestination.y = GuestCenterPositionHeight;

            switch (type)
            {
            case GuestType.Standard:
                popPoint.SendPopGuest(m_normalGuest, destination, vecGoOutDestination);
                break;

            case GuestType.Gentle:
                popPoint.SendPopGuest(m_gentleGuest, destination, vecGoOutDestination);
                break;

            case GuestType.Impatient:
                popPoint.SendPopGuest(m_impatientGuest, destination, vecGoOutDestination);
                break;

            case GuestType.StayBehind:
                popPoint.SendPopGuest(m_stayBehindGuest, destination, vecGoOutDestination);
                break;
            }
        }
    }
示例#2
0
        public void UpdatePopStrategy(GuestPopDestinationCtrl ctrl, IGuestTypeStrategy typeStrategy, int[] values, float[] fvalues)
        {
            m_remainTime -= Time.deltaTime;
            if (m_remainTime > 0.0f)
            {
                return;
            }

            m_remainTime = fvalues[0];

            int count = values[0];

            for (int i = 0; i < count; ++i)
            {
                GuestPopPointerCtrl startPoint = null;
                GuestPopPointerCtrl endPoint   = null;

                {
                    int r   = Random.Range(0, ctrl.baseSumCost + 1);
                    int sum = 0;
                    foreach (GuestPopPointerCtrl unit in ctrl.pointTable)
                    {
                        if (unit.m_priority != 0)
                        {
                            sum += unit.m_priority;
                            if (r <= sum)
                            {
                                startPoint = unit;
                                break;
                            }
                        }
                    }
                }
                {
                    int r = Random.Range(0, ctrl.pointTable.Length);
                    endPoint = ctrl.pointTable[r];
                }

                ctrl.SendPopGuest(typeStrategy.CalcType(ctrl), startPoint, ctrl.GetDestination(), endPoint);
            }
        }