当前位置: 首页>>代码示例>>C#>>正文


C# SceneManager类代码示例

本文整理汇总了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();
    }
开发者ID:xiaozhuzhaoge,项目名称:QinCloudSuper,代码行数:34,代码来源:Init.cs

示例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> ();
    }
开发者ID:tensus2000,项目名称:Magnaball_1,代码行数:26,代码来源:GameStateManager.cs

示例3: SceneSeven

 public SceneSeven(SceneManager manager)
     : base(manager)
 {
     timeLength = 4.0f;
     permitUnloadResources = false;
     bigHeadProp = new BigHeadProp(resourceFactory);
 }
开发者ID:absurdhero,项目名称:tmotmo-full,代码行数:7,代码来源:SceneSeven.cs

示例4: SkyManager

        public SkyManager(SceneManager manager, Camera camera)
        {
            this.manager = manager;
            this.camera = camera;

            NativeHandle = New_Manager(manager.NativePtr, camera.NativePtr);
        }
开发者ID:andyhebear,项目名称:extramegablob,代码行数:7,代码来源:SkyManager.cs

示例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;
 }
开发者ID:scauglog,项目名称:sma_mogre,代码行数:32,代码来源:Ninja.cs

示例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);
        }
开发者ID:willcraftia,项目名称:TestBlocks,代码行数:39,代码来源:ChunkManager.cs

示例7: Initialize

        protected override void Initialize()
        {
            _sceneManager = new SceneManager();
            _sceneManager.AddScene<GameScene>(new ContentManager(Services, Content.RootDirectory));

            base.Initialize();
        }
开发者ID:Tim569,项目名称:Snake,代码行数:7,代码来源:SnakeGame.cs

示例8: CometsGameObjectFactory

        public CometsGameObjectFactory(NessieGame game, SceneManager sceneManager)
            : base(sceneManager)
        {
            this.game = game;

            random = new Random();
        }
开发者ID:Steveou,项目名称:Comets-Evacuation,代码行数:7,代码来源:CometsGameObjectFactory.cs

示例9: AnimManager

 // CONSTRUCTOR
 public AnimManager(SceneManager sm)
 {
     SM = sm;
     Active = false;
     AnimationLibrary = new Dictionary<string, LinkedList<ANode>>();
     LoadAnimations();
 }
开发者ID:FourFangedCow,项目名称:UnityVN,代码行数:8,代码来源:AnimManager.cs

示例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>();
        }
开发者ID:andyhebear,项目名称:Mccs,代码行数:34,代码来源:CameraControlSystem.cs

示例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;
 }
开发者ID:RenaudWasTaken,项目名称:SkyLands,代码行数:7,代码来源:StaticRectangle.cs

示例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;
        }
开发者ID:RenaudWasTaken,项目名称:SkyLands,代码行数:31,代码来源:StaticRectangle.cs

示例13: CompoundModel

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="mSceneMgr">A reference to the scene graph</param>
        public CompoundModel(SceneManager mSceneMgr)
        {
            this.mSceneMgr = mSceneMgr;

            Load();
            AssembleModel();
        }
开发者ID:Bobbylon5,项目名称:Mogre14,代码行数:11,代码来源:CompoundModel+copy.cs

示例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);
        }
开发者ID:yuri410,项目名称:lrvbsvnicg,代码行数:35,代码来源:RenderViewer.cs

示例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
        }
开发者ID:Bobbylon5,项目名称:Mogre14,代码行数:17,代码来源:Env.cs


注:本文中的SceneManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。