// Use this for initialization void Start() { m_rigidbody = GetComponent <Rigidbody>(); m_playerLayerMask = LayerMask.NameToLayer("Player"); m_animator = GetComponent <Animator>(); m_levelManager = GameObject.FindWithTag("LevelManager").GetComponent <LevelManager>(); m_coreGameManager = GameObject.FindWithTag("CoreGameManager").GetComponent <CoreGameManager>(); if (gameObject.layer != m_playerLayerMask) { Debug.LogError("Please make the players layer to be 'Player'"); } Collider collider = m_graphics.GetComponent <Collider>(); if (collider != null) { if (collider.material == null || collider.material.name.Contains("Default")) { Debug.LogError("The player colldier should have the FrictionLess Physics Material"); } } else { Debug.LogError("The player does not have a collider"); } //set up the constraints RigidbodyConstraints desiredConstraints = RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezeRotation; if (m_rigidbody.constraints != desiredConstraints) { Debug.LogWarning("Changing Player Constraints - Freeze position Z | Freeze all rotation;"); m_rigidbody.constraints = desiredConstraints; } }
protected override void AfterStart() { base.AfterStart(); CoreGameManager lCoreGameManager = AppManager.instance?.coreGameManager; if (lCoreGameManager != null) { lCoreGameManager.ClockPropertyChanged += OnClockPropertyChanged; } }
private void Awake() { if (!CoreGameManager.Instance) { //Debug.Log("Setting Singleton"); Instance = this; } else { Destroy(gameObject); } }
void Awake() { if (ins != null && ins != this) { Destroy(this.gameObject); return; } ins = this; DontDestroyOnLoad(this.gameObject); Init(); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); CoreGameManager myScript = (CoreGameManager)target; GUILayout.Space(30); GUILayout.Label(">>> For Test <<<"); if (GUILayout.Button("Clear All Data")) { myScript.ClearAllData(); } }