private void AddMazePlayer() { GameObject goMazePlayer = preFactory.GetMazePlayer(); CSGameObject.AddChildGO(goMazePlayer, this.gameObject); scrPlayer = goMazePlayer.GetComponent <SCRPlayer>(); scrPlayer.Init(this, scrGrid.firstPos); }
private SCRBlock CreateOneBlock(int index) { GameObject goBlock = preFactory.CreateMazeBlock(); CSGameObject.AddChildGO(goBlock, this.gameObject); goBlock.name += "_" + index; SCRBlock scr = goBlock.GetComponent <SCRBlock>(); scr.Init(this, index); if (onClickBlock != null) { scr.onClickBlock += onClickBlock; } return(scr); }