Esempio n. 1
0
    private void toucher_PickUpGameObject(GameObjectTransferEventArgs eventArgs)
    {
        var go = eventArgs.GameObject;

        // touching falling bullets.
        if (go.GetComponent<FallingBullet>() != null)
        {
            if (SwapType == SwapTypes.CLICK)
            {
                var last = toucher.LastPickedUpGameObject;

                if (last != null && go != last)
                {
                    frame.SwapBullets(go, last);
                    toucher.ClearHistory();
                }
            }
        }
        if (go.GetComponentInChildren<WeaponButton>() != null)
        {
            var weapon = go.GetComponentInChildren<WeaponButton>();
            weapon.FireWeapon();
        }
    }
Esempio n. 2
0
 public void toucher_OverGameObject(GameObjectTransferEventArgs eventArgs)
 {
     var go = eventArgs.GameObject;
     var gos = go.GetComponent<FallingBullet>();
     //Debug.Log("HoverOver Event");
     // touching falling bullets.
     if (gos != null)
     {
         this.HoverEffectObject.gameObject.transform.position = gos.gameObject.transform.position;
     }
     else
     {
         this.HoverEffectObject.gameObject.transform.position = Vector3.zero;
     }
 }
Esempio n. 3
0
    private void toucher_DropGameObject(GameObjectTransferEventArgs eventArgs)
    {
        var go = eventArgs.GameObject;
        // touching falling bullets.
        if (go.GetComponent<FallingBullet>() != null)
        {
            if (SwapType == SwapTypes.DRAG_DROP)
            {
                var last = toucher.LastPickedUpGameObject;

                if (last != null && go != last)
                {
                    frame.SwapBullets(go, last);
                    toucher.ClearHistory();
                }
            }
        }
    }
Esempio n. 4
0
 private void toucher_PickUpGameObject(GameObjectTransferEventArgs eventArgs)
 {
     if (this.menuButtons.Keys.FirstOrDefault(s => s == eventArgs.GameObject.name) != null)
     {
         this.menuButtons[eventArgs.GameObject.name].GoToAssignedMenu();
         toucher.ClearHistory();
     }
 }