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

Pages: 1 ... 6 7 [8]
106
NGUI 3 Support / Re: Stretch Texture in runtime
« on: January 04, 2013, 11:49:30 AM »
Hi,

Set the Pivot point of your sprite to Top, then move your sprite where you want. Resize the sprite by modifiying the Y value of the Scale of its transform.

Regards.

107
Hi,

What would you like to have for the button events ? c# events using delegates or Listeners pattern using interface ?

You can send me examples to see what are your need and tell me how much you pay for the work.

Regards,

Bardelot Alexandre.

108
TNet 3 Support / Re: TNet: Tasharen Networking Framework
« on: December 25, 2012, 06:26:06 AM »
I recommand this ... just buy it, it is an awesome framework. I got an access of the beta and I am going to buy it eyes closed.

The code is really clear and well documented. The example are good and there is all you need to know to port your game to multiplayer.

Great work :)

109
NGUI 3 Support / Re: Widgets fade in/out
« on: December 21, 2012, 05:06:19 PM »
Ah ok I see now what you want to do.

The best way to do it is by code in a specified script. This script animates all children widgets one by one using this pattern (FadeIn -> Pause -> FadeOut).

I have done it for you, just create an Empty GameObject and attach the next script. Parent all your SlicedSprite (or any widget you want to animate) to it. Start the game :)

You can modify the function OnAnimationEnd() to add the stuff you need or make it more generic by adding event callback etc..

  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4.  
  5. public class LogosAnimation : MonoBehaviour {
  6.  
  7.     public float FadeInDuration = 1.0f;
  8.     public float PauseDuration = 3.0f;
  9.     public float FadeOutDuration = 1.0f;
  10.  
  11.     private enum FadeType
  12.     {
  13.         FadeOut = -1,
  14.         Pause = 0,
  15.         FadeIn = 1
  16.     }
  17.  
  18.     private float _duration = 0.0f;
  19.     private float _time = 0.0f;
  20.     private int _currentWidget = 0;
  21.     private FadeType _currentAnimation;
  22.     UIWidget[] _widgets;
  23.  
  24.         // Use this for initialization
  25.         void Start ()
  26.     {
  27.         _widgets = GetComponentsInChildren<UIWidget>();
  28.        
  29.         foreach (UIWidget widget in _widgets)
  30.         {
  31.             SetWidgetAlpha(widget, 0.0f);
  32.         }
  33.  
  34.         SetupAnimation(FadeType.FadeIn);
  35.         }
  36.  
  37.     // Update is called once per frame
  38.     void Update()
  39.     {
  40.         _time += Time.deltaTime;
  41.  
  42.         // If there is a widget to animate
  43.             if( _currentWidget < _widgets.Length)
  44.         {
  45.             // Check if the current animation is done.
  46.             if(_time > _duration)
  47.             {
  48.                 if (_currentAnimation == FadeType.FadeOut)
  49.                 {
  50.                     // Animate the next widget
  51.                     _currentWidget++;
  52.                    
  53.                     // Check if all widgets have been animated.
  54.                     if (_currentWidget >= _widgets.Length)
  55.                     {
  56.                         OnAnimationEnd();
  57.                     }
  58.                     else
  59.                     {
  60.                         SetupAnimation(FadeType.FadeIn);
  61.                     }
  62.                 }
  63.                 else
  64.                 {
  65.                     // Next widget animation
  66.                     SetupAnimation(_currentAnimation - 1);
  67.                 }
  68.             }
  69.             else
  70.             {
  71.                 // Apply the alpha modification;
  72.                 UpdateWidgetAlpha(_widgets[_currentWidget], Time.deltaTime * ((float)_currentAnimation));
  73.             }
  74.         }
  75.         }
  76.  
  77.     private void OnAnimationEnd()
  78.     {
  79.         // Do some stuff when the animation is done.
  80.         // Call the next level for example.
  81.     }
  82.  
  83.     private void SetWidgetAlpha(UIWidget widget, float alpha)
  84.     {
  85.         Color color = widget.color;
  86.         color.a = alpha;
  87.         widget.color = color;
  88.     }
  89.  
  90.     private void UpdateWidgetAlpha(UIWidget widget, float toAdd)
  91.     {
  92.         SetWidgetAlpha(widget, widget.alpha + toAdd);
  93.     }
  94.  
  95.     private void SetupAnimation(FadeType type)
  96.     {
  97.         _time = 0;
  98.         _currentAnimation = type;
  99.  
  100.         switch (type)
  101.         {
  102.             case FadeType.FadeIn:
  103.                 _duration = FadeInDuration;
  104.                 break;
  105.             case FadeType.Pause:
  106.                 _duration = PauseDuration;
  107.                 break;
  108.             case FadeType.FadeOut:
  109.                 _duration = FadeOutDuration;
  110.                 break;
  111.  
  112.         }
  113.     }
  114. }
  115.  
  116.  

110
NGUI 3 Support / Re: Widgets fade in/out
« on: December 21, 2012, 10:42:04 AM »
You can add a TweenAlpha on every widget you want to fade in.

You set the 'From' to 0 and the 'To' to 1, the duration and the easing function (how the value of the alpha changes over time). You may also setup a callback to get the event when the Tweening is ended

111
NGUI 3 Support / Re: Bought NGUI, says I'm using the free version
« on: December 21, 2012, 03:45:07 AM »
I think that you need to delete the NGUI folder and import again the pro version of NGUI

112
TNet 3 Support / Re: TNet: Tasharen Networking Framework
« on: December 18, 2012, 11:13:29 AM »
Is it possible to get an early access to the beta ?

I have a NGUI license.

113
TNet 3 Support / Re: TNet: Tasharen Networking Framework
« on: December 11, 2012, 10:13:41 AM »
Any ETA ? :P
Does the license will be the same as NGUI (1 license for 1 company or 1 license per user) and do you plan to release a free version to test it before buying it ?

114
TNet 3 Support / Re: TNet: Tasharen Networking Framework
« on: December 11, 2012, 09:56:21 AM »
Hi,

I'm working on a game which will need some network, I might use your network framework for it :)

How much will it cost ?


115
NGUI 3 Support / Re: Limited support September 17-20
« on: September 18, 2012, 09:40:43 AM »
Lol i was joking, what you do is awesome :) Me and my team are gonna buy nGUI today.

Keep doing this excellent job !

Alexandre Bardelot
Graphicstream

116
NGUI 3 Support / Re: Limited support September 17-20
« on: September 18, 2012, 09:12:06 AM »
Thats not a job, thats a burden  ;D

117
NGUI 3 Support / Re: Limited support September 17-20
« on: September 18, 2012, 08:38:15 AM »
You found a new job !  :P

Pages: 1 ... 6 7 [8]