コード例 #1
0
    void LoadPlayer()
    {
        CreatePlayerNode();

        PlayerNode player = new PlayerNode(GetXmlNode(XmlNodes.Player.player));

        SingletonManager.Player.GetComponent <Transform>().position = player.GetPosition();

        // set player-y rotation
        Vector3 rotation = player.GetRotation();

        SingletonManager.Player.GetComponent <Transform>().eulerAngles = new Vector3(0.0f, rotation.y, 0.0f);

        // set camera-x rotation, this junk doesnt work, rotation will be f****d up all the time... idk
        //Camera.main.transform.eulerAngles = new Vector3(rotation.x, 0.0f, 0.0f);

        Debug.Log("Camera: " + rotation.x.ToString());
        Debug.Log("Player: " + rotation.y.ToString());

        SingletonManager.Player.GetComponent <PlayerOxygen>().m_current  = player.GetOxygen();
        SingletonManager.Player.GetComponent <PlayerBattery>().m_current = player.GetBattery();

        FlashLight.GetInstance().m_hasBeenPickedUp = player.GetFlashLight();
    }