// Start is called before the first frame update void Start() { GameObject gameControllerObject = GameObject.FindGameObjectWithTag("GameController"); if (gameControllerObject != null) { score = gameControllerObject.GetComponent <Score>(); } if (score == null) { Debug.Log("Cannot find 'GameController' script"); } GameObject cameraFollowObject = GameObject.FindGameObjectWithTag("MainCamera"); if (cameraFollowObject != null) { cameraFollow = cameraFollowObject.GetComponent <CameraFollow>(); } if (cameraFollowObject == null) { Debug.Log("Cannot find 'cameraFollow' script"); } playerCombo = GetComponent <PlayerCombo>(); rigidbody2D = GetComponent <Rigidbody2D>(); gravity = rigidbody2D.gravityScale; playerMoving = GetComponent <PlayerMoving>(); #if UNITY_IOS || UNITY_ANDROID || UNITY_EDITOR //if current platform is mobile, screenWidth = Screen.width; #endif }
protected void Awake() { m_playerInfo = this.transform.root.GetComponent <PlayerInfo>(); m_playerCombo = this.transform.root.GetComponent <PlayerCombo>(); m_playerState = this.transform.root.GetComponent <PlayerState>(); m_collider = this.GetComponent <PolygonCollider2D>(); m_cinemachineImpulse = this.GetComponent <CinemachineImpulseSource>(); m_spineAnimCollider = this.GetComponent <SpineAnimCollider>(); }
public override void SetDamageColliderInfo(int _damage, string _tagName, Vector2 _attackForce, GameObject _order, bool _autoDistroy = true) { m_sTagName = _tagName; orderObject = _order; m_damage = _damage; attackForce = _attackForce; autoDistroy = _autoDistroy; m_playerInfo = m_playerInfo ?? _order.transform.root.GetComponent <PlayerInfo>(); m_cinemachineImpulse = m_cinemachineImpulse ?? this.GetComponent <CinemachineImpulseSource>(); m_playerCombo = m_playerCombo ?? _order.transform.root.GetComponent <PlayerCombo>(); m_playerState = m_playerState ?? _order.transform.root.GetComponent <PlayerState>(); }
void Start() { GameObject gameControllerObject = GameObject.FindGameObjectWithTag("GameController"); if (gameControllerObject != null) { statefulInspection = gameControllerObject.GetComponent <StatefulInspection>(); gameOver = gameControllerObject.GetComponent <GameOver>(); } MagicCircleStart(); player = GameObject.FindGameObjectWithTag("Player"); playerCombo = player.GetComponent <PlayerCombo>(); }
protected override void SingletonAwake() { base.SingletonAwake(); stateMachine = GetComponent <PlayerStates>(); comboMachine = GetComponent <PlayerCombo>(); }