private void Start() { _anim = GetComponent <Animator>(); if (_anim == null) { Debug.Log("Animator is null."); } _gm = GameObject.Find("GameManager").GetComponent <GameManager>(); if (_gm == null) { Debug.Log("Game Manager is null."); } _cc = transform.parent.GetComponent <CharacterController>(); if (_cc == null) { Debug.Log("Character Controller is null"); } VerticalMove = transform.parent.GetComponent <IGetVertical>(); if (VerticalMove == null) { Debug.Log("Vertical Input is null"); } }
private int _desiredLane = 1; //0: left, 1: middle, 2: right void Start() { _cc = GetComponent <CharacterController>(); if (_cc == null) { Debug.LogError("Character Controller is null."); } _gm = GameObject.Find("GameManager").GetComponent <GameManager>(); if (_gm == null) { Debug.LogError("Game Manager is null."); } GetHorizontal = GetComponent <IGetHorizontal>(); if (GetHorizontal == null) { Debug.LogError("Input Interface is null"); } GetVertical = GetComponent <IGetVertical>(); if (GetVertical == null) { Debug.LogError("Jumping interface is null"); } GetPosition = GetComponent <IGetPosition>(); if (GetPosition == null) { Debug.LogError("Lane Selection Interface is null"); } }