Ejemplo n.º 1
0
    private void UpdateMissileTransform(Missile mis)
    {
        if (!mis.alive && (mis.goQuadSourceStatic == null || mis.goQuadTargetStatic == null))
        {
            return;
        }

        if (mis.has_source)
        {
            if (mis.source_coord[2] < 0.015f)
            {
                mis.CreateTransform(ref mis.source_position, ref mis.source_euler, mis.source_coord);
                mis.draw_source_impact = true;

                mis.goQuadSource.transform.localPosition          = mis.source_position;
                mis.goQuadSource.transform.localEulerAngles       = mis.source_euler;
                mis.goQuadSourceStatic.transform.localPosition    = mis.source_position;
                mis.goQuadSourceStatic.transform.localEulerAngles = mis.source_euler;
            }
            else
            {
                mis.draw_source_impact = false;
            }
        }
        else
        {
            if (MLS_ff_impacts)
            {
                mis.start_time -= 1f;
            }
        }

        mis.CreateTransform(ref mis.target_position, ref mis.target_euler, mis.target_coord);

        if (mis.has_target)
        {
            mis.goQuadTarget.transform.localPosition          = mis.target_position;
            mis.goQuadTarget.transform.localEulerAngles       = mis.target_euler;
            mis.goQuadTargetStatic.transform.localPosition    = mis.target_position;
            mis.goQuadTargetStatic.transform.localEulerAngles = mis.target_euler;
            if (mis.bShowCone && mis.goCone != null)
            {
                mis.goCone.transform.localPosition    = mis.target_position;
                mis.goCone.transform.localEulerAngles = mis.target_euler;
            }
        }
        if (mis.bShowIcon && mis.goShapeIcon != null)
        {
            mis.goShapeIcon.transform.localPosition    = mis.target_position;
            mis.goShapeIcon.transform.localEulerAngles = mis.target_euler;
        }
    }