public float w ;

Description

W компонент vector'a

using UnityEngine;

// Move and re-size a sphere. // Attach this script to a sphere added to the scene. // Use the x, y and z sliders to change the sphere position and // the w slider to change the scale of the sphere. // // View the changing x, y, z, and z values in the Inspector.

public class ExampleClass : MonoBehaviour { private Vector4 positionAndSize;

void Awake() { positionAndSize = new Vector4(0.0f, 0.0f, 0.0f, 1.0f); }

void Update() { transform.position = (Vector3)positionAndSize;

float a = positionAndSize.w; transform.localScale = new Vector3(a, a, a); }

void OnGUI() { GUI.skin.label.fixedHeight = 40; GUI.skin.label.fontSize = 24;

GUI.Label(new Rect(10, 10, 25, 0), "x:"); positionAndSize.x = GUI.HorizontalSlider(new Rect(60, 20, 200, 10), positionAndSize.x, -1.0f, 1.0f);

GUI.Label(new Rect(10, 50, 25, 0), "y:"); positionAndSize.y = GUI.HorizontalSlider(new Rect(60, 60, 200, 10), positionAndSize.y, -1.0f, 1.0f);

GUI.Label(new Rect(10, 90, 25, 0), "z:"); positionAndSize.z = GUI.HorizontalSlider(new Rect(60, 100, 200, 10), positionAndSize.z, -1.0f, 1.0f);

GUI.Label(new Rect(10, 130, 25, 0), "w:"); positionAndSize.w = GUI.HorizontalSlider(new Rect(60, 140, 200, 10), positionAndSize.w, 0.5f, 2.0f); } }