コード例 #1
0
    void Start()
    {
        player_center = GameObject.Find("Main Camera").GetComponent <camera_movement>();
        if (player_number == 1)
        {
            other_player        = GameObject.Find("Player2").GetComponent <PlayerBehaviour>();
            my_sword            = GameObject.Find("Sword1").GetComponent <SwordMovement>();
            original_pos        = my_sword.transform.localPosition;
            original_rot        = my_sword.transform.localRotation;
            my_sword.my_weilder = this;
            current_delay       = 0;
        }
        else if (player_number == 2)
        {
            other_player        = GameObject.Find("Player1").GetComponent <PlayerBehaviour>();
            my_sword            = GameObject.Find("Sword2").GetComponent <SwordMovement>();
            original_pos        = my_sword.transform.localPosition;
            original_rot        = my_sword.transform.localRotation;
            my_sword.my_weilder = this;
            current_delay       = 0;
        }

        initial_timescale = PlayerPrefs.GetFloat("Initial_timescale");
        max_timescale     = PlayerPrefs.GetFloat("Max_timescale");
        timescale_rate    = PlayerPrefs.GetFloat("TimeScale_rate");
        Time.timeScale    = initial_timescale;
    }
コード例 #2
0
 // Start is called before the first frame update
 void Start()
 {
     cam = Camera.main.GetComponent <camera_movement>();
 }