// Start is called before the first frame update void Start() { frictionEnabled = false; JumpStrength = minJumpStrength; SlimeState = SlimeState.Falling; try { rb = gameObject.GetComponent <Rigidbody2D>(); } catch (System.NullReferenceException e) { Debug.LogError("The PlayerController requires a Rigidbody2D! Generating one instead...\nException: " + e); rb = gameObject.AddComponent <Rigidbody2D>(); } finally { rb.gravityScale = this.gravityScale; rb.mass = 1; rb.freezeRotation = true; } if (arcManager == null) { try { arcManager = GameObject.FindObjectOfType <ArcManager>(); } catch (System.NullReferenceException e) { Debug.LogError("You need to have an ArcManager in the Scene to use a PlayerController!\nException: " + e); throw e; } } arcManager.enabled = false; }
// Start is called before the first frame update void Start() { if (!singleton) { DontDestroyOnLoad(gameObject); singleton = this; } else { Destroy(gameObject); } if (!arc_base[0]) { Spown(); } }
void Awake() { Instance = this; }