protected override void Start() { base.Start(); hs = GetComponent <HurterSpawner>(); hs.BaseAngle -= 90; transform.localRotation = Quaternion.AngleAxis(hs.BaseAngle, Vector3.forward); hs.BaseAngle = 360 - hs.BaseAngle; hs.ShootingVector = new Vector3(Mathf.Sin(hs.BaseAngle * Mathf.Deg2Rad), Mathf.Cos(hs.BaseAngle * Mathf.Deg2Rad), 0); if (invertColors) { foreach (var r in GetComponentsInChildren <Renderer>()) { //Debug.Log(r.material.name); if (r.material.name.StartsWith("clr_Red")) { r.material.SetColor("_Emission", new Color(84 / 255.0f, 188 / 255.0f, 28 / 255.0f)); } else if (r.material.name.StartsWith("clr_Green")) { r.material.SetColor("_Emission", new Color(255 / 255.0f, 17 / 255.0f, 17 / 255.0f)); } } } }
void Start() { Spawner = GetComponent<HurterSpawner>(); Animations = GetComponentsInChildren<Animation>(); foreach (var a in Animations) foreach (AnimationState state in a) state.speed = state.speed * (Clockwise ? RotateSpeed : -RotateSpeed) * Level.ScrollingSpeed; }
void Start() { Spawner = GetComponent <HurterSpawner>(); Animations = GetComponentsInChildren <Animation>(); foreach (var a in Animations) { foreach (AnimationState state in a) { state.speed = state.speed * (Clockwise ? RotateSpeed : -RotateSpeed) * Level.ScrollingSpeed; } } }
protected override void Start() { base.Start(); hs = GetComponent<HurterSpawner>(); hs.BaseAngle -= 90; transform.localRotation = Quaternion.AngleAxis(hs.BaseAngle, Vector3.forward); hs.BaseAngle = 360 - hs.BaseAngle; hs.ShootingVector = new Vector3(Mathf.Sin(hs.BaseAngle * Mathf.Deg2Rad), Mathf.Cos(hs.BaseAngle * Mathf.Deg2Rad), 0); if (invertColors) { foreach (var r in GetComponentsInChildren<Renderer>()) { //Debug.Log(r.material.name); if (r.material.name.StartsWith("clr_Red")) r.material.SetColor("_Emission", new Color(84 / 255.0f, 188 / 255.0f, 28 / 255.0f)); else if (r.material.name.StartsWith("clr_Green")) r.material.SetColor("_Emission", new Color(255 / 255.0f, 17 / 255.0f, 17 / 255.0f)); } } }