Пример #1
0
 public void EndTravel()
 {
     traveling = false;
     arrowObject.arrowHead.arrowTipMode  = ArrowTip.ArrowTipMode.None;
     arrowObject.arrowTail.arrowTipMode  = ArrowTip.ArrowTipMode.None;
     arrowObject.arrowPath.arrowPathMode = ArrowPath.ArrowPathMode.None;
     arrowObject.updateArrowMesh();
 }
Пример #2
0
 void Update()
 {
     arrowObject.arrowPath.startPoint = new Vector3(-10, 0, -2.5f);
     arrowObject.arrowPath.endPoint   = new Vector3(5 + 8f * Mathf.Sin(fi), 0, -2.5f);
     arrowObject.updateArrowMesh();
     fi += 2f * Time.deltaTime;
 }
Пример #3
0
    // Update is called once per frame
    void Update()
    {
        KeyboardTargetingDirection();

        arrowIndicator.arrowPath.endPoint   = currentTarget.position;
        arrowIndicator.arrowPath.startPoint = targetOrigin.position;
        arrowIndicator.updateArrowMesh();

        //if (Input.GetKeyDown("1"))
        //{
        //    SwitchTargetRange(1);
        //}
        //if (Input.GetKeyDown("2"))
        //{
        //    SwitchTargetRange(2);
        //}
        //if (Input.GetKeyDown("3"))
        //{
        //    SwitchTargetRange(3);
        //}
        //if (Input.GetKeyDown("4"))
        //{
        //    SwitchTargetRange(4);
        //}
    }
Пример #4
0
    //public GameObject frontPiece;

    void Update()
    {
        arrowObject.arrowPath.startPoint = startPoint.transform.position;
        arrowObject.arrowPath.endPoint   = new Vector3(endPoint.position.x, endPoint.position.y, endPoint.position.z * 10 * Mathf.Abs(Mathf.Sin(fi)));
        arrowObject.updateArrowMesh();
        fi += 1f * Time.deltaTime;
    }
Пример #5
0
 void Update()
 {
     fi += 1f * Time.deltaTime;
     arrowObject.arrowPath.startPoint = new Vector3(-10, 0, +10 * Mathf.Sin(fi));
     arrowObject.arrowPath.endPoint   = new Vector3(10, 0, -10 * Mathf.Sin(fi));
     arrowObject.updateArrowMesh();
 }
Пример #6
0
 void Update()
 {
     fi    += rotationSpeed * Time.deltaTime;
     omega += distanceChangeSpeed * Time.deltaTime;
     arrowObject.arrowPath.startPoint = new Vector3(0, 0, 0);
     arrowObject.arrowPath.endPoint   = new Vector3((Mathf.Sin(omega) * distanceOscilation + distance) * Mathf.Sin(fi), 0, (Mathf.Sin(omega) * distanceOscilation + distance) * Mathf.Cos(fi));
     arrowObject.updateArrowMesh();
 }
Пример #7
0
 void Update()
 {
     arrowObject.arrowPath.startPoint = new Vector3(-10, 0, -5);
     arrowObject.arrowPath.endPoint   = new Vector3(8f * Mathf.Sin(fi), 0, -5);
     fi += 2f * Time.deltaTime;
     arrowObject.arrowPath.rotationFunctionLength = 0.5f + 0.5f * Mathf.Sin(fi);
     arrowObject.updateArrowMesh();
 }
Пример #8
0
 void Update()
 {
     arrowObject.arrowPath.startPoint = new Vector3(-10, 0, -7);
     arrowObject.arrowPath.endPoint   = new Vector3(8f * Mathf.Sin(fi), 0, -7);
     fi += 2f * Time.deltaTime;
     arrowObject.arrowPath.shapeFunctionLength = 6 + 5 * Mathf.Cos(fi);
     arrowObject.updateArrowMesh();
 }
Пример #9
0
 void Update()
 {
     arrowObject.arrowPath.startPoint = new Vector3(-10, 0, -2.5f);
     arrowObject.arrowPath.endPoint   = new Vector3(8f * Mathf.Sin(fi), 0, -2.5f);
     fi += 2f * Time.deltaTime;
     arrowObject.arrowPath.widthFunctionLength  = 2 + 4f * Mathf.Sin(fi);
     arrowObject.arrowPath.heightFunctionLength = 2 + 4f * Mathf.Sin(fi);
     arrowObject.updateArrowMesh();
 }
Пример #10
0
 void Update()
 {
     fi += 0.1f * Time.deltaTime;
     Keyframe[] k = new Keyframe[2] {
         new Keyframe(0, fi), new Keyframe(1, fi)
     };
     arrowObject.arrowPath.rotateFunction.keys = k;
     arrowObject.updateArrowMesh();
 }
Пример #11
0
 void Update()
 {
     arrowObject.arrowPath.endPoint = -me.position + ball.position + new Vector3(0, 1f, 0);
     arrowObject.updateArrowMesh();
     if (ball.GetComponentInChildren <MeshRenderer>().material != meshrenderer.material)
     {
         meshrenderer.material = ball.GetComponentInChildren <MeshRenderer>().material;
     }
 }
Пример #12
0
 // Update is called once per frame
 void Update()
 {
     if (traveling)
     {
         if (arrowObject.arrowPath.editedPath.Count == 0 || ((ball.position + new Vector3(0, 1, 0)) - arrowObject.arrowPath.editedPath[arrowObject.arrowPath.editedPath.Count - 1]).magnitude > 0.2f)
         {
             arrowObject.arrowPath.editedPath.Add(ball.position + new Vector3(0, 1, 0));
             arrowObject.hideIndicator = false;
             arrowObject.updateArrowMesh();
         }
     }
 }
