public void RegistPhiCol ( PhiColMgr manager ) { ICollideObj[] boders = new ICollideObj[] { border }; manager.AddPhiGroup( phisicalObjs ); manager.AddCollideGroup( concaveObjs, lowBulgeObjs ); manager.AddCollideGroup( concaveObjs, highBulgeObjs ); manager.AddCollideGroup( lowBulgeObjs, highBulgeObjs ); manager.AddCollideGroup( highBulgeObjs ); manager.AddCollideGroup( highBulgeObjs, lowFlyingObjs ); manager.AddOverlapGroup( highBulgeObjs, highFlyingObjs ); manager.AddCollideGroup( highBulgeObjs, boders ); manager.AddOverlapGroup( lowFlyingObjs, boders ); }
/// <summary> /// 往平台组件中注册物理更新 /// </summary> /// <param name="manager"></param> public void RegistPhiCol(SmartTank.PhiCol.PhiColMgr manager) { foreach (string groupPath in phiGroups) { try { TypeGroup group = FindGroup(groupPath) as TypeGroup; manager.AddPhiGroup(group.GetEnumerableCopy <IPhisicalObj>()); } catch (Exception ex) { Log.Write("RegistPhiGroup error: " + groupPath + ", " + ex.Message); } } foreach (string groupPath in colSinGroups) { try { TypeGroup group = FindGroup(groupPath) as TypeGroup; manager.AddCollideGroup(group.GetEnumerableCopy <ICollideObj>()); } catch (Exception ex) { Log.Write("RegistColSinGroup error: " + groupPath + ", " + ex.Message); } } foreach (string groupPath in lapSinGroups) { try { TypeGroup group = FindGroup(groupPath) as TypeGroup; manager.AddOverlapGroup(group.GetEnumerableCopy <ICollideObj>()); } catch (Exception ex) { Log.Write("RegistLapSinGroup error: " + groupPath + ", " + ex.Message); } } foreach (Pair pair in colPairGroups) { try { TypeGroup group1 = FindGroup(pair.groupPath1) as TypeGroup; TypeGroup group2 = FindGroup(pair.groupPath2) as TypeGroup; manager.AddCollideGroup( group1.GetEnumerableCopy <ICollideObj>(), group2.GetEnumerableCopy <ICollideObj>()); } catch (Exception ex) { Log.Write("RegistColPairGroup error: " + pair.groupPath1 + ", " + pair.groupPath2 + ", " + ex.Message); } } foreach (Pair pair in lapPairGroups) { try { TypeGroup group1 = FindGroup(pair.groupPath1) as TypeGroup; TypeGroup group2 = FindGroup(pair.groupPath2) as TypeGroup; manager.AddOverlapGroup( group1.GetEnumerableCopy <ICollideObj>(), group2.GetEnumerableCopy <ICollideObj>()); } catch (Exception ex) { Log.Write("RegistLapPairGroup error: " + pair.groupPath1 + ", " + pair.groupPath2 + ", " + ex.Message); } } }
protected override void Initialize () { base.Initialize(); phiColManager = new PhiColMgr(); shelterMgr = new ShelterMgr(); drawManager = new DrawMgr(); updateMgr = new UpdateMgr(); visionMgr = new VisionMgr(); objMemoryMananger = new ObjMemoryMgr(); Sound.Initial(); // 在此处将主界面压入堆栈。 // test gameScreens.Push( new RuleSelectScreen() ); // }