public void SetPlayer(Player player) { mPlayerAvatar = player; mPlayerAvatarReciver = mPlayerAvatar.GetComponent <InputReciever>(); mPlayerAvatarReciver.SetPlayerInput(GetComponent <PlayerInput>()); mPlayerAvatar.PlayerController = this; }
private void Awake() { inputReciever = GetComponent <InputReciever>(); rigodbody = GetComponent <Rigidbody>(); currentRotationY = transform.eulerAngles.y; currentRotationX = transform.eulerAngles.x; }
private void Start() { //_itemToPickup = new DispenserItemData() //{ // itemColor = Color.white, // itemType = DispenserData.Type.None, // sprite = null //}; //_currentItem = new DispenserItem() //{ // DispenserType = DispenserData.Type.None, // DispenserColor = Color.white, // sprite = null //}; //dispenserObject = new DispenserObject() //{ // ObjectType = DispenserData.Type.None, // ObjectColor = Color.white, // Objectsprite = null //}; mRigidBody = GetComponent <Rigidbody2D>(); mInputReceiver = GetComponent <InputReciever>(); mPlayerHeight = GetComponent <CapsuleCollider2D>().size.y; _collectedItemSprite = _collectedItemObject.GetComponent <SpriteRenderer>(); _collectedItemObject.SetActive(false); }
private void OnTriggerEnter2D(Collider2D collision) { if (!mIsPlayer && collision.CompareTag("Player")) { InputReciever inputReciever = this; collision.GetComponent <Player>().PlayerController.SetControllable(inputReciever); } }
protected override void Awake() { reciever = GetComponent <UIInputReciever>(); onClick.AddListener(() => reciever.OnInputRecieved()); }
protected override void SetComponent() { base.SetComponent(); inputReciever = Utility.GetComponentSafely <InputReciever>(gameObject); }
public void SetNoControllable() { mPlayerControllableReciever = null; }
public void SetControllable(InputReciever controllable) { mPlayerControllableReciever = controllable; }
private void Awake() { inputReciever = GetComponent <InputReciever>(); }