private void Awake() { jsonStr = dataText.text; path = JsonUtility.FromJson <Data>(jsonStr); InitWaypoint(); InitRender(); _activeState = GetComponent <ActiveState>(); _idleState = GetComponent <IdleState>(); _activeState.InitState(this, _idleState); _idleState.InitState(this, _activeState); ChangeState(_idleState); }