/// <summary> /// Overriden method for when scripts starts /// </summary> protected override void Start() { audioSource = GetComponent <AudioSource>(); gauge.maxValue = fullFill; base.Start(); map = GetComponentInChildren <LinearMapping>(); }
private void Awake() { Assert.IsTrue(getPerSecond > 0, "getPerSecond must be positive"); Assert.IsTrue(setPerSecond > 0, "setPerSecond must be positive"); // Seconds between calls is more useful during runtime, but calls per // second is easier to set. minimumGetPeriod = 1 / getPerSecond; minimumSetPeriod = 1 / setPerSecond; SystemVolumePlugin.LogDelegate logDelegate = Log; SystemVolumePlugin.SetLoggingCallback(Marshal.GetFunctionPointerForDelegate(logDelegate)); var ret = SystemVolumePlugin.InitializeVolume(); if (ret != 0) { Debug.LogErrorFormat("Volume initialization failed with code {0}", ret); } if (linearMapping == null) { linearMapping = GetComponent <LinearMapping>(); } var initialVolume = Volume; linearMapping.value = initialVolume; desiredVolume = initialVolume; Debug.LogFormat("Starting volume is {0:f3}", initialVolume); }
// Start is called before the first frame update void Awake() { sliderComp = GetComponent <Slider>(); mappingComp = GetComponent <LinearMapping>(); //set to -1 to ensure it gets changed on first update lastVal = -1; }
public ElevatorTraverser(RoomLink link, Elevator elevator, LinearMapping mapping, RoomNetwork roomnet) { this.link = link; this.elevator = elevator; elevatorCenter = elevator.movingRoot.Find("Center"); elevatorMapping = mapping; this.roomnet = roomnet; }
//------------------------------------------------- void Awake() { Debug.LogError(name + " is using haptic rack"); if (linearMapping == null) { linearMapping = GetComponent <LinearMapping>(); } }
// Use this for initialization void Start() { //Valve.VR.OpenVR.System.ResetSeatedZeroPose(); if (linearMapping == null) { linearMapping = GetComponent <LinearMapping>(); } _base = transform.parent; }
// Start is called before the first frame update void Start() { if (linearMapping == null) { linearMapping = GetComponent <LinearMapping>(); } referenceObject = GameObject.FindWithTag("SLIDEY-SLICE"); slicingScript = referenceObject.GetComponent <SLIDERS_Slicing>(); }
void Start() { if (linearMapping == null) { linearMapping = GetComponent <LinearMapping>(); } startPosition = table.transform.position.y; // -1 diff = start.position.y - end.position.y; // 2 table.transform.position = new Vector3(table.transform.position.x, linearMapping.value * diff + table.transform.position.y, table.transform.position.z); }
public void OnActivated(LinearMapping lm, Weapon attachedWeapon) { linearMapping = lm; transform.SetParent(attachedWeapon.transform); this.attachedWeapon = attachedWeapon; initialMappingOffset = linearMapping.value - CalculateLinearMapping(magazine.attachedHand.transform); sampleCount = 0; mappingChangeRate = 0.0f; repositionGameObject = true; GetComponentInChildren <Collider>().isTrigger = true; }
// Start is called before the first frame update void Start() { if (_drive1 != null) { _linearMapping1 = _drive1.GetComponent <LinearMapping>(); } if (_drive2 != null) { _linearMapping2 = _drive2.GetComponent <LinearMapping>(); } }
void Start() { contents = new List <GameObject>(); map = GetComponentInParent <LinearMapping>(); if (map != null) { isDrawer = true; } else { isDrawer = false; } }
//------------------------------------------------- private void Start() { if (childCollider == null) { childCollider = GetComponentInChildren <Collider>(); } if (linearMapping == null) { linearMapping = GetComponent <LinearMapping>(); } if (linearMapping == null) { linearMapping = gameObject.AddComponent <LinearMapping>(); } worldPlaneNormal = new Vector3(0.0f, 0.0f, 0.0f); worldPlaneNormal[(int)axisOfRotation] = 1.0f; localPlaneNormal = worldPlaneNormal; if (transform.parent) { worldPlaneNormal = transform.parent.localToWorldMatrix.MultiplyVector(worldPlaneNormal).normalized; } if (limited) { start = Quaternion.identity; outAngle = transform.localEulerAngles[(int)axisOfRotation]; if (forceStart) { outAngle = Mathf.Clamp(startAngle, minAngle, maxAngle); } } else { start = Quaternion.AngleAxis(transform.localEulerAngles[(int)axisOfRotation], localPlaneNormal); outAngle = 0.0f; } if (debugText) { debugText.alignment = TextAlignment.Left; debugText.anchor = TextAnchor.UpperLeft; } UpdateAll(); }
void Start() { linearMapping = GetComponent <LinearMapping>(); foreach (Animator ani in ans) { if (ani.gameObject.tag == "reversable") { anss.Add(ani); } } ansss = anss.ToArray(); }
// Start is called before the first frame update void Start() { if (linearMapping == null) { linearMapping = GetComponent <LinearMapping>(); } if (linearMapping == null) { linearMapping = gameObject.AddComponent <LinearMapping>(); } rigidbody = GetComponent <Rigidbody>(); value = linearMapping.value; }
// Start is called before the first frame update void Start() { _ParticleAnimator = GetComponent <Animator>(); if (linearMapping == null) { linearMapping = GetComponent <LinearMapping>(); } if (linearMapping == null) { linearMapping = gameObject.AddComponent <LinearMapping>(); } value = linearMapping.value; }
//------------------------------------------------- void Start() { if (linearMapping == null) { linearMapping = GetComponent <LinearMapping>(); } if (linearMapping == null) { linearMapping = gameObject.AddComponent <LinearMapping>(); } if (repositionGameObject) { UpdateLinearMapping(transform); } }
//------------------------------------------------- void Awake() { if (linearMapping == null) { linearMapping = GetComponent <LinearMapping>(); } if (!phCanvas) { phCanvas = GameObject.Find("pHCanvas"); } if (phText == null) { phText = phCanvas?.GetComponentInChildren <Text>(); } //myLinearDrive = myHandle.GetComponent<LinearDrive>(); }
protected virtual void Start() { if (linearMapping == null) { linearMapping = GetComponent <LinearMapping>(); } if (linearMapping == null) { linearMapping = gameObject.AddComponent <LinearMapping>(); } initialMappingOffset = linearMapping.value; if (repositionGameObject) { UpdateLinearMapping(transform); } }
//------------------------------------------------- private void Start() { if (childCollider == null) { childCollider = GetComponentInChildren <Collider>(); } if (linearMapping == null) { linearMapping = GetComponent <LinearMapping>(); } if (linearMapping == null) { linearMapping = gameObject.AddComponent <LinearMapping>(); } UpdateAll(); }
// Update is called once per frame void Update() { if (_linearMapping1 != null && _linearMapping2 != null && _linearMapping3 != null && _linearMapping4 != null) { Vector3 localRot = transform.localEulerAngles; Vector3 lowRot = new Vector3(localRot.x, _minAngle, localRot.z); Vector3 highRot = new Vector3(localRot.x, _maxAngle, localRot.z); Vector3 leftRot = Vector3.Lerp(lowRot, highRot, _linearMapping1.value); Vector3 rightRot = Vector3.Lerp(highRot, lowRot, _linearMapping2.value); Vector3 player1Rot = new Vector3(transform.localEulerAngles.x, leftRot.y + rightRot.y, transform.localEulerAngles.z); Vector3 lowRot2 = new Vector3(localRot.x, _minAngle, localRot.z); Vector3 highRot2 = new Vector3(localRot.x, _maxAngle, localRot.z); Vector3 leftRot2 = Vector3.Lerp(lowRot2, highRot2, _linearMapping3.value); Vector3 rightRot2 = Vector3.Lerp(highRot2, lowRot2, _linearMapping4.value); Vector3 player2Rot = new Vector3(transform.localEulerAngles.x, leftRot2.y + rightRot2.y, transform.localEulerAngles.z); transform.localEulerAngles = (player1Rot + player2Rot) / 2.0f; } else { if (_drive1 != null) { _linearMapping1 = _drive1.GetComponent <LinearMapping>(); } if (_drive2 != null) { _linearMapping2 = _drive2.GetComponent <LinearMapping>(); } if (_drive3 != null) { _linearMapping3 = _drive3.GetComponent <LinearMapping>(); } if (_drive4 != null) { _linearMapping4 = _drive4.GetComponent <LinearMapping>(); } } }
private void Awake() { roomnet = GetComponentInParent <RoomNetwork>(); link = GetComponent <RoomLink>(); linearMapping = GetComponent <LinearMapping>(); entry1 = transform.Find("Entry1"); entry2 = transform.Find("Entry2"); Vector3 entry1Pos = roomnet.WorldToRelativePos(entry1.position); Vector3 entry2Pos = roomnet.WorldToRelativePos(entry2.position); if (Vector3.Distance(entry1Pos, roomnet.WorldToRelativePos(link.room1.center)) < Vector3.Distance(entry2Pos, roomnet.WorldToRelativePos(link.room1.center))) { link.entry1 = entry1Pos; link.entry2 = entry2Pos; } else { link.entry1 = entry2Pos; link.entry2 = entry1Pos; link.reversed = true; } link.isOpen = true; // Elevator Link Always open }
// Update is called once per frame void Update() { if (_linearMapping1 != null && _linearMapping2 != null) { Vector3 localRot = transform.localEulerAngles; Vector3 lowRot = new Vector3(localRot.x, _minAngle, localRot.z); Vector3 highRot = new Vector3(localRot.x, _maxAngle, localRot.z); float totalMappingValue = (_linearMapping1.value + _linearMapping2.value) / 2.0f; transform.localEulerAngles = Vector3.Lerp(lowRot, highRot, totalMappingValue); } else { if (_drive1 != null) { _linearMapping1 = _drive1.GetComponent <LinearMapping>(); } if (_drive2 != null) { _linearMapping2 = _drive2.GetComponent <LinearMapping>(); } } }
public void OnGravityHandleHeld(LinearMapping value) { Physics.gravity = new Vector3(0, -9.8f * 2 * value.value, 0); print(Physics.gravity); }
// Start is called before the first frame update void Start() { lm = GetComponent <LinearMapping>(); absoluteDresserCenter = transform.TransformPoint(inDresserCenter); }
private void Awake() { animationMapping = playbackDrive.linearMapping; control = GetComponent <ControlBoardControl>(); }
public void OnLightHandleHeld(LinearMapping value) { print(value.value); light.intensity = value.value * 2; }
public void OnYHandleHeld(LinearMapping value) { toSpawn.transform.localScale = (new Vector3(1, value.value, 1)); }