コード例 #1
0
        public override void Execute(SceneLogicInfo info, long deltaTime)
        {
            if (null == info || info.IsLogicFinished || info.IsLogicPaused)
            {
                return;
            }
            info.Time += deltaTime;
            if (info.Time > 1000)
            {
                TimeoutLogicInfo data = info.LogicDatas.GetData <TimeoutLogicInfo>();
                if (null == data)
                {
                    data = new TimeoutLogicInfo();
                    info.LogicDatas.AddData <TimeoutLogicInfo>(data);

                    SceneLogicConfig sc = info.SceneLogicConfig;
                    if (null != sc)
                    {
                        data.m_Timeout = long.Parse(sc.m_Params[0]);
                    }
                }
                data.m_CurTime += info.Time;
                info.Time       = 0;
                //执行逻辑
                if (null != data && !data.m_IsTriggered && data.m_CurTime >= data.m_Timeout)
                {
                    data.m_IsTriggered = true;
                    SceneLogicSendStoryMessage(info, "timeout:" + info.ConfigId, data.m_Timeout);
                }
            }
        }
コード例 #2
0
 public SceneLogicInfo AddSceneLogicInfo(int id, SceneLogicConfig cfg)
 {
     SceneLogicInfo info = NewSceneLogicInfo(id);
     info.SceneContext = m_SceneContext;
     info.SceneLogicConfig = cfg;
     m_SceneLogicInfos.AddLast(info.GetId(), info);
     return info;
 }
コード例 #3
0
 internal SceneLogicInfo CreateSceneLogic(int infoId, int configId, int logicId, params string[] args)
 {
     SceneLogicConfig cfg = new SceneLogicConfig();
     cfg.m_ConfigId = configId;
     cfg.m_LogicId = logicId;
     cfg.m_Params = args;
     SceneLogicInfo logicInfo = m_SceneLogicInfoMgr.AddSceneLogicInfo(infoId, cfg);
     return logicInfo;
 }
コード例 #4
0
        public SceneLogicInfo AddSceneLogicInfo(int id, SceneLogicConfig cfg)
        {
            SceneLogicInfo info = NewSceneLogicInfo(id);

            info.SceneContext     = m_SceneContext;
            info.SceneLogicConfig = cfg;
            m_SceneLogicInfos.AddLast(info.GetId(), info);
            return(info);
        }
コード例 #5
0
        public SceneLogicInfo DelayAddSceneLogicInfo(int id, SceneLogicConfig cfg)
        {
            SceneLogicInfo info = NewSceneLogicInfo(id);

            info.SceneContext     = m_SceneContext;
            info.SceneLogicConfig = cfg;
            m_DelayAdd.Add(info);
            return(info);
        }
コード例 #6
0
        public SceneLogicInfo CreateSceneLogic(int infoId, int configId, int logicId, params string[] args)
        {
            SceneLogicConfig cfg = new SceneLogicConfig();

            cfg.m_ConfigId = configId;
            cfg.m_LogicId  = logicId;
            cfg.m_Params   = args;
            SceneLogicInfo logicInfo = m_SceneLogicInfoMgr.AddSceneLogicInfo(infoId, cfg);

            return(logicInfo);
        }
 static public int get_m_Params(IntPtr l)
 {
     try {
         GameFramework.SceneLogicConfig self = (GameFramework.SceneLogicConfig)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.m_Params);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #8
0
 internal int CreateSceneLogic(int configId, int logicId, params string[] args)
 {
     int id = 0;
     SceneLogicConfig cfg = new SceneLogicConfig();
     cfg.m_ConfigId = configId;
     cfg.m_LogicId = logicId;
     cfg.m_Params = args;
     SceneLogicInfo logicInfo = m_SceneLogicInfoMgr.AddSceneLogicInfo(cfg);
     if (null != logicInfo) {
         id = logicInfo.GetId();
     }
     return id;
 }
 static public int constructor(IntPtr l)
 {
     try {
         GameFramework.SceneLogicConfig o;
         o = new GameFramework.SceneLogicConfig();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #10
0
 static public int set_m_Params(IntPtr l)
 {
     try {
         GameFramework.SceneLogicConfig self = (GameFramework.SceneLogicConfig)checkSelf(l);
         System.String[] v;
         checkArray(l, 2, out v);
         self.m_Params = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #11
0
 static public int set_m_LogicId(IntPtr l)
 {
     try {
         GameFramework.SceneLogicConfig self = (GameFramework.SceneLogicConfig)checkSelf(l);
         System.Int32 v;
         checkType(l, 2, out v);
         self.m_LogicId = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #12
0
        public int CreateSceneLogic(int configId, int logicId, params string[] args)
        {
            int id = 0;
            SceneLogicConfig cfg = new SceneLogicConfig();

            cfg.m_ConfigId = configId;
            cfg.m_LogicId  = logicId;
            cfg.m_Params   = args;
            SceneLogicInfo logicInfo = m_SceneLogicInfoMgr.AddSceneLogicInfo(cfg);

            if (null != logicInfo)
            {
                id = logicInfo.GetId();
            }
            return(id);
        }
コード例 #13
0
 public SceneLogicInfo DelayAddSceneLogicInfo(int id, SceneLogicConfig cfg)
 {
     SceneLogicInfo info = NewSceneLogicInfo(id);
     info.SceneContext = m_SceneContext;
     info.SceneLogicConfig = cfg;
     m_DelayAdd.Add(info);
     return info;
 }