Example #1
0
    //Save overall path player
    public static void PathTracing(GameObject obj)
    {
        Vector3 current_position = obj.transform.position;
        Vector3 current_rotation = obj.transform.rotation.eulerAngles;

        objPath = new CompletePath.PathMapping();
        int k = Demo.trialPath.Count;

        if (k == 0 || Demo.trialPath[k - 1].s_x != current_position.x && Demo.trialPath[k - 1].s_z != current_position.z)
        {
            objPath.s_x = current_position.x;
            objPath.s_y = current_position.y;
            objPath.s_z = current_position.z;
            objPath.r_x = current_rotation.x;
            objPath.r_y = current_rotation.y;
            objPath.r_z = current_rotation.z;
            objPath.t   = Demo.trial_t;
            Demo.trialPath.Add(objPath);
        }
    }
 //Save overall path player
 public static void PathTracing(GameObject obj)
 {
     Vector3 current_position = obj.transform.position;
     Vector3 current_rotation = obj.transform.rotation.eulerAngles;
     objPath = new CompletePath.PathMapping();
     int k = Demo.trialPath.Count;
     if (k == 0 || Demo.trialPath[k - 1].s_x != current_position.x && Demo.trialPath[k - 1].s_z != current_position.z)
     {
         objPath.s_x = current_position.x;
         objPath.s_y = current_position.y;
         objPath.s_z = current_position.z;
         objPath.r_x = current_rotation.x;
         objPath.r_y = current_rotation.y;
         objPath.r_z = current_rotation.z;
         objPath.t = Demo.trial_t;
         Demo.trialPath.Add(objPath);
     }
 }