This commit is contained in:
Christer Warén
2022-04-01 08:47:42 +03:00
parent 1ab4724225
commit e15e813614
13 changed files with 853 additions and 45 deletions

View File

@ -0,0 +1,30 @@
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using UnityEngine;
using UnityEngine.UI;
public class Game : MonoBehaviour
{
public Button button;
private GameObject player;
private Rigidbody2D rbody;
private GameObject camera;
void Start()
{
camera = GameObject.FindWithTag("MainCamera");
player = GameObject.FindWithTag("Player");
rbody = player.GetComponent<Rigidbody2D>();
button.onClick.AddListener(Respawn);
}
void Respawn()
{
rbody.velocity = new Vector3(0, 0, 0);
player.transform.position = new Vector3(-60.5f, 9.3f, -0.16f);
camera.transform.position = new Vector3(-51.7597f, 14.07621f, -32.28906f);
//CameraController.storedPosition = 0f;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 198b158ebd15b4b4fb0620187b2abe75
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: