public void set_bb_choices(CharacterIndex[] aChoices) { //mChoices = aChoices; //JIT/AOT hard fix. I think aChoices is always passed into here in order anyways so it's not a problem var ch = aChoices;//aChoices.OrderBy(e => e.Choice).ToArray(); int len = ch.Count(); float padding = 700; float netWidth = (len) * padding; for (int i = len; i < mBBChoices.Count; i++) { mBBChoices [i].Enabled = false; mBBMiniMans[i].Enabled = false; mBBChoiceBodies[i].Enabled = false; } for (int i = 0; i < len; i++) { mBBChoices[i].Enabled = true; mBBMiniMans[i].Enabled = true; mBBChoiceBodies[i].Enabled = true; mBBChoices[i].set_actual_character(ch[i]); mBBChoices[i].set_difficulty(mManager.mCharacterBundleManager.get_character_helper().Characters[ch[i]].Difficulty); var xOffset = netWidth / 2 - padding / 2 - padding * i; mBBChoices[i].HardPosition = mFlatCamera.get_point(0, -0.16f) + new Vector3(xOffset, 0, 0); mBBChoiceBodies[i].HardPosition = mFlatCamera.get_point(0, -0.16f) + new Vector3(xOffset, -270, 0); mBBMiniMans[i].HardPosition = mBBChoiceBodies[i].HardPosition + mBBMiniManBasePositionOffset; mBBMiniMans[i].HardColor = GameConstants.UiPurpleTransparent; } }
FlatElementImage construct_flat_image(string aName, int aDepth) { if (mLoader == null) { throw new UnityException("start screen bundle null"); } CharacterData.ImageSizeOffsetAnimationData sizing; FlatElementImage r; if (aName != "BACKGROUND") //this is stupid and you should make background part of the dump.. { sizing = mLoader.Sizes.find_static_element(aName); try { r = new FlatElementImage(mLoader.Images.staticElements[aName], sizing.Size, aDepth); } catch (System.Exception e) { Debug.Log("messed up on " + aName); throw e; } } else { var backSize = mLoader.Sizes.mBackSize; sizing = new CharacterData.ImageSizeOffsetAnimationData(); sizing.Offset = new Vector2(0, 0); sizing.Size = backSize; r = new FlatElementImage(mLoader.Images.background1, backSize, aDepth); } r.HardPosition = mRTCamera.get_point(Vector3.zero) + sizing.Offset; return(r); }
FlatElementImage construct_flat_image(string aName, int aDepth) { var sizing = mLoader.Sizes.find_static_element(aName); var r = new FlatElementImage(mLoader.Images.staticElements[aName], sizing.Size, aDepth); r.HardPosition = mFlatCamera.get_point(Vector3.zero) + sizing.Offset; return(r); }
public void initialize_depth_warning() { mDepthImage = new FlatElementImage(null, new Vector2(160, 120), 100); mDepthImage.HardScale = Vector3.one * 2; //mDepthImage.HardPosition = mFlatCamera.get_point(1, -1) + new Vector3(-10 - mDepthImage.BoundingBox.width / 4, 10 + mDepthImage.BoundingBox.height / 4, 0) * mFlatCamera.screen_pixel_to_camera_pixel_ratio(); mDepthImage.HardPosition = mFlatCamera.get_point(1.5f, -1) + new Vector3(-10 - mDepthImage.BoundingBox.width / 4, 10 + mDepthImage.BoundingBox.height / 4, 0) * mFlatCamera.screen_pixel_to_camera_pixel_ratio(); mDepthImage.HardShader = mManager.mReferences.mXB1DepthImageShader; mDepthWarningText = new FlatElementText(mManager.mNewRef.genericFont, 40, GameStrings.GetString("TCMkinect1"), 100); mDepthWarningText.HardColor = new Color(1, 1, 1, 0); mDepthWarningText.Alignment = TextAlignment.Left; mDepthWarningText.Anchor = TextAnchor.MiddleLeft; mDepthWarningText.HardPosition = mFlatCamera.get_point(1, -1) + new Vector3(-280, 110, 0) * mFlatCamera.screen_pixel_to_camera_pixel_ratio(); mDepthWarningText.ColorInterpolationMaxLimit = 10f; mDepthWarningText.ColorInterpolationMinLimit = 2f; //mDepthWarningText.Alignment = TextAlignment.Left; EnableDepthWarning = false; mElement.Add(mDepthImage); mElement.Add(mDepthWarningText); }
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; } } }
FlatElementImage construct_flat_image(string aName, int aDepth) { var sizing = mLoader.Sizes.find_static_element(aName); try{ var r = new FlatElementImage(mLoader.Images.staticElements[aName], sizing.Size, aDepth); r.HardPosition = mFlatCamera.get_point(Vector3.zero) + sizing.Offset; return(r); } catch (System.Exception e) { Debug.Log("couldn't find " + aName); throw e; } }
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; }
Vector3 random_position() { //UGG piece of junk... return(mFlatCamera.get_point(Vector3.zero) + (new Vector3(Random.Range(-1f, 1f), Random.Range(-1f, 1f), 0)).normalized * Random.Range(4000, 4000)); }
//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(); }