Ejemplo n.º 1
0
    Arrows ArrowUsingBig;    //弹矢引用保存
    public void Step3()
    {
        theStateNow = skillState.isUsing;
        forward     = -this.thePlayer.transform.up;
        //考虑到多种连发的情况,暂时还是不做弹矢的对象池子,后期优化吧
        if (!ArrowUsingBig)
        {
            ArrowUsingBig             = GameObject.Instantiate(Arrow).GetComponent <Arrows> ();
            ArrowUsingBig.thePlayer   = this.thePlayer;
            ArrowUsingBig.extraDamage = this.thePlayer.attackDamage * 0.25f;            //超大号剑气具有额外的伤害
            Vector3 scaleOld = ArrowUsingBig.transform.localScale;
            ArrowUsingBig.transform.localScale = new Vector3(scaleOld.x * 8f, scaleOld.y * 7f, scaleOld.z * 2f);
            ArrowUsingBig.GetComponent <TrailRenderer> ().widthMultiplier = 5f;
        }
        ArrowUsingBig.gameObject.SetActive(true);

        ArrowUsingBig.transform.position = thePlayer.transform.position + thePlayer.transform.rotation * new Vector3(0f, 0.2f * thePlayer.transform.localScale.y + 2.25f, 2f);

        ArrowUsingBig.transform.forward = forward;
        Invoke("effectDestoryExtraBig", skillEffectTime * 1.5f);
    }