예제 #1
0
    void Restart_Loop()
    {
        loop_restarted = true;

        for (int i = 0; i < time_travelling_objects.Count; i++)
        {
            time_travelling_objects[i].is_cooldown_active = false;
        }

        if (!is_jumping_to_custom_time_point)
        {
            Reset_Objects(moveable_object_spawns);

            foreach (var door in door_list)
            {
                door.is_door_opening = false;
            }
        }
        else
        {
            is_jumping_to_custom_time_point = false;
        }

        GameObject spawned_obj = Instantiate(loop_obj);

        Duplicate_Data dupe_data = new Duplicate_Data();

        dupe_data.obj                       = spawned_obj;
        dupe_data.timestamp                 = 1;
        dupe_data.iter_num                  = iteration_num;
        dupe_data.obj_look_pivot            = spawned_obj.GetComponent <Movement_Playback>().this_pivot;
        dupe_data.object_holder             = spawned_obj.GetComponentInChildren <Hold_Object>();
        dupe_data.has_grabbed_this_interval = false;

        dupe_data.paradox_suspicion = 0;

        vis.Add_Camera(spawned_obj.GetComponentInChildren <Camera>());

        foreach (var obj in dupe_objs)
        {
            if (obj != null)
            {
                foreach (var cam in vis.cams)
                {
                    obj.vis.Add_Camera(cam);
                }
            }
        }

        duplicate_player_list.Add(dupe_data);
    }
예제 #2
0
    // Start is called before the first frame update
    void Start()
    {
        pickup_pos  = transform.position;
        col         = GetComponent <Collider>();
        col.enabled = false;

        meshrenderer = GetComponent <MeshRenderer>();
        default_mat  = meshrenderer.material;

        vc.Add_Camera(GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <Camera>());
        rb             = GetComponent <Rigidbody>();
        rb.isKinematic = true;

        timeline_manager   = GameObject.FindGameObjectWithTag("Timeline_Manager").GetComponent <Timeline_Manager>();
        last_iteration_num = timeline_manager.iteration_num;

        last_pos = transform.position;

        rb_default_constraints = rb.constraints;

        //Add_To_Buffer(transform.position, transform.localRotation, current_time);
        //Add_To_Buffer(transform.position, transform.localRotation, current_time);
    }