Ejemplo n.º 1
0
    void FixedUpdate()
    {
        if (!m_active)
        {
            return;
        }
        m_way.step();

        Vector3 final = m_start_position + (m_point_a + (m_point_b - m_point_a) * m_way.Current());

        this.transform.localPosition = final;
    }
Ejemplo n.º 2
0
    void FixedUpdate()
    {
        if (!m_active)
        {
            return;
        }
        float diff = m_way.step();

        if (diff == 0.0f)
        {
            return;
        }
        float   rot    = m_max_rotation == 0.0f ? 360.0f : m_max_rotation;
        float   amount = diff * rot;
        Vector3 v      = transform.TransformPoint(m_rotation_centre);    // m_start_position;

        transform.RotateAround(v, new Vector3(0, 0, 1), amount);
    }
Ejemplo n.º 3
0
    // Update is called once per frame
    void FixedUpdate()
    {
        if (!m_active)
        {
            return;
        }
        m_way.step();

        float total_lengt = get_total_length_local();

        foreach (PathMovementAnchor anchor in m_items)
        {
            if (anchor.m_target == null)
            {
                continue;
            }
            float   current = m_way.get_current_with_offset(anchor.m_offset);
            Vector3 on_path = get_pos_on_path_local(current);
            anchor.m_target.transform.position = transform.TransformPoint(on_path + anchor.pos_offset);
        }
    }