Ejemplo n.º 1
0
    protected override void Start()
    {
        base.Start();

        manager    = GetComponent <InputManager>();
        trajectory = GetComponent <TrajectoryPredict>();

        //Animation Setup
        thrustersBackRight  = Right.GetComponentsInChildren <Animator>();
        thrustersBackLeft   = Left.GetComponentsInChildren <Animator>();
        thrustersFrontLeft  = FrontLeft.GetComponentsInChildren <Animator>();
        thrustersFrontRight = FrontRight.GetComponentsInChildren <Animator>();
    }
Ejemplo n.º 2
0
    public void ProjectileTrajectory()
    {
        barrelPos      = transform.position + (transform.up * barrelLength);
        fireVelocity   = (fireSpeed * transform.up) + new Vector3(transform.parent.GetComponent <Ship>().velocity.x, transform.parent.GetComponent <Ship>().velocity.y);
        turretLineDraw = GetComponent <TrajectoryPredict>();

        //float a = Vector3.Angle(transform.up, transform.parent.GetComponent<Rigidbody2D>().velocity) / 180;
        //int lineRes = Mathf.CeilToInt(Mathf.Lerp(lineResMax, 1, a));

        int lineRes = 10;

        turretLineDraw.SimulatePath(barrelPos, fireVelocity, lineDistanceMax, lineRes);
    }