Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - samshosho

Pages: [1]
1
Other Packages / Re: NGUI: HUD Text
« on: October 11, 2016, 11:02:49 AM »
Not using it already!

The game is ready to be published on the Google Play, however this is the only thing that's holding it back.
What else could cause that?

note that other strange behaviour is occurring in another game, but it's not essential to the game as the one at hand. This game at hand, i have to have these Sprite indicators to show next targets.

However in the other games, it's mostly health bar, which i removed as it's not so essential to the game, until i find a solution.

2
Other Packages / Re: NGUI: HUD Text
« on: October 09, 2016, 06:55:01 AM »
I have done all i can and tried so many different things and rebuilt 100 times, but nothing helped.
Can someone from NGUI creators answer this please.

3
Other Packages / Very strange behaviour on Android! please help
« on: October 08, 2016, 08:49:30 AM »
This is a very strange problem i came across today.
Porting one of my IOS games to Android.
It works flawlessly in the Editor and for IOS, however building for Android device resulted in very strange behaviour!!!

The sprites that suppose to update their position according to where the player is and the target position, just don't update their position! first update cycle is done and then they just stop and sometimes disappear!

i did a debug print out to see if the position is changed when the player moves, and it updates once, then stops.

The editor is working just fine with no problem, also building for IOS has no problem. The sprits move and change their position every frame.

Basically this script is suppose to show an indication onscreen to where the next target is according the position of the player and the way he is facing.
If the indication sprite goes off screen, it keeps it inside the screen at the screen's corners.

  1.  
  2. using UnityEngine;
  3. using System.Collections;
  4.  
  5.  
  6. /// <summary>
  7. /// Example script showing how to add UI window that follows an object drawn by another camera.
  8. /// </summary>
  9.  
  10. [AddComponentMenu("NGUI/Examples/Unit HUD")]
  11. public class UnitHUD : MonoBehaviour
  12. {
  13.     /// <summary>
  14.     /// Target object this UI element should follow.
  15.     /// </summary>
  16.  
  17.     public Transform target;
  18.  
  19.     Transform mTrans;
  20.     Camera mGameCam;
  21.     Camera mUICam;
  22.     Vector3 mPos;
  23.     bool mVisible = true;
  24.     public float YAdjustFactor = 2f;
  25.     public Transform Player;
  26.     private UIWidget MyWidget;
  27.  
  28.     public bool ChangeColor;
  29.  
  30.     void Start ()
  31.     {
  32.         mTrans = transform;
  33.         //target = mTrans;
  34.         if (target == null) { Destroy(gameObject);
  35.  
  36.             return; }
  37.  
  38.         mGameCam = NGUITools.FindCameraForLayer(target.gameObject.layer);
  39.         mUICam = NGUITools.FindCameraForLayer(gameObject.layer);
  40.         MyWidget = gameObject.GetComponentInChildren<UIWidget>();
  41.     }
  42.  
  43.     void LateUpdate()
  44.     {
  45.         if (target == null) { Destroy(gameObject); return; }
  46.         if (!target.gameObject.activeInHierarchy) {gameObject.SetActive(false); return;}
  47.         Vector3 screenpos = Camera.main.WorldToScreenPoint(target.position);
  48.        
  49.  
  50.         mPos = mGameCam.WorldToViewportPoint(target.position);
  51.  
  52.         bool visible = (mPos.z > 0f && mPos.x > 0f && mPos.x < 1f && mPos.y > 0f && mPos.y < 1f);
  53.      
  54.         if (visible){
  55.             mTrans.localPosition = screenpos;
  56.             MyWidget.enabled = false;
  57.         }
  58.         else {
  59.          
  60.             if (mPos.z < 0)
  61.                 mPos *= -1;
  62.             //print("mpos = "+mPos);
  63.             MyWidget.enabled = true;
  64.             mPos.x = Mathf.Clamp01(mPos.x);
  65.             mPos.y = Mathf.Clamp01(mPos.y);
  66.             //print("mpos Clamped = "+mPos);
  67.  
  68.             if(mPos.x > 0.95f)
  69.                 mPos.x = 0.95f;
  70.          
  71.             if(mPos.y > 0.95f)
  72.                 mPos.y = 0.95f;
  73.          
  74.  
  75.             if(mPos.x < 0.05f)
  76.                 mPos.x = 0.05f;
  77.          
  78.             if(mPos.y < 0.05f)
  79.                 mPos.y = 0.05f;
  80.          
  81.          
  82.             mPos = mUICam.ViewportToWorldPoint(mPos);
  83.             mPos = MyWidget.transform.parent.InverseTransformPoint(mPos);
  84.             mPos.z = 0;
  85.             MyWidget.transform.localPosition = mPos;
  86.         }
  87.     }
  88. }
  89.  

4
NGUI 3 Support / Re: UIinput.value.Insert doesn't seem to work!
« on: September 25, 2015, 06:20:17 AM »
any help would be appreciated :)

5
NGUI 3 Support / Re: Symbols and Emoticons too small
« on: September 25, 2015, 06:18:13 AM »
any help would be appreciated :)

6
NGUI 3 Support / UIinput.value.Insert doesn't seem to work!
« on: September 23, 2015, 09:39:39 AM »
I have a string, that i want to insert at the end of the UIinput value.
So i did this,

CurIndex = UIinput.value.Length;
UIinput.value.Inser(CurIndex, "some string");

It shows the correct index of the UIinput field, however, it won't insert the "some string" at all.

Am i doing something wrong ?

7
NGUI 3 Support / Symbols and Emoticons too small
« on: September 23, 2015, 08:22:20 AM »
My Font size is 25, thus the emoticons or symbols appear too small since they follow the font size, is there a way to adjust the code to only enlarge the emoticons and symbols? say by multiplying by some int.

Pages: [1]