public void TryOpenActionWindow(StoryMapPoint point, StoryEvent storyEvent) { if (ActionWindow.CanShow()) { ActionWindow.ShowWindow(point, storyEvent); } }
public void TryLaunchPlane(StoryMapPoint targetPoint) { if (Player.CurrentState == PlayerLogic.PlaneState.Ready) { Player.StartFly(targetPoint); } }
public void StartFly(StoryMapPoint targetPoint) { _currentPoint = targetPoint; Vector2 newPosition = SpawnPoints[Random.Range(0, SpawnPoints.Count)].anchoredPosition; GetComponent <RectTransform>().anchoredPosition = newPosition; _dirVector = (_currentPoint.transform.position - transform.position).normalized; var targetPos = targetPoint.transform.position; var thisPos = transform.position; targetPos.x = targetPos.x - thisPos.x; targetPos.y = targetPos.y - thisPos.y; var angle = Mathf.Atan2(targetPos.y, targetPos.x) * Mathf.Rad2Deg; transform.rotation = Quaternion.Euler(new Vector3(0, 0, angle - 90)); _state = PlaneState.FlyIn; Plane.SetActive(true); }
public void ShowWindow(StoryMapPoint point, StoryEvent storyEvent) { if (point == null || storyEvent == null) { return; } gameObject.SetActive(true); _actionEnabled = false; Back.transform.localScale = Vector3.zero; _seq = TweenHelper.ReplaceSequence(_seq); _seq.Append(Back.transform.DOScale(1f, 0.35f)); _seq.AppendCallback(() => { _actionEnabled = true; }); WarVariantsHolder.SetActive(storyEvent.Type == EventType.Combat); HumVariantsHolder.SetActive(storyEvent.Type == EventType.Humanitarian); RedWarButton.gameObject.SetActive(storyEvent.RedTeam == true); BlueWarButton.gameObject.SetActive(storyEvent.BlueTeam == true); _curEvent = storyEvent; _curPoint = point; Title.text = _curEvent.Title; Description.text = _curEvent.Description; }