本文整理汇总了C#中SceneManager类的典型用法代码示例。如果您正苦于以下问题:C# SceneManager类的具体用法?C# SceneManager怎么用?C# SceneManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SceneManager类属于命名空间,在下文中一共展示了SceneManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitFuc
/// <summary>
/// Init all roots and configs
/// </summary>
void InitFuc()
{
Application.runInBackground = playInBackGround;
Debuger.EnableLog = enableDebuger;
manager = this.gameObject.AddComponent<SceneManager>();
manager.cacheRoot = transform.FindChild("CacheRoot");
manager.uiRoot = transform.FindChild("UI Root");
manager.senceRoot = transform.FindChild("SceneRoot");
manager.playerRoot = transform.FindChild("PlayerRoot");
manager.ghostRoot = transform.FindChild("GhostRoot");
uicamera = manager.uiRoot.FindChild("Camera").GetComponent<UICamera>();
tool = this.gameObject.AddComponent<Utility>();
connector = this.gameObject.AddComponent<Connector>();
this.gameObject.AddComponent<CacheFactory>();
ConfigFactory.InitResourceConfig();
ConfigFactory.ReadSystemConfig();
this.gameObject.AddComponent<ConfigInfo>();
ConfigInfo.ReadUIRules();
GUIManager.instance.Loading.gameObject.SetActive(true);
GUIManager.instance.FloatMessagePanel.gameObject.SetActive(true);
GUIManager.instance.FloatTip.gameObject.SetActive(true);
GUIManager.LoadingPercent(10);
ConfigInfo.Init();
ConfigInfo.InitPreGameConfigs();
GUIManager.FinishLoading();
StartGame();
}
示例2: Awake
void Awake()
{
LevelIndex = Application.loadedLevel;
instance = this;
if (controlsManager == null) {
GameObject newCM = new GameObject("Control_Manager");
controlsManager = newCM.AddComponent<ControlsManager>();
newCM.transform.SetParent(this.transform);
}
// GET THE SCORE MANAGER //
if (scoreManager == null) {
GameObject newScM = new GameObject("Score_Manager");
scoreManager = newScM.AddComponent<ScoreManager>();
newScM.transform.SetParent(this.transform);
}
// LETS SETUP A SCENE //
if (sceneManager == null) {
GameObject newSM = new GameObject("Scene_Manager");
sceneManager = newSM.AddComponent<SceneManager>();
newSM.transform.SetParent(this.transform);
}
// link the debugger //
GameObject dbg = GameObject.Find ("Debugger");
debugger = dbg.GetComponent<Debugger> ();
}
示例3: SceneSeven
public SceneSeven(SceneManager manager)
: base(manager)
{
timeLength = 4.0f;
permitUnloadResources = false;
bigHeadProp = new BigHeadProp(resourceFactory);
}
示例4: SkyManager
public SkyManager(SceneManager manager, Camera camera)
{
this.manager = manager;
this.camera = camera;
NativeHandle = New_Manager(manager.NativePtr, camera.NativePtr);
}
示例5: Ninja
public Ninja(ref SceneManager mSceneMgr, Vector3 position)
{
ent = mSceneMgr.CreateEntity("Ninja" + count.ToString(), "ninja.mesh");
ent.CastShadows = true;
node = mSceneMgr.RootSceneNode.CreateChildSceneNode("NinjaNode" + count.ToString());
node.AttachObject(ent);
node.Scale(0.5f, 0.5f, 0.5f);
node.Position = position;
name = count++.ToString();
walkSpeedFactor = 1.0f;
mAnimationState = ent.GetAnimationState("Idle1");
mAnimationState.Loop = true;
mAnimationState.Enabled = true;
mWalkList = new LinkedList<Vector3>();
//mWalkList.AddLast(new Vector3(550.0f, 0.0f, 50.0f));
//mWalkList.AddFirst(new Vector3(-100.0f, 0.0f, -200.0f));
//mWalkList.AddLast(new Vector3(0.0f, 0.0f, 25.0f));
forward = Vector3.NEGATIVE_UNIT_Z;
viewingAngle = 40;
mAnimationState = ent.GetAnimationState("Walk");
mAnimationState.Loop = true;
mAnimationState.Enabled = true;
mWalking = true;
rnd = new Random();
stoneCastle = 0;
castle = new Vector3();
castle = Vector3.ZERO;
nbStoneCastle = 0;
state = "free";
ennemySpotted = 0;
maxView = 200;
}
示例6: ChunkManager
/// <summary>
/// インスタンスを生成します。
/// </summary>
/// <param name="settings">チャンク設定。</param>
/// <param name="graphicsDevice">グラフィックス デバイス。</param>
/// <param name="regionManager">リージョン マネージャ。</param>
/// <param name="sceneManager">シーン マネージャ。</param>
public ChunkManager(
ChunkSettings settings,
GraphicsDevice graphicsDevice,
RegionManager regionManager,
SceneManager sceneManager)
: base(settings.PartitionManager)
{
if (graphicsDevice == null) throw new ArgumentNullException("graphicsDevice");
if (regionManager == null) throw new ArgumentNullException("regionManager");
ChunkSize = settings.ChunkSize;
this.graphicsDevice = graphicsDevice;
this.regionManager = regionManager;
SceneManager = sceneManager;
switch (settings.ChunkStoreType)
{
case ChunkStoreType.Storage:
ChunkStore = StorageChunkStore.Instance;
break;
default:
ChunkStore = NullChunkStore.Instance;
break;
}
EmptyData = new ChunkData(this);
BaseNode = sceneManager.CreateSceneNode("ChunkRoot");
sceneManager.RootNode.Children.Add(BaseNode);
meshManager = new ChunkMeshManager(this, settings.VertexBuildConcurrencyLevel, settings.UpdateBufferCountPerFrame);
}
示例7: Initialize
protected override void Initialize()
{
_sceneManager = new SceneManager();
_sceneManager.AddScene<GameScene>(new ContentManager(Services, Content.RootDirectory));
base.Initialize();
}
示例8: CometsGameObjectFactory
public CometsGameObjectFactory(NessieGame game, SceneManager sceneManager)
: base(sceneManager)
{
this.game = game;
random = new Random();
}
示例9: AnimManager
// CONSTRUCTOR
public AnimManager(SceneManager sm)
{
SM = sm;
Active = false;
AnimationLibrary = new Dictionary<string, LinkedList<ANode>>();
LoadAnimations();
}
示例10: CameraControlSystem
private float _timeSinceLastFrameLastUpdate; // Time value passed to the last call of the method "Update"
#endregion Fields
#region Constructors
public CameraControlSystem(SceneManager sceneManager, string name, Camera camera = null, bool reCalcOnTargetMoving = true)
{
_sceneMgr = sceneManager;
_name = name;
_targetNode = null;
_targetNodeListener = null;
_recalcOnTargetMoving = reCalcOnTargetMoving;
_currentCameraMode = null;
_cameraNode = _sceneMgr.RootSceneNode.CreateChildSceneNode(_name + "SceneNode");
if (camera == null) {
_camera = _sceneMgr.CreateCamera(_name);
_isOwnCamera = true;
} else {
_camera = camera;
_isOwnCamera = false;
}
//Reset to default parameters
_camera.Position = Vector3.ZERO;
_camera.Orientation = Quaternion.IDENTITY;
// ... and attach the Ogre camera to the camera node
_cameraNode.AttachObject(_camera);
_cameraModes = new Dictionary<string, CameraMode>();
}
示例11: DrawLine
public static SceneNode DrawLine(SceneManager sceneMgr, Vector3 p1, Vector3 p2, string material = ColoredMaterials.BLUE)
{
SceneNode node = sceneMgr.RootSceneNode.CreateChildSceneNode();
node.Position = p1;
node.AttachObject(CreateLine(sceneMgr, Vector3.ZERO, p2 - p1, material));
return node;
}
示例12: CreateRectangle
public static ManualObject CreateRectangle(SceneManager sceneMgr, Vector3 pos, Vector3 size, string material = ColoredMaterials.BLUE)
{
Vector3[,] points = new Vector3[2,4];
for (int y = 0; y < 2; y++)
{
points[y, 0] = pos + y * Vector3.UNIT_Y * size.y;
points[y, 1] = pos + new Vector3(1, y, 0) * size;
points[y, 2] = pos + new Vector3(1, y, 1) * size;
points[y, 3] = pos + new Vector3(0, y, 1) * size;
}
ManualObject manOb = sceneMgr.CreateManualObject();
manOb.Begin(material, RenderOperation.OperationTypes.OT_LINE_LIST);
for (int y = 0; y < 2; y++)
{
for (int i = 0; i < 4; i++)
{
manOb.Position(points[y, i]);
manOb.Position(points[y, (i + 1)%4]);
}
}
for (int i = 0; i < 4; i++)
{
manOb.Position(points[0, i]);
manOb.Position(points[1, i]);
}
manOb.End();
return manOb;
}
示例13: CompoundModel
/// <summary>
/// Constructor
/// </summary>
/// <param name="mSceneMgr">A reference to the scene graph</param>
public CompoundModel(SceneManager mSceneMgr)
{
this.mSceneMgr = mSceneMgr;
Load();
AssembleModel();
}
示例14: Load
public void Load()
{
Size clSize = Program.Window.ClientSize;
camera = new ChaseCamera(clSize.Width / (float)clSize.Height);
camera.ChaseDirection = new Vector3(0, 0, 1);
camera.ChasePosition = new Vector3(0, 0, 0);
camera.DesiredPositionOffset = new Vector3(0, 0, 40);
camera.Mode = RenderMode.Final;
camera.FarPlane = 1000;
camera.NearPlane = 0.5f;
camera.RenderTarget = renderSys.GetRenderTarget(0);
distance = 40;
yang = MathEx.Degree2Radian(30);
xang = MathEx.Degree2Radian(45);
sceneManager = new SceneManager();
SceneRendererParameter sm = new SceneRendererParameter ();
sm.PostRenderer = new DefaultPostRenderer();
sm.SceneManager = sceneManager;
sm.UseShadow = false;
renderer = new SceneRenderer(renderSys, sm);
renderer.RegisterCamera(camera);
peff = new SmokeEffect(renderSys);
peff.Emitter = new ParticleEmitter(1);
peff.Modifier = new ParticleModifier();
sceneManager.AddObjectToScene(peff);
}
示例15: Env
RenderWindow mWindow; // This field will contain a reference to the rendering window
#endregion Fields
#region Constructors
/// <summary>
/// Constructor
/// </summary>
/// <param name="mSceneMgr">A reference to the scene manager</param>
public Env(SceneManager mSceneMgr, RenderWindow mWindow)
{
this.mSceneMgr = mSceneMgr;
this.mWindow = mWindow;
Load(); // This method loads the environment
}