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 - vikti

Pages: 1 [2]
16
NGUI 3 Support / [SOLVED]UICamera.onClick does not exist...i
« on: December 17, 2014, 02:24:48 PM »
Hi,

I try to set an event delegate but I have the bellow error

  1. Assets/Libraries/Wizar/UIInteraction/OpenBottomSheet.cs(30,62): error CS1061: Type `UICamera' does not contain a definition for `OnClick' and no extension method `OnClick' of type `UICamera' could be found (are you missing a using directive or an assembly reference?)
  2.  

Here is my code :

  1. using UnityEngine;
  2. using System.Collections;
  3. using Wizar;
  4.  
  5. public class OpenBottomSheet : MonoBehaviour {
  6.  
  7.         private Transform _tweenTarget;
  8.         private bool _isDisplayed = false;
  9.         public Vector3 hover = Vector3.zero;
  10.         public Vector3 pressed = new Vector3(0f, 150f);
  11.         public float duration = 0.2f;
  12.  
  13.         Vector3 mPos;
  14.         bool mStarted = false;
  15.  
  16.         void Start(){
  17.                 _tweenTarget = transform.GetChild(1);
  18.  
  19.                 if (!mStarted)
  20.                 {
  21.                         mStarted = true;
  22.                         mPos = _tweenTarget.localPosition;
  23.                 }
  24.         }
  25.  
  26.         // Shout that a new bottom sheet is going to be opened
  27.         void OnEnable () {
  28.                 MapEventsManager.Trigger("OnOpeningBottomSheet");
  29.                 MapEventsManager.OnOpeningBottomSheet += Close;
  30.                 UICamera.mainCamera.GetComponent<UICamera>().onClick += Open;
  31.         }
  32.        
  33.         void OnDisable () {
  34.                 MapEventsManager.OnOpeningBottomSheet -= Close;
  35.                 UICamera.mainCamera.GetComponent<UICamera>().onClick -= Open;
  36.         }
  37.  
  38.         void Open(){
  39.                 if (!_isDisplayed){
  40.                         TweenPosition.Begin(_tweenTarget.gameObject, duration, mPos + pressed).method = UITweener.Method.EaseInOut;
  41.                         _isDisplayed = true;
  42.                 }
  43.         }
  44.  
  45.         void Close(){
  46.                 if (_isDisplayed){
  47.                         TweenPosition.Begin(_tweenTarget.gameObject, duration, mPos).method = UITweener.Method.EaseInOut;
  48.                         _isDisplayed = false;
  49.                 }
  50.         }
  51.  
  52. }
  53.  

I tried with Onclick and onClick.

I am new to delegate stuff...

17
NGUI 3 Support / Re: Setting Anchor through code reset UISprite size
« on: December 01, 2014, 03:27:53 PM »
With deeper search in the forum I found that the widget/sprite must need a parent.

So for now I have :

|--dummyMarker
    UISprite

and I need to have

|--parent
    UIWidget
    |--dummyMarker
        UIsprite

I will try that

Edit : it works.

18
NGUI 3 Support / [resolved]Setting Anchor through code reset UISprite size
« on: December 01, 2014, 01:20:31 PM »
Hellon

I attempt to dynamically add markers on a map.

My marker is a prefab with a UISprite component. It has a 120*120 size

I do :
  1.         GameObject UIMarker = NGUITools.AddChild(MapComponentPanel, markerPrefab);
  2.         UIMarker.GetComponent<UISprite>().SetAnchor(markerDummy.transform);

At runtime the sprite size is reseted to 2*2.

What is the right way to add a child and to anchor it while keeping the size of the prefab ?

19
NGUI 3 Support / Load atlas, make a sprite and add to hierarchie
« on: December 01, 2014, 03:14:05 AM »
Hi,

I am looking for a good code example to :

1- Load an atlas in Resource by its name
2- create a new sprite (or widget, what is the best here, drawcalling speaking ?) using the sprite name.
3- Attach to the hierarchy.

This will be in a loop to create hundred of icons on a map.

I need help for the two first steps. Thanks for your time :)

20
TNet 3 Support / TNET for mobile MMO in offline mode
« on: September 12, 2014, 04:59:09 AM »
Hi,

I wonder if TNET could fit my needs.

I am working on a MMO for mobile. I have :
- a WorldServerModel which is the representation of all objects (monster, player, items...) on the whole map.
- a LocalWorldModel which is the representation of all objects in a specific region around the player.
- a PlayerWorldModel which is the representation of all objects concerning the player in a specific region around the player (leveled monster, equipable item, pickable resource...)
- MapModels, InventoryModels, etc... representing objects concerning the player and formated for different Views (I also work with NGUI databinding)

I want my game to be playable in offline mode :
- The player picks, drop, sell, craft... items available in his LocalWorldModel
- Once online, the LocalWorldModel syncs with WorldServerModel to add the modification.

I also want my game to be playable in online mode :
- The player picks, drop, sell, craft... items available in his LocalWorldModel
- LocalWorldModel WorldServerModel syncs like any other online game.

Do you think TNET could be usable for the two cases ?

Regards

21
NGUI 3 Documentation / Re: UIPanel
« on: August 30, 2014, 02:37:34 PM »
Ho, maybe I found a better way using an invisible widget.


22
NGUI 3 Documentation / Re: UIPanel
« on: August 30, 2014, 02:32:46 PM »
Have you got a code to adjust the size of a collider on uipanel ? (like on uisprite)

23
NGUI 3 Documentation / Re: UIButton
« on: August 28, 2014, 11:38:50 AM »
I have a function here attached to a Sprite :

  1.         public void OnPress(bool isPressed){
  2.                 if(isPressed) {
  3.                         Debug.Log("Down");
  4.                 }
  5.                 else{
  6.                         Debug.Log("Up");
  7.                 }
  8.  
  9.         }
  10.  

In a UIbutton I drag the sprite in the On Press -> Notify of a UIEvent trigger component.
I select the Sprite/OnPress function but it asks me for an argument. Where do I find the "bool isPressed" ?

24
Yep, it is what I done and it works, but I wonder if it is as efficient as a vector shape.

25
NGUI 3 Documentation / Re: UISprite
« on: August 26, 2014, 01:56:33 PM »
Arf...

-> UISprite.width inherited from UIWidget

Need a rest...

26
NGUI 3 Documentation / Re: UISprite
« on: August 26, 2014, 01:44:57 PM »
What is the attributes for the height/width (in widget sub menu) ?
I can't get my eyes on it...

Is it get and set ?

27
NGUI 3 Support / Material Design - how to do a ink element animation ?
« on: August 26, 2014, 10:21:42 AM »
Hello,

I want to create some assets based on Google's material design specs.

I would like to recreate the material response behavior on a touch event. It is simply a round colored shape scaling to reach the maximum size of a sprite.

I am stuck on a little thing. I can't create a round shape in Unity !

So is there a way with little performance footprint to generate a a round vector shape with NGUI ?

28
NGUI 3 Support / Re: NGUI/NDATA data binding features.
« on: August 21, 2014, 01:09:24 AM »
Ok, burning... I keep my hand off :)

Thx for your reply Sonicviz. Fow now I just need some superficial binding (one ui element to another in the same prefab). So I think NGUI will fit my need for the moment.

In the futur I will need to create some deeper binding to connect the view to the view model without coupling my prefabs with additional components. But maybe NGUI will fit also. Wait and see... (any advice on it Arenmook ?)

On your other point, you are right it is a pain in the a** to have such abandonwares on the assets store. But I think this is the draw back of the mass effect.
Maybe a system like the github report with activity monitoring, issues counter, stars... could be a better solution to curate the asset store and avoid the paid-for-nothing sensation.

Thx folks.

29
NGUI 3 Support / NGUI/NDATA data binding features.
« on: August 20, 2014, 11:03:18 AM »
Hello,

what are the differences between the native data bindings feature of NGUI and the NDATA plugin ? Are they overlaping totaly ? Is NDATA is stille needed for a MVVM pattern ?

Regards

Pages: 1 [2]