Beispiel #1
0
    protected override void OnViewUpdate()
    {
        base.OnViewUpdate();

        if (IsInvalid(InvalidationFlag.DYNAMIC_DATA))
        {
            if (_icon != null)
            {
                _icon.color = _getColor(_boardPosition.type);
            }

            transform.localPosition = BoardPositionUtil.GetViewPosition(_boardPosition);

            // DebugInfo
            _positionType = _boardPosition.type;
            _trackIndex   = _boardPosition.trackIndex;
            _ownerIndex   = _boardPosition.ownerIndex;

            if (_debugNumber != null)
            {
                _debugNumber.text  = _trackIndex.ToString();
                _debugNumber.color = _trackIndex % 2 == 0 ? Color.green : Color.red;
            }
        }
    }
Beispiel #2
0
    protected override void OnViewUpdate()
    {
        base.OnViewUpdate();

        if (IsInvalid(InvalidationFlag.DYNAMIC_DATA))
        {
            if (_icon != null)
            {
                _icon.color = PlayerUtil.GetColor(piece.ownerIndex);
            }

            transform.localPosition = BoardPositionUtil.GetViewPosition(boardPosition);
            // DebugInfo
            _positionType = boardPosition.type;
            _trackIndex   = boardPosition.trackIndex;
            _ownerIndex   = piece.ownerIndex;
        }
    }