示例#1
0
    private void Awake()
    {
        DontDestroyOnLoad(this);

        if (player == null)
        {
            player = this;
        }
        else
        {
            Destroy(gameObject);
        }

        if (playerStart == null)
        {
            playerStart = FindObjectOfType <PlayerStart>();
        }

        gameObject.transform.position = playerStart.GetPosition();

        source = GetComponent <AudioSource>();
    }
示例#2
0
 private void OnLevelWasLoaded(int level)
 {
     playerStart = FindObjectOfType <PlayerStart>();
     gameObject.transform.position = playerStart.GetPosition();
 }