public override void Start() { mManager.GameEventDistributor += game_event_listener; //setup flat camera mFlatCamera = new FlatCameraManager(new Vector3(10000, 10000, 0), 9); mFlatCamera.Camera.depth = 101; //we want this on top always //mFlatCamera.Camera.clearFlags = CameraClearFlags.SolidColor; mFlatCamera.Camera.clearFlags = CameraClearFlags.Depth; mFlatCamera.Camera.backgroundColor = new Color32(37, 37, 37, 255); mFlatCamera.fit_camera_to_screen(true); //setup RT camera mRTCamera = new FlatCameraManager(new Vector3(10000, -6000, 0), 10); mRTCamera.set_render_texture_mode(true); mRTCamera.Camera.GetComponent <Camera>().name = "TCMCAMERA"; mRTCamera.fit_camera_to_game(); mRTImage = new FlatElementImage(mRTCamera.RT, 1); mRTImage.PrimaryGameObject.name = "TCMIMAGE"; mRTImage.HardScale = Vector3.one * mFlatCamera.Width / mRTImage.mImage.PixelDimension.x; ModeNormalPlay.slide_image(mFlatCamera, null, mRTImage, false, true); mElement.Add(mRTImage); //this is seen by main flat camera and not RT camera FYI initialize_depth_warning(); mManager.mAssetLoader.new_load_asset_bundle("START", delegate(AssetBundle aBundle){ start_screen_loaded_callback(aBundle, "START"); }); //this isn't working anyhow //mManager.StartCoroutine(test_you_are_playing_as()); }
public void initialize() { IsLoaded = false; TED = new TimedEventDistributor(); mFlatCamera = new FlatCameraManager(new Vector3(10000, -3000, 0), 10); mFlatCamera.fit_camera_to_game(); mUnlockAnnouncer = new UnlockAnnouncer(this); }
public void initialize() { TED = new TimedEventDistributor(); mFlatCamera = new FlatCameraManager(new Vector3(-50000, 10000, 0), 9); mFlatCamera.fit_camera_to_screen(); //mFlatCamera.fit_camera_to_game(); //mMiniMan = ((GameObject)GameObject.Instantiate(ManagerManager.Manager.mReferences.mMiniChar)).GetComponent<CharacterTextureBehaviour>(); //mMiniMan = //TODO something like this: mManager.mCharacterBundleManager.get_mini_character(new CharacterIndex(0,1)); mHeadPop = new CharacterHeadPopupThingy(this); }
public static void draw_render_texture(FlatCameraManager aCam) { //aCam.Camera.enabled = true; RenderTexture.active = aCam.RT; aCam.Camera.targetTexture = aCam.RT; aCam.Camera.backgroundColor = new Color(1, 1, 1, 0); aCam.Camera.clearFlags = CameraClearFlags.SolidColor; //aCam.Camera.DoClear(); aCam.Camera.Render(); RenderTexture.active = null; //aCam.Camera.enabled = false; }
public void initialize() { IsLoaded = false; mFlatCamera = new FlatCameraManager(mManager.mCameraManager.BackgroundCamera.transform.position, 10); mFlatCamera.fit_camera_to_game(); mFlatCamera.Camera.cullingMask = (1 << 3) | (1 << 0); mFlatCamera.set_render_texture_mode(true); mPlayerImage = new FlatElementImage(null, 10); mPlayerImage.PrimaryGameObject.name = "PLAYERIMAGE"; mElement.Add(mPlayerImage); }
public void show_indicator(bool show) { Vector2 give = FlatCameraManager.get_fit_difference(); targetRect = new Rect(-400, Screen.height - 120 - 20 - give.y / 2, 160, 120); currentRect.y = Screen.height - 120 - 20 - give.y / 2; if (!show) { targetRect.x = -400; } else { targetRect.x = 20 + give.x / 2; } }
public static void slide_image(FlatCameraManager aCam, FlatElementImage cur, FlatElementImage next, bool right = true, bool instant = false) { //TODO set triggers to deactivate the surfaces, maybe not here.. for performance.. if (next != null) { next.HardPosition = aCam.get_point(Vector3.zero) + (right ? Vector3.right * next.BoundingBox.width : Vector3.down * next.BoundingBox.height); next.SoftPosition = aCam.get_point(Vector3.zero); if (instant) { next.HardPosition = next.SoftPosition; } } if (cur != null) { cur.SoftPosition = aCam.get_point(Vector3.zero) - (right ? Vector3.right * cur.BoundingBox.width : Vector3.down * cur.BoundingBox.height); if (instant) { cur.HardPosition = cur.SoftPosition; } } }
public void initialize() { mInterfaceManager = new NewInterfaceManager(mManager, this); mInterfaceManager.initialize(); //mInterfaceManager.mFlatCamera.set_render_texture_mode(true); mInterfaceManager.setup_bb(); mSunsetManager = new SunsetManager(mManager, this); mSunsetManager.initialize(); mSunsetManager.mFlatCamera.set_render_texture_mode(true); mManager.mAssetLoader.new_load_asset_bundle("SUNSET", delegate(AssetBundle aBundle){ mSunsetManager.sunset_loaded_callback(aBundle, "SUNSET"); } ); mGiftManager = new GiftManager(mManager, this); mGiftManager.initialize(); mManager.mAssetLoader.new_load_asset_bundle("GIFT", delegate(AssetBundle aBundle){ mGiftManager.gift_loaded_callback(aBundle, "GIFT"); } ); mChoosingManager = new ChoosingManager(mManager, this); mChoosingManager.initialize(); mChoosingManager.mFlatCamera.set_render_texture_mode(true); mFlatCamera = new FlatCameraManager(new Vector3(-23200, 3500, 0), 10); mFlatCamera.Camera.depth = 100; mFlatCamera.fit_camera_to_screen(); mSunsetImage = new FlatElementImage(mSunsetManager.mFlatCamera.RT, 0); var hs = Vector3.one * mFlatCamera.Width / mSunsetImage.mImage.PixelDimension.x; //TODO extra space for rounded edges //hs.y += 600; //additional 300 pixels.. mSunsetImage.HardScale = hs; mSunsetImage.HardPosition = mFlatCamera.get_point(Vector3.zero) + Vector3.up * mSunsetImage.BoundingBox.height; //mSunsetImage.HardShader = mManager.mReferences.mRenderTextureShader; mSunsetImage.PositionInterpolationMinLimit = 10; //so it doesn't take forever to entirely cover the image underneath mElement.Add(mSunsetImage); mChoosingImage = new FlatElementImage(mChoosingManager.mFlatCamera.RT, 1); mChoosingImage.HardScale = Vector3.one * mFlatCamera.Width / mChoosingImage.mImage.PixelDimension.x; mChoosingImage.HardPosition = mFlatCamera.get_point(Vector3.zero) + Vector3.right * mChoosingImage.BoundingBox.width; //mChoosingImage.HardShader = mManager.mReferences.mRenderTextureShader; mElement.Add(mChoosingImage); //this is silly, we forec the interface image to appear above everything else pretty much just so we can have text bubbles show above everything //kind of a dumb way to do it oh well. /* * mInterfaceImage = new FlatElementImage(mInterfaceManager.mFlatCamera.RT,1); * mInterfaceImage.HardScale = Vector3.one * mFlatCamera.Width/mInterfaceImage.mImage.PixelDimension.x; * mInterfaceImage.HardPosition = mFlatCamera.get_point(Vector3.zero); * mElement.Add(mInterfaceImage);*/ mIsInitialized = true; }
public override void Start() { Camera wipeCamera = (new GameObject("genWipeCamera")).AddComponent <Camera>(); wipeCamera.cullingMask = 0; wipeCamera.clearFlags = CameraClearFlags.SolidColor; //wipeCamera.backgroundColor = new Color(0.05f,0.05f,0.06f); //wipeCamera.backgroundColor = new Color(1,1,1); wipeCamera.backgroundColor = new Color(0, 0, 0); wipeCamera.depth = 0; //ImageEffects = (GameObject)GameObject.Instantiate(mManager.mReferences.mImageEffectsPrefabs); MainBodyCamera = (new GameObject("genMainCamera")).AddComponent <Camera>(); MainBodyCamera.cullingMask = 1 << 1; MainBodyCamera.depth = 4; MainBodyCamera.clearFlags = CameraClearFlags.Depth; mManager.mBodyManager.set_layer(1); TransparentBodyCamera = (new GameObject("genTransparentCamera")).AddComponent <Camera>(); TransparentBodyCamera.cullingMask = 1 << 2; TransparentBodyCamera.depth = 3; TransparentBodyCamera.clearFlags = CameraClearFlags.Depth; mManager.mTransparentBodyManager.set_layer(2); BackgroundCamera = (new GameObject("genBackgroundCamera")).AddComponent <Camera>(); BackgroundCamera.cullingMask = 1 << 3; BackgroundCamera.depth = 2; BackgroundCamera.clearFlags = CameraClearFlags.Depth; mManager.mBackgroundManager.set_background_layer(3); ForegroundCamera = (new GameObject("genForegroundCamera")).AddComponent <Camera>(); ForegroundCamera.cullingMask = 1 << 4; ForegroundCamera.depth = 5; ForegroundCamera.clearFlags = CameraClearFlags.Depth; mManager.mBackgroundManager.set_foreground_layer(4); /* no more bloom * MainBodyCameraBloomEffect = MainBodyCamera.gameObject.AddComponent<BloomAndLensFlares>(); * //MainBodyCameraBloomEffect = BackgroundCamera.gameObject.AddComponent<BloomAndLensFlares>(); * BloomAndLensFlares templateBloom = ImageEffects.GetComponent<BloomAndLensFlares>(); * MainBodyCameraBloomEffect.addBrightStuffOneOneShader = templateBloom.addBrightStuffOneOneShader; * MainBodyCameraBloomEffect.brightPassFilterShader = templateBloom.brightPassFilterShader; * MainBodyCameraBloomEffect.hollywoodFlaresShader = templateBloom.hollywoodFlaresShader; * MainBodyCameraBloomEffect.lensFlareShader = templateBloom.lensFlareShader; * MainBodyCameraBloomEffect.screenBlendShader = templateBloom.screenBlendShader; * MainBodyCameraBloomEffect.separableBlurShader = templateBloom.separableBlurShader; * MainBodyCameraBloomEffect.vignetteShader = templateBloom.vignetteShader; * MainBodyCameraBloomEffect.bloomIntensity = 0;*/ //TODO need to do render textures for this to work properly... foreach (Camera c in AllCameras) { c.transform.position = new Vector3(0, 0, 10); c.transform.LookAt(Vector3.zero, Vector3.up); c.orthographic = true; FlatCameraManager.fit_camera_to_screen(c); } }
//CharacterIndex[] mChoices = null; public void initialize() { mFlatCamera = new FlatCameraManager(new Vector3(24200, -3500, 0), 10); mFlatCamera.fit_camera_to_game(); //mFlatCamera = mModeNormalPlay.mSunsetManager.mFlatCamera; var refs = mManager.mReferences; var newRef = mManager.mNewRef; //BB choice nonsense var miniMan = ((GameObject)GameObject.Instantiate(refs.mMiniChar)).GetComponent <CharacterTextureBehaviour>(); //mMiniMan = //TODO something like this: mManager.mCharacterBundleManager.get_mini_character(new CharacterIndex(0,1)); Vector3 miniManScale = (new Vector3(1, 1, 1)) * 1.5f; for (int i = 0; i < BB_NUM_CHOICES; i++) { mBBChoices.Add(new NewChoiceObject(11)); mBBChoiceBodies.Add(new FlatBodyObject(miniMan, 12)); mBBChoiceBodies[i].HardShader = refs.mMiniCharacterShader; mBBChoiceBodies[i].HardScale = miniManScale; mElement.Add(mBBChoices[i]); mElement.Add(mBBChoiceBodies[i]); } mBBChoosingBackground = new FlatElementImage(null, mFlatCamera.Size, 0); mBBChoosingBackground.Enabled = false; mBBChoosingBackground.HardPosition = mFlatCamera.get_point(Vector3.zero); mBBQuestionText = new ColorTextObject(10); mBBQuestionTextPrefix = new FlatElementText(newRef.genericFont, 100, "", 10); //mBBQuestionText.HardPosition = mFlatCamera.get_point(0,0.6f) + new Vector3(0,-75,0); mBBQuestionText.HardPosition = mFlatCamera.get_point(0, 0.72f); mBBQuestionTextPrefix.HardPosition = mFlatCamera.get_point(0, 0.72f) + new Vector3(0, 75, 0); mBBQuestionText.SoftInterpolation = 1; mBBQuestionTextPrefix.SoftInterpolation = 1; var bubbleImage = mManager.mCharacterBundleManager.get_image("SELECTION_BUBBLE"); mBBQuestionBubble = new FlatElementImage(bubbleImage.Image, bubbleImage.Data.Size, 1); mBBQuestionBubble.HardPosition = mFlatCamera.get_point(0, 0.75f); mBBQuestionBubble.HardScale = new Vector3(1.3f, 1.1f, 1); mBBQuestionBubble.HardColor = GameConstants.UiPopupBubble; mBBMiniMans = new FlatBodyObject[BB_NUM_CHOICES]; for (int i = 0; i < BB_NUM_CHOICES; i++) { mBBMiniMans[i] = new FlatBodyObject(miniMan, 20); mBBMiniMans[i].HardScale = miniManScale; mBBMiniMans[i].HardColor = GameConstants.UiPurpleTransparent; mBBMiniMans[i].SoftInterpolation = .13f; mElement.Add(mBBMiniMans[i]); } mElement.Add(mBBChoosingBackground); mElement.Add(mBBQuestionText); mElement.Add(mBBQuestionTextPrefix); mElement.Add(mBBQuestionBubble); GameObject.Destroy(miniMan.gameObject); set_for_choosing(); }