void Start() { doorTransform = transform.Find("Door"); progressBar = GetComponentInChildren <Image>(); hyperSpeedManager = HyperSpeedManager.Instance; // save the closed and open y positions closedY = doorTransform.position.y; float height = doorTransform.GetComponent <Renderer>().bounds.extents.y * 2.0f; // gets height of door in world units openY = closedY + height * 0.8f; // subscribe to the button events if (button != null) { button.OnActivate += SetToOpening; } if (button != null) { button.OnDeactivate += SetToClosing; } targetY = closedY; }
private void Start() { hyperSpeedManager = HyperSpeedManager.Instance; particleSystem = GetComponent <ParticleSystem>(); // Store default sim speed to preserve sim tweaks in the inspector defaultSimSpeed = particleSystem.main.simulationSpeed; defaultEmissionRate = particleSystem.emission.rateOverTimeMultiplier; }
void Start() { hyperSpeedManager = HyperSpeedManager.Instance; textBox = gameObject.GetComponentInChildren <Text>(); // load in the text file and split it into an array of strings based on the lines in the file if (textFile != null) { textLines = (textFile.text.Split('\n')); } runningCoroutine = StartCoroutine(playText()); }
void Start() { posA = child.localPosition; posB = transformB.localPosition; nextPos = posB; progressBar = GetComponentInChildren <Image>(); hyperSpeedManager = HyperSpeedManager.Instance; // subscribe to the button events button.OnActivate += SetToOpening; button.OnDeactivate += SetToClosing; }
} // static singleton private void Awake() { // If there are no instances of HyperSpeedManager, set this to be the instance if (Instance == null) { Instance = this; } // else destroy this instance, so that can only be one instances else { Destroy(gameObject); } }
void Start() { posA = child.localPosition; posB = transformB.localPosition; nextPos = posB; hyperSpeedManager = HyperSpeedManager.Instance; if (phase < 1) { child.localPosition = Vector3.Lerp(posA, posB, phase); } else { child.localPosition = Vector3.Lerp(posB, posA, phase - 1); } }
// Start is called before the first frame update void Start() { hyperSpeedManager = HyperSpeedManager.Instance; }
void Start() { hyperSpeedManager = HyperSpeedManager.Instance; postProcessVolume = GetComponent <PostProcessVolume>(); }
private void Start() { hyperSpeedManager = HyperSpeedManager.Instance; particleSystem = GetComponent <ParticleSystem>(); defaultSimSpeed = particleSystem.main.simulationSpeed; }