コード例 #1
0
    void show_goal_person_image()
    {
        canvasobject2      = new GameObject("Canvas");
        canvas2            = canvasobject2.AddComponent <Canvas> ();
        canvas2.renderMode = RenderMode.WorldSpace;
        var image_object = canvasobject2.AddComponent <Image> ();

        image_object.transform.SetParent(Scramble_Image.transform);
        image_object.rectTransform.sizeDelta        = new Vector2(300, 300);
        image_object.rectTransform.anchoredPosition = new Vector3(0, -95, 0);

        // get person image & create output_part list
        mark_direction_practice_goalTable_personImage TargetImage = wooden_fence.GetComponent <mark_direction_practice_goalTable_personImage> ();

        returned_person_image = TargetImage.set_person_image();

        Sprite icon = Sprite.Create(returned_person_image, new Rect(0.0f, 0.0f, 512, 512), new Vector2(0.5f, 0.5f));

        image_object.sprite = icon;

//		if(!target_finish){
//			target_finish = true;
//			Application.CaptureScreenshot(trial_ith_formal_exp_stage3 + "_target.png");
//		}

        if ((isIn_formal_exp_stage1 & trial_ith_formal_exp_stage1 < 2) |
            (isIn_formal_exp_stage2 & trial_ith_formal_exp_stage2 < 2))
        {
            isPausing_inst_targetP = true;
        }
        else
        {
            if (noITI)
            {
                noise4();
            }
            else
            {
                Invoke("noise4", 2f);
            }
        }
    }
コード例 #2
0
    void initilzing()
    {
        // set enter direction pool
        mark_direction_practice_enter_direction_person create_initial_direction_pool = wooden_fence.GetComponent <mark_direction_practice_enter_direction_person> ();

        create_initial_direction_pool.create_initial_direction_pool_for_each_map();

        // create_goal_table
        mark_direction_practice_goalTable_personImage create_goal_table = wooden_fence.GetComponent <mark_direction_practice_goalTable_personImage> ();

        create_goal_table.create_goal_table();

        // load_person_image
        mark_direction_practice_goalTable_personImage load_person_image = wooden_fence.GetComponent <mark_direction_practice_goalTable_personImage> ();

        load_person_image.load_person_image();


        // load response cue
        one_two_three = (Texture2D)Resources.Load("123");
        one_three_two = (Texture2D)Resources.Load("132");
        two_one_three = (Texture2D)Resources.Load("213");
        two_three_one = (Texture2D)Resources.Load("231");
        three_one_two = (Texture2D)Resources.Load("312");
        three_two_one = (Texture2D)Resources.Load("321");

        cue_list.Add(one_two_three);
        cue_list.Add(one_three_two);
        cue_list.Add(two_one_three);
        cue_list.Add(two_three_one);
        cue_list.Add(three_one_two);
        cue_list.Add(three_two_one);

        Instantiate(FPScontroller, Vector3.zero, Quaternion.Euler(0, 0, 0));
        Instantiate(wooden_fence, new Vector3(reference_coordinate_x, 0, reference_coordinate_z), Quaternion.Euler(0, 0, 0));

        for (int i = 0; i < 34; i++)
        {
            if (i == 0)
            {
                new_coordinate_x = reference_coordinate_x;
                new_coordinate_z = reference_coordinate_z;
                Instantiate(wooden_fence, new Vector3(new_coordinate_x, 0.0f, new_coordinate_z), Quaternion.Euler(0, fence_rotation, 0));
            }
            if (i != 0)
            {
                fence_rotation = fence_rotation + RotateAngle_for_fence;
                if (i == 1)
                {
                    new_coordinate_x = reference_coordinate_x;
                    new_coordinate_z = reference_coordinate_z + 4.6f;
                    Instantiate(wooden_fence, new Vector3(reference_coordinate_x, 0.0f, new_coordinate_z), Quaternion.Euler(0, fence_rotation, 0));
                }
                if (i > 1)
                {
                    new_coordinate_x = new_coordinate_x + 4.6f * Mathf.Sin(((fence_rotation - RotateAngle_for_fence) * Mathf.PI) / 180);
                    new_coordinate_z = new_coordinate_z + 4.6f * Mathf.Cos(((fence_rotation - RotateAngle_for_fence) * Mathf.PI) / 180);
                    Instantiate(wooden_fence, new Vector3(new_coordinate_x, 0.0f, new_coordinate_z), Quaternion.Euler(0, fence_rotation, 0));
                }
            }
        }
    }