public override void Setup(float startTime) { bigHeadProp.Setup(); wrapCam = new OffsetCamera(new Vector3(0, 200, -10), 2); initialHeadPosition = bigHeadProp.faceLeftObject.transform.position; firstLeftHeadScroller = new HeadScroller(bigHeadProp.faceLeftObject, 3.0f); firstRightHeadScroller = new HeadScroller(bigHeadProp.faceRightObject, 5.0f); var mouthLeftGameObject = resourceFactory.Create("SceneSix/MouthLeft-KeepMeInPlace"); var mouthLeft = mouthLeftGameObject.GetComponent<Sprite>(); // This is off compared to the mouth position in SceneSeven. // It seems to be because the mouth is a child of the head in this scene. // Perhaps due to rounding error in the matrix multiplication. mouthLeft.setWorldPosition(-29.5f, -56f, -5f); mouthLeftGameObject.transform.parent = bigHeadProp.faceLeft.transform; var mouthRightGameObject = resourceFactory.Create("SceneSix/MouthRight-KeepMeInPlace"); var mouthRight = mouthRightGameObject.GetComponent<Sprite>(); mouthRight.setWorldPosition(10f, -56f, -5f); mouthRightGameObject.transform.parent = bigHeadProp.faceRight.transform; bigMouthAnimator = new BigMouthAnimator(startTime, mouthLeft, mouthRight); }
public void Setup() { if (offsetCamera != null) return; // skip if prop was already set up armIsMovingAway = true; // construct additional camera that is positioned above the screen to show vertical wrapping offsetCamera = new OffsetCamera(new Vector3(0, 200, -10), 2); wrapCam = offsetCamera.camera; // travel one half screen length per second and take the overlapping offsetCamera into account scrollSpeed = normalScrollSpeed = (Camera.main.pixelHeight + 100) / 2; // put sprites in their own layer so the other camera doesn't render the background guyWithArmOut.gameObject.layer = 1; otherArm.gameObject.layer = 1; guyWithFist.gameObject.layer = 1; otherFist.gameObject.layer = 1; guyWithArmOut.setScreenPosition(180, -30); guyWithArmOut.visible(true); otherArm.setScreenPosition(100, -70); otherArm.visible(true); }