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(); } }
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; } }
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(); } } } }
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(); } }