Esempio n. 1
0
 public void SetPlayer(Player player)
 {
     mPlayerAvatar        = player;
     mPlayerAvatarReciver = mPlayerAvatar.GetComponent <InputReciever>();
     mPlayerAvatarReciver.SetPlayerInput(GetComponent <PlayerInput>());
     mPlayerAvatar.PlayerController = this;
 }
Esempio n. 2
0
 private void Awake()
 {
     inputReciever    = GetComponent <InputReciever>();
     rigodbody        = GetComponent <Rigidbody>();
     currentRotationY = transform.eulerAngles.y;
     currentRotationX = transform.eulerAngles.x;
 }
Esempio n. 3
0
    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);
     }
 }
Esempio n. 5
0
 protected override void Awake()
 {
     reciever = GetComponent <UIInputReciever>();
     onClick.AddListener(() => reciever.OnInputRecieved());
 }
 protected override void SetComponent()
 {
     base.SetComponent();
     inputReciever = Utility.GetComponentSafely <InputReciever>(gameObject);
 }
Esempio n. 7
0
 public void SetNoControllable()
 {
     mPlayerControllableReciever = null;
 }
Esempio n. 8
0
 public void SetControllable(InputReciever controllable)
 {
     mPlayerControllableReciever = controllable;
 }
Esempio n. 9
0
 private void Awake()
 {
     inputReciever = GetComponent <InputReciever>();
 }