Esempio n. 1
0
 public void UpdateTransform(SelfTargetHitEffectHUDData data)
 {
     this.rootRectTransform.localPosition = (Vector3)data.BoundsPosCanvas;
     this.rootRectTransform.localRotation = Quaternion.LookRotation(Vector3.forward, data.UpwardsNrm);
     this.UpdateSlope(data);
     this.UpdateSize();
 }
Esempio n. 2
0
 public void Init(Entity entity, SelfTargetHitEffectHUDData data)
 {
     this.InitTransform(data);
     this.InitMaterial();
     this.UpdateTransform(data);
     this.UpdateSpriteFrame();
     this.entity = entity;
     this.entityBehaviour.BuildEntity(entity);
     base.gameObject.SetActive(true);
 }
Esempio n. 3
0
        private void InitTransform(SelfTargetHitEffectHUDData data)
        {
            this.initialData = data;
            Vector2 cnvSize = data.CnvSize;
            float   num     = Mathf.Min(cnvSize.x, cnvSize.y);

            this.width = Mathf.Clamp(num * this.relativeSizeCoeff.x, this.minSize.x, this.maxSize.x);
            this.lengthInterpolator = 1f;
            this.requiredLength     = Mathf.Clamp(num * this.relativeSizeCoeff.y, this.minSize.y, Mathf.Min(this.maxSize.y, Mathf.Max(data.Length * this.lengthPercent, this.minSize.y)));
            this.length             = 0f;
        }
Esempio n. 4
0
        private void UpdateSlope(SelfTargetHitEffectHUDData data)
        {
            float num       = this.width * 0.5f;
            float axisAngle = this.GetAxisAngle(data.UpwardsNrm, Vector2.right);
            float num3      = this.GetAxisAngle(data.UpwardsNrm, Vector2.up);
            float f         = num / Mathf.Tan(0.01745329f * ((Mathf.Abs((float)(Mathf.Abs((float)(data.BoundsPosition.x - 0.5f)) - 0.5f)) > 0.001f) ? axisAngle : num3));

            if (!float.IsInfinity(f) && !float.IsNaN(f))
            {
                this.slopeAddition = f;
            }
        }