public void UpdateEnemyFlagPointer(UpdateEvent e, EnemyFlagPointerNode pointer, [JoinAll] SelfBattleUser user, [JoinByUser] HUDNodes.SelfTankNode selfTank, [JoinByBattle] ICollection <FlagNotHomeNode> flags, [JoinAll] BattleCameraNode battleCamera, [JoinAll] SingleNode <CTFComponent> ctfGameNode) { if (flags.Count >= 2) { FlagNotHomeNode oppositeTeamFlag = this.GetOppositeTeamFlag(flags, user); if ((oppositeTeamFlag != null) && this.NotFlagCarrier(selfTank, oppositeTeamFlag)) { this.SetFlagPointerPosition(oppositeTeamFlag, pointer.enemyFlagPointer, battleCamera.camera.UnityCamera); } else { pointer.enemyFlagPointer.Hide(); } } }
private void SetFlagPointerPosition(FlagNotHomeNode flag, FlagPointerComponent pointer, Camera battleCamera) { bool flag2; pointer.Show(); BoxCollider boxCollider = flag.flagCollider.boxCollider; Vector2 size = pointer.selfRect.rect.size; Vector3 localScale = pointer.parentCanvasRect.localScale; Vector2 selfRect = new Vector2(size.x * localScale.x, size.y * localScale.y); Vector3 worldPos = boxCollider.transform.TransformPoint(boxCollider.center); Vector2 vector5 = this.CalculateFlagScreenPosition(pointer, battleCamera, worldPos, selfRect, out flag2); RectTransform parentCanvasRect = pointer.parentCanvasRect; pointer.transform.localPosition = (Vector3)(this.GetCanvasPosition((Vector3)vector5, parentCanvasRect) + new Vector2(0f, !flag2 ? 0f : (size.y / 2f))); }
public void ChangeBaseIconWhenFlagNotHome(NodeAddedEvent e, [Combine] FlagNotHomeNode flag, [JoinByTeam] FlagPedestalNode flagPedestal, SelfBattleUser user, [Context] SingleNode <AlliesBasePointerComponent> alliesPointer, [Context] EnemyBasePointer enemyPointer) { this.SetFlagNotHomeIcon(flag, user, alliesPointer, enemyPointer); }
public void UpdateAlliasFlagPointer(UpdateEvent e, SingleNode <AlliesFlagPointerComponent> pointer, [JoinAll] HUDNodes.SelfTankNode selfTank, [JoinByTeam] FlagNotHomeNode flag, [JoinAll] BattleCameraNode battleCamera, [JoinAll] SingleNode <CTFComponent> ctfGameNode) { if (this.NotFlagCarrier(selfTank, flag)) { this.SetFlagPointerPosition(flag, pointer.component, battleCamera.camera.UnityCamera); } else { pointer.component.Hide(); } }
private bool NotFlagCarrier(HUDNodes.SelfTankNode selfTank, FlagNotHomeNode flag) => !(flag.Entity.HasComponent <TankGroupComponent>() && (selfTank.tankGroup.Key == flag.Entity.GetComponent <TankGroupComponent>().Key));