Пример #13
0
    // Use this for initialization
    void Start()
    {
        Vector3[] points = new Vector3[500];
        for (int i = 0; i < 500; i++)
        {
            points[i] = new Vector3(radius * Mathf.Sin(i / 500f * 0.95f * Mathf.PI), 0, radius * Mathf.Cos(i / 500f * 0.95f * Mathf.PI));
        }
        arrowObject.arrowPath.arrowPathType          = ArrowPath.ArrowPathType.PointArray;
        arrowObject.arrowPath.editedPath             = new List <Vector3>(points);
        arrowObject.arrowPath.rotationFunctionLength = 1;
        AnimationCurve curve = AnimationCurve.Linear(0f, rotationAngle, 1f, rotationAngle);

        arrowObject.arrowPath.rotateFunction = curve;
        arrowObject.updateArrowMesh();
    }
Пример #14
0
    void Update()
    {
        int t = 0;

        for (int i = firstPoint; i < lastPoint; i++)
        {
            arrowObject.arrowPath.editedPath[t++] = points[i];
        }
        firstPoint += 2;
        lastPoint  += 2;
        if (lastPoint >= 900)
        {
            firstPoint = 0;
            lastPoint  = 30;
        }
        arrowObject.updateArrowMesh();
    }
Пример #15
0
 // Use this for initialization
 void Start()
 {
     points    = new Vector3[201];
     points[0] = new Vector3(0, 0, 0);
     points[1] = new Vector3(5, 0, 0);
     for (int i = 0; i < 100; i++)
     {
         points[2 + i] = new Vector3(5 + Mathf.Sin(i / 100f * Mathf.PI), 0, i * 1 / 100f);
     }
     points[102] = new Vector3(2.5f, 0, 2f);
     for (int i = 0; i < 97; i++)
     {
         points[103 + i] = new Vector3(1 - Mathf.Sin(i / 97f * Mathf.PI), 0, 4 - i * 1 / 97f);
     }
     points[199] = new Vector3(1f, 0, 4);
     points[200] = new Vector3(33.5f, 0, 4);
     arrowObject.arrowPath.editedPath = new List <Vector3>(points);
     arrowObject.updateArrowMesh();
 }
Пример #16
0
    void Update()
    {
        if (!active)
        {
            return;
        }
        if (endTarget == null)
        {
            return;
        }

        arrowObject.arrowPath.endPoint = -transform.position + endTarget.position + targetOffset;
        arrowObject.updateArrowMesh();

        if (isToTargetMat && endTarget.GetComponentInChildren <MeshRenderer>().material != meshrenderer.material)
        {
            meshrenderer.material = endTarget.GetComponentInChildren <MeshRenderer>().material;
        }
    }
Пример #17
0
    void Update()
    {
        RaycastHit hit;

        //Reset indicators
        destinationIndicator.hideIndicator = true;
        arrowIndicator.hideIndicator       = true;
        arrowIndicator.updateArrowMesh();
        if (Input.GetMouseButtonDown(0) || Input.GetMouseButton(1))
        {
            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            //Left mouse to select objects
            if (Input.GetMouseButtonDown(0))
            {
                if (Physics.Raycast(ray, out hit, 1000.0f))
                {
                    if (hit.collider.gameObject.GetComponent <SelectedObjectOptions>() != null)
                    {
                        //selecting another object changes the currently selected object
                        //selectedObject = hit.collider.gameObject;
                        //selectedIndicator.hideIndicator = false;
                        //selectedIndicator.pathArray = hit.collider.gameObject.GetComponent<SelectedObjectOptions>().myPath;
                        //destinationIndicator.pathArray = hit.collider.gameObject.GetComponent<SelectedObjectOptions>().destinationPathArray;
                        //arrowIndicator.arrowPath.startPoint = hit.collider.gameObject.transform.position;
                    }
                    else
                    {
                        //Ground deselects
                        selectedIndicator.hideIndicator = true;
                        selectedObject = null;
                    }
                }
            }
            if (Input.GetMouseButton(1) && selectedObject != null)
            {
                //Right mouse shows the arrow from start object to desitination and draws the destination outline
                if (Physics.Raycast(ray, out hit, 1000.0f))
                {
                    arrowIndicator.hideIndicator = false;
                    //destinationIndicator.hideIndicator = false;
                    arrowIndicator.arrowPath.endPoint = hit.point;
                    //destinationIndicator.pathArray.translation = hit.point;
                    arrowIndicator.updateArrowMesh();
                    //destinationIndicator.updateIndicatorMesh();
                }
            }
        }
        else
        {
            //hovering over object has another currently hovered selection (broken path selection)
            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            if (Physics.Raycast(ray, out hit, 1000.0f))
            {
                if (hit.collider.gameObject.GetComponent <SelectedObjectOptions>() != null)
                {
                    hoverIndicator.hideIndicator = false;
                    hoverIndicator.pathArray     = hit.collider.gameObject.GetComponent <SelectedObjectOptions>().myPath;
                }
                else
                {
                    hoverIndicator.hideIndicator = true;
                }
            }
        }
    }
Пример #18
0
 void Update()
 {
     arrowObject.arrowPath.endPoint = -me.position + ball.position + new Vector3(0, 0.5f, 0);
     arrowObject.updateArrowMesh();
 }