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.

Topics - unitymoo

Pages: [1]
NGUI 3 Support / How to set NGUI delay property via code
« on: January 01, 2017, 03:45:33 PM »
I'm trying to set the delay property of the TweenScale component in my code.
Just wondering how I can accomplish this?

Here's what I have tried so far:

   float myDelay = 1.0f;

   public void setDelay () {
      gameObject.GetComponent<TweenScale>.delay() = myDelay;

I found this thread where it is mentioned that delay is a property:

note: I'm new so exact syntax is always a big help to me :)


I want to change the color of a sprite on click -- to a random color from array.
When I click the sprite, the console message shows I'm getting a color from the array.
But I can't get the sprite to actually change color on-screen.
Does anyone know how to make this work properly?

Also I'm new to NGUI / coding in general so if there is an elegant solution to this problem please let me know.

Here is my code:

using UnityEngine;
using System.Collections;

public class btnUpdate2 : MonoBehaviour {

   public Color[] squareColor;

   public void onClickTweenColor () {
      print ("example color from array: " + squareColor [Random.Range (0, squareColor.Length)]);

      GameObject.Find ("WhiteSquare").GetComponent<UIWidget> ().color = squareColor [Random.Range (0, squareColor.Length)];


Basically I want to be able to code player object animation like Geometry dash:

I'm looking for a tutor who can work on Skype / Teamviewer for 1-2 hours per session

Tutor session 1:
please prepare simple Unity/ NGUI project using code for tween position / tween rotation

square player object appears in center screen position.
Note: Object is at rest until user taps / clicks the object.

when user taps square object:
(a) object will tween position (y position up 250 pixels, then return to origin y position)
(b) object will tween rotation (z rotation 90 degrees clockwise)

I will pay $ / hour --
please reply to thread and/or pm me

I have prepared a series of 6 lessons similar to this
to help me learn to code NGUI tween position, tween rotation, tween scale, etc.
thank you

Pages: [1]