// Use this for initialization private void Start() { rigidbody = GetComponent <Rigidbody2D>(); stateManager = GetComponent <PlayerStateManager>(); this.FrameDelayCall(() => { stateManager.AttemptNormalMovement(StartStayStill, EndStayStill); }, 1); }
// Use this for initialization private void Start() { rb2d = this.EnsureComponent <Rigidbody2D>(); stateManager = this.EnsureComponent <PlayerStateManager>(); GameManager.instance.notificationManager.CallOnMessageWithSender( Message.PlayerStick, playerPair => { Tuple <Vector2, GameObject> pair = playerPair as Tuple <Vector2, GameObject>; GameObject player = pair?.Item2; if (pair != null && this != null && player == this.gameObject) { lastDirection = pair.Item1; } }); stateManager.AttemptNormalMovement(StartPlayerMovement, StopAllMovement); }