コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        m_Vector = CoordSystem.SphericalToCartesian(m_SphVector);

        //on fait tourner l'objet
        transform.RotateAround(m_PivotPoint.position, m_Vector.normalized, m_RotAngularSpeed * Time.deltaTime);

        VectorDisplayService.Display(name + ".rotVector", m_Vector, m_PivotPoint.position, m_VectorDisplayColor, m_VectorSizeMultiplier);
    }
コード例 #2
0
    // Update is called once per frame
    void Update()
    {
        m_Vector = CoordSystem.SphericalToCartesian(m_SphVector);

        //on fait tourner l'objet
        transform.Rotate(m_Vector.normalized, m_RotAngularSpeed * Time.deltaTime, m_RelativeTo);

        //On dessine le vecteur de rotation
        switch (m_RelativeTo)
        {
        case Space.World:
            VectorDisplayService.Display(name + ".vector", m_Vector, transform.position, m_VectorDisplayColor, m_VectorSizeMultiplier);
            break;

        case Space.Self:
            VectorDisplayService.Display(name + ".vector", transform.TransformDirection(m_Vector), transform.position, m_VectorDisplayColor, m_VectorSizeMultiplier);
            break;
        }
    }