private void Update() { if (m_iMovableCount <= 0) { return; } if (true == m_playerPosition?.IsMoving) { return; } Masu.DIR dir = GetMoveDir(); GameObject target_masu_object = m_masuCurrent.GetConnectedMasuObject(dir); if (target_masu_object != null) { Masu temp = target_masu_object.GetComponent <Masu>(); int target_masu_id = temp.masu_id; if (0 < m_iMoveCount) { // 戻る if (target_masu_id == m_iMoveHistory[m_iMoveCount - 1]) { m_iMoveHistory[m_iMoveCount] = 0; m_iMoveCount -= 1; m_iMovableCount += 1; } else { m_iMoveCount += 1; m_iMovableCount -= 1; m_iMoveHistory[m_iMoveCount] = target_masu_id; } } else { m_iMoveCount += 1; m_iMovableCount -= 1; m_iMoveHistory[m_iMoveCount] = target_masu_id; } m_playerData.masu_id = target_masu_id; m_masuCurrent = MasuManager.Instance.GetMasu(m_playerData.masu_id); m_evMovableCount.Invoke(m_iMovableCount); if (m_iMovableCount <= 0) { m_evMovableCount.Invoke(-1); OnMoveEnd.Invoke(); OnMoveEnd = null; } } }
// ボタンから呼び出される public void OnPushInt() { if (EventInt != null) { EventInt.Invoke(this, m_iEventParamInt); } }
void OnMouseDrag() { if (!MiroPlayingStatus.bPlaying) { return; } if (CheckBlock()) { return; } if (enabled) { _bDragging = true; //Debug.Log (_cctrl.name + " OnMouseDrag" + " rotate"); Vector3 hitDir = GetHitDir(); int rightDir = _cctrl.GetDir(); float minAngle = 100000.0f; for (int dir = 0; dir < 6; dir++) { if (_banDirs.Contains(dir)) { continue; } CellObjCtrl nbCtrl = CellObjCtrlUtils.GetNbCellObjCtrlInAbsDir(_cctrl, dir); if (nbCtrl == null) { continue; } Vector3 nbDir = nbCtrl.transform.position - _cctrl.transform.position; nbDir.Normalize(); float angle = Vector3.Angle(hitDir, nbDir); if (angle < minAngle) { minAngle = angle; rightDir = dir; } } if (rightDir != _cctrl.GetDir()) { _cctrl.SetDir(rightDir); _cctrl.ChangeDir(); //print ("ChangeDir" + rightDir); _RightDir = rightDir; _DirChanged.Invoke(rightDir); } } }
// Update is called once per frame void Update() { if (touchCount != Input.touchCount) { touchCount = Input.touchCount; OnTouchCountChanged.Invoke(touchCount); } touches = Input.touches; if (touchCount == 1) { Touch tap = Input.touches[0]; if (tap.phase == TouchPhase.Began && dragTime < dragInterval) { OnTouchDown.Invoke(tap); dragTime = 0; } if (tap.phase == TouchPhase.Ended) { OnTapPositionUp.Invoke(tap.position); OnTouchUp.Invoke(tap); dragTime = 0; } if (tap.phase == TouchPhase.Moved && dragTime < dragInterval) { OnMove.Invoke(tap); dragTime = 0; } if ((tap.phase == TouchPhase.Moved || tap.phase == TouchPhase.Stationary) && dragTime >= dragInterval) { OnDrag.Invoke(tap); } dragTime += Time.deltaTime; } else if (touchCount > 1) { Touch tap = Input.touches[0]; if (tap.phase == TouchPhase.Moved) { OnMultiMove.Invoke(Input.touches); } if (tap.phase == TouchPhase.Ended) { OnMultiMoveUp.Invoke(Input.touches); } } else if (Input.GetMouseButtonUp(0)) { OnTapPositionUp.Invoke(Input.mousePosition); } }
protected virtual void Update() { if (deformingMesh.vertices.Length != originalVertices.Length) { CalculateVertices(); onUpdateVertex.RemoveAllListeners(); } if (System.Math.Abs(lastValue - value) > EPSILON || updateRealtime) { for (int i = 0; i < displacedVertices.Length; i++) { UpdateVertex(i); onUpdateVertex.Invoke(i); } deformingMesh.vertices = displacedVertices; deformingMesh.RecalculateNormals(); UpdateYPosition(value); lastValue = value; } }
public void RunEvent() { m_hEvent?.Invoke(m_nInt); }
public void OnEventRaised(int n) { Response.Invoke(n); }
public void OnEventRaised(int value) { Response.Invoke(value); }
public void addHappinessPoints(int points) { happinessPoints += points; changeHappiness.Invoke(happinessPoints); }