Exemple #1
0
 // Use this for initialization
 void Start()
 {
     _target = transform.parent.gameObject;
     manager = _target.GetComponent <ChessmanController> ();
     UpdateText(ChessmanManager.chessman[int.Parse(_target.name)]._type.ToString());
     ResetUI();
 }
Exemple #2
0
    /// <summary>
    /// 指派目标.
    /// </summary>
    /// <param name="target">Target.</param>
    public void SetTarget(ChessmanController target)
    {
        if (target == null)
        {
            Debug.LogError("<Color=Red><b>Missing</b></Color> PlayMakerManager target for PlayerUI.SetTarget.", this);
            return;
        }

        // Cache references for efficiency because we are going to reuse them.
        _target          = target;
        _targetTransform = _target.GetComponent <Transform>();
    }
    /// <summary>
    /// 指派目标.
    /// </summary>
    /// <param name="target">Target.</param>
    public void SetTarget(ChessmanController target)
    {
        if (target == null)
        {
            Debug.LogError("<Color=Red><b>Missing</b></Color> PlayMakerManager target for PlayerUI.SetTarget.", this);
            return;
        }

        // Cache references for efficiency because we are going to reuse them.
        _target          = target;
        _targetTransform = _target.GetComponent <Transform>();
        //_targetRenderer = _target.GetComponent<Renderer>();

        UpdateText(ChessmanManager.chessman[int.Parse(_target.name)]._type.ToString());
    }