예제 #1
0
        public void SetContext(ViewModel.INode viewModel_)
        {
            Debug.Assert(viewModel_ != null);

            viewModel = viewModel_;
            viewModel.SkillChanged     += OnSkillChanged;
            viewModel.ScaleChanged     += OnScaleChanged;
            viewModel.SelectionChanged += OnSelectionChanged;

            childTranform  = gameObject.transform.Find("GameObject");
            stroke         = childTranform.Find("HexagonStroke").GetComponent <Image>();
            pulse          = childTranform.Find("Pulse").GetComponent <Image>();
            fill           = childTranform.Find("HexagonFill").GetComponent <Image>();
            icon           = childTranform.Find("Icon").GetComponent <Image>();
            iconWhite      = childTranform.Find("White").Find("Icon").GetComponent <Image>();
            specialization = childTranform.Find("Specialization");
            level          = specialization.Find("Level").GetComponent <WestText>();
            handicap       = specialization.Find("Handicap").GetComponent <WestText>();

            positionMultiplier.x = 0.5f * (float)Math.Cos(30.0f * Math.PI / 180.0f);
            positionMultiplier.y = 0.75f;

            positionMultiplier.x = 0.5f * (float)Math.Cos(30.0f * Math.PI / 180.0f);
            positionMultiplier.y = 0.75f;

            OnScaleChanged(1.0f);

            stroke.material = viewModel.Mat();
            pulse.material  = viewModel.Mat();
            fill.material   = viewModel.Mat();
            icon.material   = viewModel.Mat();

            OnSkillChanged();
            OnSelectionChanged(viewModel.Selected());
        }
예제 #2
0
        public VideoInfo(ViewModel.INode node)
            : this()
        {
            Context = node;

            LoadVideoDetails();
        }
예제 #3
0
 public VideoSizeHelper(ViewModel.INode nodeContext)
 {
     ViewModel.IMetadata videoSizeMetadata = nodeContext.Metadata["Video.Size"];
     if (videoSizeMetadata != null)
     {
         Size = ParseVideoSize(videoSizeMetadata.Value);
     }
 }
예제 #4
0
        public VideoInfo CreateVideoInfoViewModel(ViewModel.INode node)
        {
            var viewModelVideoInfo = new VideoInfo(node);

            viewModelVideoInfo.PropertyChanged += OnVideoInfoChanged;

            ViewModels[viewModelVideoInfo.Id] = viewModelVideoInfo;

            viewModelVideoInfo.SetStartPositionRequested += OnSetStartPositionRequested;
            viewModelVideoInfo.SetStopPositionRequested  += OnSetStopPositionRequested;

            return(viewModelVideoInfo);
        }
예제 #5
0
        override protected void OnDestroy()
        {
            base.OnDestroy();
            if (viewModel == null)
            {
                return;
            }

            viewModel.SkillChanged     -= OnSkillChanged;
            viewModel.ScaleChanged     -= OnScaleChanged;
            viewModel.SelectionChanged -= OnSelectionChanged;
            viewModel = null;
        }