void Start() { mTargetColor = ScriptCommon.ColorRandom(mColorAlpha); mCurrentColor = ScriptCommon.ColorRandom(mColorAlpha); mTargetRotation = ScriptCommon.RotationRandom(); mOriginalPosition = new Vector3(viewer.transform.position.x, viewer.transform.position.y, viewer.transform.position.z); mTargetZ = ScriptCommon.RandomSignedFloat(mOriginalPosition.z, mTargetMaxZ); UpdateMaterialColor(); }
void Update() { if (UpdateMaterialColor()) { mTargetColor = ScriptCommon.ColorRandom(mColorAlpha); } if (UpdateCameraRotation()) { mTargetRotation = ScriptCommon.RotationRandom(); } if (UpdateCameraPosition()) { mTargetZ = ScriptCommon.RandomSignedFloat(mOriginalPosition.z, mTargetMaxZ); } }