void ListenUp(object param) { VirtualKeyParameter p = param as VirtualKeyParameter; Action <float> action = null; if (UpListeners.TryGetValue(p.key, out action)) { action(p.additionalData); } }
/// <summary> /// 발사가 끝났다 /// </summary> /// <param name="param"></param> public void ListenFireStop(object param) { VirtualKeyParameter p = param as VirtualKeyParameter; if (VK_Enum.VK_Button1 != p.key) { return; } float curWidth = rectTransform.rect.width; float curHeight = rectTransform.rect.height; float nextWidth = DEFAULT_SIZE * accuracy; float nextHeight = DEFAULT_SIZE * accuracy; tween.Set(new Vector2(curWidth, curHeight), new Vector2(nextWidth, nextHeight)); tween.PlayFromBegin(); //Debug.Log( "Fire stop" ); }
public void ListenFireEvent(object param) { VirtualKeyParameter p = param as VirtualKeyParameter; if (VK_Enum.VK_Button1 != p.key) { return; } bool isCoolTime = beforeTime > Time.realtimeSinceStartup; bool isHaveBullet = remainBullet > 0; if (!isCoolTime && isHaveBullet) { GlobalEventQueue.EnQueueEvent(E_Event.Fire, null); beforeTime = Time.realtimeSinceStartup + intervalTime; --remainBullet; ShootRaycast(); } }