示例#1
0
        void OnEnable()
        {
            if (!blockCursor)
            {
                blockCursor      = Instantiate(blockCursorPrefab);
                blockCursor.name = "BlockCursor";
                blockCursor.SetActive(false);
                meshFilter = blockCursor.GetComponentInChildren <MeshFilter>();
                MeshBuilder.BuildBlock(new Vector3(-0.5f, -0.5f, -0.5f), meshFilter.mesh);
            }
            interactor = GetComponent <BlockInteractor>();
            interactor.selectedBlockChanged += OnSelectedBlockChanged;

            builder = GetComponent <BlockBuilder>();
            if (builder)
            {
                builder.blockTypeSelected += OnSelectedBlockChanged;
            }
        }
示例#2
0
 void Awake()
 {
     blockTypeToBuild = buildableBlocks[0];
     playerTransform  = gameObject.transform;
     interactor       = GetComponent <BlockInteractor>();
 }
示例#3
0
 void OnEnable()
 {
     interactor = GetComponent <BlockInteractor>();
     interactor.selectedBlockChanged += OnSelectedBlockChanged;
 }