Пример #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());
        }