void Start() { rb = GetComponent <Rigidbody2D>(); animator = GetComponent <Animator>(); isFacingRight = true; healthSystem = GetComponent <HealthSystem>(); InvisibleWall.SetActive(false); joystick = FindObjectOfType <Joystick>(); stickButton = FindObjectOfType <JoyStickButton>(); }
void Awake() { leftMoveBtn.SetMoveEvent(LeftMove); RightMoveBtn.SetMoveEvent(RightMove); leftMoveBtn.SetUpEvent(UpMoveBtn); RightMoveBtn.SetUpEvent(UpMoveBtn); ActionBtn.SetMoveEvent(OnPlayerAction); _portalExecuter = GetComponent <PortalExecuter>(); _currentPushButton = RightMoveBtn; KnockbackInfomation = new KnockbackInfomation(this, _jumpInfomation, HitEvent); }
private bool SetMoveButton(GameObject pushObject, JoyStickButton button) { if (pushObject.gameObject.Equals(button.gameObject)) { if (!_currentPushButton.Equals(button)) { _currentPushButton.OnUp(); } _currentPushButton = button; _currentPushButton.OnDown(); return(true); } return(false); }