private void Door_Correction()
 {
     //Debug.Log("Running door calc");
     for (int i = 0; i < tm.time_point_list.Count; i++)
     {
         if (tm.time_point_list[i].normalized_timestamp >= tm.modified_current_time)
         {
             if (safe_doors.Count > 0)
             {
                 foreach (var door in safe_doors)
                 {
                     for (int j = 0; j < tm.time_point_list[i].door_data_states.Count; j++)
                     {
                         Door_Activation temp_door = door.GetComponentInChildren <Door_Activation>();
                         if (temp_door == tm.time_point_list[i].door_data_states[j].door_activation)
                         {
                             //Debug.Log("MATCHING DOOR");
                             tm.time_point_list[i].door_data_states[j].last_state = temp_door.is_open;
                         }
                     }
                 }
             }
         }
     }
 }
    public void Add_Door_To_Safety(Door_Activation i_door)
    {
        bool is_door_already_present = false;

        foreach (var door in safe_doors)
        {
            if (door == i_door)
            {
                is_door_already_present = true;
            }
        }

        if (!is_door_already_present)
        {
            safe_doors.Add(i_door);
        }
    }
 public void Set_Linked_Door(Door_Activation i_door_activation)
 {
     door_activation = i_door_activation;
 }
示例#4
0
    IEnumerator Run_Check()
    {
        if (check_obj != null)
        {
            lowest_seen_time = 99999999.0f;

            present_time          = tm.time_of_present;
            modified_current_time = tm.modified_current_time;
            check_obj_collider    = check_obj.GetComponent <Collider>();

            //tm.time_speed = 0.1f;

            is_seen = false;
            int check_counter = 0;

            for (int i = 0; i < tm.timeline_memory.Count; i++)
            {
                if ((tm.timeline_memory[i].normalized_timestamp < present_time) &&
                    (tm.timeline_memory[i].normalized_timestamp > modified_current_time) &&
                    (tm.timeline_memory[i].timestamp / tm.iteration_delay < tm.iteration_num - 1) &&
                    (tm.timeline_memory[i].normalized_timestamp < lowest_seen_time))
                {
                    check_pos = tm.timeline_memory[i].position;
                    Visibility_Check();

                    if (activate_camera_check)
                    {
                        Set_Check_Position(i);
                        activate_camera_check = false;
                        yield return(null);

                        Camera_Check(tm.timeline_memory[i].normalized_timestamp, i);
                        //activate_camera_check = false;
                    }

                    check_counter++;
                }

                if (check_counter >= NUM_OF_CHECKS_PER_FRAME)
                {
                    check_counter = 0;
                    yield return(new WaitForSecondsRealtime(0.2f));
                }

                //Debug.Log(tm.timeline_memory[i].normalized_timestamp);
            }

            if (is_seen)
            {
                //Debug.Log("This object is in an UNSAFE place");
                //Debug.Log("Lowest seen is: " + lowest_seen_time);
                if (is_obj_timeline_original)
                {
                    //Debug.Log("Object is valid");
                }
                else
                {
                    //Debug.Log("Object is INVALID");
                }
                //Debug.Log("IS GRAB = " + is_grab);

                if (is_obj_timeline_original == is_grab)
                {
                    warning_system.Add_Warning("WARNING, PARADOX IMMINENT", is_obj_timeline_original, check_obj.tag, lowest_seen_time, check_obj.transform.position);
                }
            }
            else
            {
                Door_Activation temp_door = check_obj.GetComponentInChildren <Door_Activation>();
                if (temp_door != null)
                {
                    tc.Add_Door_To_Safety(temp_door);
                }
                else
                {
                    tc.Add_Pickup_To_Safety(check_obj, corrector_obj_pos);
                }
            }

            check_pos = new Vector3(9999.0f, 9999.0f, 9999.0f);

            if (controlled_player_object_holder.doors.Count >= 1)
            {
                controlled_player_object_holder.doors.Clear();
            }

            if (controlled_player_object_holder.objects.Count >= 1)
            {
                controlled_player_object_holder.objects.Clear();
            }
        }
        else
        {
            Debug.LogAssertion("Check object for paradox logger came back as NULL?");
        }
        is_done = true;
        yield return(null);
    }