void Update() { var mode = SimulationMode.getCurrentMode(); if ((mode.type == SimulationMode.ModeType.Color) || (mode.type == SimulationMode.ModeType.PositionAndColor)) { float indexAdd = 0.0123f * (float)spawnIndex; var delta = new float3(math.cos(mode.time + indexAdd), math.sin(mode.time + indexAdd), 0) * mode.deltaTime; m_currentColor = m_currentColor + new Color(delta.x, delta.y, delta.z); m_renderer.material.SetColor("_Color", m_currentColor); } }
// Update is called once per frame void Update() { var mode = SimulationMode.getCurrentMode(); if ((mode.type == SimulationMode.ModeType.Position) || (mode.type == SimulationMode.ModeType.PositionAndColor)) { float indexAdd = 0.00123f * (float)spawnIndex; int y = spawnIndex / height; int x = spawnIndex - (y * height); var pos = new float4( x, math.sin(mode.time + indexAdd) * 4.0f, y, 1); transform.position = new Vector3(pos.x, pos.y, pos.z); } }
// Update is called once per frame void Update() { var mode = SimulationMode.getCurrentMode(); if (mode.type == SimulationMode.ModeType.None) { GetComponent <TextMesh>().text = "MODE: Nothing"; } if (mode.type == SimulationMode.ModeType.Color) { GetComponent <TextMesh>().text = "MODE: Update Color"; } if (mode.type == SimulationMode.ModeType.Position) { GetComponent <TextMesh>().text = "MODE: Update Position"; } if (mode.type == SimulationMode.ModeType.PositionAndColor) { GetComponent <TextMesh>().text = "MODE: Update Color and Position"; } }
protected override void OnUpdate() { var mode = SimulationMode.getCurrentMode(); switch (mode.type) { case SimulationMode.ModeType.Color: AnimateColors(mode); break; case SimulationMode.ModeType.Position: AnimatePositions(mode); break; case SimulationMode.ModeType.PositionAndColor: AnimateColors(mode); AnimatePositions(mode); break; default: break; } }