示例#1
0
 // Token: 0x0600503A RID: 20538 RVA: 0x001B76B8 File Offset: 0x001B5AB8
 private void BuildWall()
 {
     for (int i = 0; i < this.avatars.Length; i++)
     {
         GameObject gameObject = AssetManagement.Instantiate(this.pedestalGO, base.transform.position, base.transform.rotation) as GameObject;
         gameObject.transform.parent = base.transform;
         Vector3 localPosition = gameObject.transform.localPosition;
         if (this.spawnRightToLeft)
         {
             localPosition.x = (float)(-(float)i % this.numColumns) * this.avatarMargin.x;
         }
         else
         {
             localPosition.x = (float)(i % this.numColumns) * this.avatarMargin.x;
         }
         localPosition.y = (float)(i / this.numColumns) * this.avatarMargin.y;
         gameObject.transform.localPosition = localPosition;
         VRC_AvatarPedestal component = gameObject.GetComponent <VRC_AvatarPedestal>();
         component.transform.Rotate(new Vector3(0f, 180f, 0f));
         component.scale = this.scale;
         GameObject gameObject2 = gameObject.transform.Find("UseVolume").gameObject;
         gameObject2.AddComponent <Highlightable>();
         CapsuleCollider component2 = gameObject2.GetComponent <CapsuleCollider>();
         component2.height *= this.scale * 1.3f;
         component2.radius *= this.scale * 1.3f;
         Vector3 center = new Vector3(component2.center.x, 0.7f, component2.center.z);
         component2.center = center;
     }
 }
        static void DrawAvatarPedestalGizmos(VRC_AvatarPedestal pedestal, GizmoType gizmoType)
        {
            if (Vector3.Distance(pedestal.transform.position, Camera.current.transform.position) > 25f)
            {
                return;
            }

            // Get transform from the pedestal placement value otherwise get transform of the pedestal itself
            var pedestalTransform = pedestal.Placement != null ? pedestal.Placement : pedestal.transform;

            // Set gizmo matrix to match the pedestal for proper placement and rotation
            Gizmos.matrix = pedestalTransform.localToWorldMatrix;
            Gizmos.color  = Color.green;

            // Draw the outer bound of the pedestal
            Gizmos.DrawWireCube(Vector3.up * 1.2f, new Vector3(1f * OUTER_BOUND, 1f * OUTER_BOUND));

            // Change color to red if showing the front is active and active camera is behind the pedestal
            var cameraDirection = pedestalTransform.position - Camera.current.transform.position;

            var angle = Vector3.Angle(pedestalTransform.forward, cameraDirection);

            if (Mathf.Abs(angle) < 90)
            {
                Gizmos.color = Color.red;
            }

            // Draw the inner bound of the pedestal
            Gizmos.DrawWireCube(Vector3.up * 1.2f, new Vector3(1f * INNER_BOUND, 1f * INNER_BOUND));
        }
示例#3
0
    void Start()
    {
        if (pedestal == null)
        {
            pedestal = gameObject.GetComponent <VRC_AvatarPedestal>();
        }

        PlayerApiref = Networking.LocalPlayer;
    }