コード例 #1
0
    // ISCENECOMPONENT INTERFACE

    void ISceneComponent.Initialize(MainScene scene)
    {
        m_HeadTransform  = scene.PlayerController.HeadTransform;
        m_TerrainManager = scene.TerrainManager;
        m_InputManager   = scene.InputManager;

        m_TerrainBlock.Initialize(m_TerrainManager.BlockSettings);
        UpdateSelectedBlock(true);
    }
コード例 #2
0
ファイル: MainScene.cs プロジェクト: TomasKimer/GripCraft
    // PRIVATE METHODS

    private void InitializeSceneComponents()
    {
        var sceneComponents = GetComponentsInChildren <ISceneComponent>(true);

        PlayerController = FindComponent <PlayerController>(sceneComponents);
        InputManager     = FindComponent <InputManager>(sceneComponents);
        TerrainManager   = FindComponent <BlockTerrainManager>(sceneComponents);

        System.Array.ForEach(sceneComponents, component => component.Initialize(this));
    }