Example #1
0
        public void UpdateDamageTransform(UpdateEvent e, SingleNode <DamageInfoComponent> damageInfo, [JoinAll] SingleNode <HUDWorldSpaceCanvas> worldSpaceHUD)
        {
            DamageInfoComponent component        = damageInfo.component;
            Transform           elementTransform = component.transform;

            elementTransform.rotation = component.CachedCamera.transform.rotation;
            WorldSpaceHUDUtil.ScaleToRealSize(worldSpaceHUD.component.canvas.transform, elementTransform, component.CachedCamera);
        }
Example #2
0
        public void UpdateNameplateTransform(UpdateEvent e, NameplateNode nameplate, [JoinByTank] WeaponRendererNode weapon, [JoinByTank] TankNode remoteTank, [JoinAll] SingleNode <HUDWorldSpaceCanvas> worldSpaceHUD)
        {
            NameplateComponent nameplateComponent = nameplate.nameplate;
            Transform          nameplateTransform = nameplateComponent.transform;
            Camera             cachedCamera       = nameplateComponent.CachedCamera;
            Vector3            position           = weapon.weaponVisualRoot.transform.position;

            this.PositionAboveTank(position, nameplateTransform, nameplateComponent);
            this.AlignToCamera(nameplate, nameplateTransform, cachedCamera);
            WorldSpaceHUDUtil.ScaleToRealSize(worldSpaceHUD.component.canvas.transform, nameplateTransform, nameplateComponent.CachedCamera);
            nameplate.nameplatePosition.sqrDistance = (cachedCamera.transform.position - nameplateTransform.position).sqrMagnitude;
        }