コード例 #1
0
ファイル: IceShotSpell.cs プロジェクト: Yunshiyue/ElementGame
    private void Shot()
    {
        //Debug.Log("射出冰箭");
        GameObject iceArrow = poolManager.GetGameObject(spellName);
        IceArrow   script   = iceArrow.GetComponent <IceArrow>();

        script.SetThrower(player);
        Vector2 startDirection = player.transform.position;

        startDirection.x += movementComponent.IsFacingLeft() ? -1 : 1;
        script.SetStartPosition(startDirection);
        script.SetDirection(movementComponent.IsFacingLeft() ? Vector2.left : Vector2.right);
    }
コード例 #2
0
    public override void ReleaseSpell()
    {
        GameObject iceArrow = poolManager.GetGameObject(spellName);
        IceArrow   script   = iceArrow.GetComponent <IceArrow>();

        script.SetThrower(player);
        Vector2 startDirection = player.transform.position;

        startDirection.x += movementComponent.IsFacingLeft() ? -1 : 1;
        script.SetStartPosition(startDirection);
        script.SetMaxExistTime(0.8f);
        script.SetDirection(movementComponent.IsFacingLeft() ? Vector2.left : Vector2.right);
    }