Example #1
0
    public void InitCharSwordObject(string swordId)
    {
        if (charaData.IsDead || string.IsNullOrEmpty(swordId))
        {
            return;
        }

        //剣の場合はweaponオブジェクトが既にあるのでパラメータのみの受け渡しOwnerだけ設定しておく
        //パラメータコピー
        _swordObject.CopyParamsFrom(swordId);

        //Ower上書き
        _swordObject.Owner = gameObject;

        //自キャラの場合はマーカー移動
        if (gameObject.GetComponent <PlayerObject> () != null)
        {
            Vector3 markerPos = transform.position;
            markerPos.x += _swordObject.ReachLength;
            GameManager.Instance.swordReachMarker.transform.position = markerPos;
        }
    }