Example #1
0
        public override void Enter(int preStateName)
        {
            base.Enter(preStateName);

            var entity = (this.fsmCtr as FSMMachineVisitor).ownerEntity;

            DebugFile.GetInstance().WriteKeyFile(entity.entityID, "{0} StateVisitorLeaveZooEntryQueueFull.Enter", entity.entityID);
            DebugFile.GetInstance().MarkGameObject(entity.mainGameObject, "visitor_{0}_{1}_{2}", entity.entityID, (VisitorState)this.preStateName, (VisitorState)this.stateName);
            entity.moveSpeed = Config.globalConfig.getInstace().ZooVisitorBackSpeed;
            MessageManager.GetInstance().Regist((int)UFrameBuildinMessage.Arrived, this.OnArrived);
            MessageManager.GetInstance().Regist((int)GameMessageDefine.VisitorWhereLeaveFromReply, this.OnVisitorWhereLeaveFromReply);

            //走回去的路,广告游客(ship)没有停车场逻辑,地下游客走地下, 地上游客走申请
            EntityFuncType entityFuncType = (EntityFuncType)(entity.entityFuncType);

            switch (entityFuncType)
            {
            case EntityFuncType.Visitor_From_Ship:
                EntityVisitor.GodownPath(entity, PathManager.GetInstance().GetPath(
                                             Config.globalConfig.getInstace().AdvertVisitorOut));
                break;

            case EntityFuncType.Visitor_From_Car:
                //这里没有走申请,得发个消息,让底下停车场数量-1
                MessageInt.Send((int)GameMessageDefine.DirectMinusOneUnderParkingNum, entity.entityID);
                EntityVisitor.GodownReversePath(entity, Config.globalConfig.getInstace().EntryQueueObservePath);
                break;

            case EntityFuncType.Visitor_From_GroundParking:
                VisitorWhereLeaveFromApply.Send(entity.entityID);
                break;

            default:
                string e = string.Format("没有这种游客类型{0}", entityFuncType);
                throw new System.Exception(e);
            }

            //生成愤怒表情
            var pool = PoolManager.GetInstance().GetGameObjectPool(9301);

            expGo             = pool.New();
            expTrans          = expGo.transform;
            expTrans.position = entity.position;
            ExpressionScaleAnim(expTrans, Config.globalConfig.getInstace().ExpressionScaleOrg,
                                Config.globalConfig.getInstace().ExpressionScaleMax,
                                Config.globalConfig.getInstace().ExpressionScaleDuration,
                                Config.globalConfig.getInstace().ExpressionDuration);
        }