示例#1
0
        private void UpdatePosition()
        {
            if (string.IsNullOrEmpty(this.ReverseObjectID))
            {
                return;
            }
            GameObject gameObject = GameObjectID.FindGameObject(this.ReverseObjectID);

            if (!Object.op_Inequality((Object)gameObject, (Object)null))
            {
                return;
            }
            UIProjector component = (UIProjector)gameObject.GetComponent <UIProjector>();

            if (!Object.op_Inequality((Object)component, (Object)null))
            {
                return;
            }
            component.ReStart();
        }
示例#2
0
    private void Layout()
    {
        float num1 = (float)((double)this.ScrollPos * 2.0 - 1.0);
        float num2 = (float)(this.MinAspectSize.x / this.MinAspectSize.y);
        float num3 = (float)(this.MaxAspectSize.x / this.MaxAspectSize.y);
        float num4 = Mathf.Clamp01((float)(((double)((float)Screen.get_width() / (float)Screen.get_height()) - (double)num2) / ((double)num3 - (double)num2)));
        float num5 = Mathf.Lerp(this.MinOffset, this.MaxOffset, num4);
        float num6 = Mathf.Lerp(this.MinScroll, this.MaxScroll, num4);

        for (int index = 0; index < this.mChildren.Count; ++index)
        {
            Transform key  = this.mChildren[index].Key;
            float     num7 = Mathf.Abs((float)key.get_position().z / this.MaxZ);
            key.set_position(Vector3.op_Subtraction(this.mChildren[index].Value, Vector3.op_Multiply(Vector3.get_right(), (float)((double)num1 * (double)num5 * (double)num7 + (double)num1 * (double)num6))));
            if (Object.op_Inequality((Object)this.ProjectionCamera, (Object)null))
            {
                UIProjector component = (UIProjector)((Component)key).GetComponent <UIProjector>();
                if (Object.op_Inequality((Object)component, (Object)null))
                {
                    component.PreCull(this.ProjectionCamera);
                }
            }
        }
    }