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

Pages: [1]
1
Hi i have a chest and i want to activate a tween on a key which is under the chest. so when the plkayer enters the chest colider i want to play the move tween on the key.

Not sure how to go about this thanks

Daniel

2
DOTween & DOTween Pro / DoTween doesnt work correctly on Android
« on: October 21, 2015, 11:43:15 AM »
Hi This well could be User error, but it all works perfect in unity but not on a device.
This is the code:
Code: [Select]
using UnityEngine;
using System.Collections;
using DG.Tweening;
using UnityEngine.UI;

public class MoveMenu : MonoBehaviour
{
    public GameObject go;
   public Transform tran;
   public Button btnOut;
   public Button btnIn;
   public bool moveBool = false;
   private float objectSize;
    // Use this for initialization
void Start ()
{
    objectSize = (float)go.GetComponent<Renderer>().bounds.size.x;
}

// Update is called once per frame
void Update () {
 
}

    public void moveIt()
    {
        if (!moveBool)
        {
           tran.DOMoveX(Screen.width + objectSize  , .5f).SetRelative();
           moveBool = true;
           btnOut.gameObject.SetActive(false);
           btnIn.gameObject.SetActive(true);
        }
        else
        {
           tran.DOMoveX(-Screen.width + objectSize, .5f).SetRelative();
           moveBool = false;
           btnOut.gameObject.SetActive(true);
           btnIn.gameObject.SetActive(false);
        }
    }
}

What happens is the menu shoots to center as it should but will not go back again.. literally goes back a tiny amount at a time.

Not sure why but works perfect on PC but not android..

Thanks

Daniel

3
DOTween & DOTween Pro / Latest Unity - DoTween broken - dont quote me !
« on: October 20, 2015, 01:28:49 PM »
hi I have created a simple scroll menu.. then I created a empty gameobject and added a script to the new empty gameobject. The script is simple, declare a public Transform tran, then create a new method called MoveIt();

declare using DG.Tweening;
 
public void MoveIt(){

tran.DoMoveX(Screen.width / 2, .5f);

}

This is then called via the onclick on a button which should move the transform of the menu place in the nameobject transform..

Basically this all worked and then went tits up when I updated unity.. I have rolled back to previous version of unity and still not working..

what happens now is it is duplicating all UI elements placing them in the UI element I want to move and  moving everything in the transform space .. so seems like unity issue.. dont where to go with this..

Can anyone else verify is its unity or something corrupted in my project or stupidity on my part.

Cheers

Thanks

Daniel

4
Hi I have been using DOFade on Image component from the available package on the asset store.. However the independent time setting in preferences was not applying on android device so i upgraded and now i dont have DOFade on Image component?

Is there a reason why this has been removed and could you let me know and alternative to fade out the image.

Thanks

Daniel

5
Hi i have a Canvas and 2 menus. Menu 1 is a pause menu and centered on the screen when toggled. Menu 2 settings menu is off the screen but on same canvas.
The pause menu contains a button 'Setting'. What i am trying to do is when someone clicks on the Settings button the canvas moves by 805 .. But this is not happening.

As with the Pro Animation Basic example, I have placed an animation on the container GameObject within the UICanvas that holds the 2 menus. I have added a DoTween Animation component to the game object and set it to move by 805 and unchecked the autoplay button.

Now on the 'Settings' Button in the pause menu on the onClick i have added the GameObject container and selected onClick Animation.DoPlay.

When i run this nothing happens. I click the button and it doesnt seem to fire.

Any help would be great as it looks to be identical to the example. A simple Move animation on the x Axis.

Thanks

Daniel


EDIT: Ok I found out why it is not playing. this is down to the fact that the pause menu stops the time and there for it is not updating.

However i have set in the preferences for the TmeScale to be independent check box. But this is not make it work..

Question: Should the animation be playing as the Timescale is ticked to independent? - see attached.   The call to stop the game time i am using is( Time.timeScale = 0; )

Thanks

Daniel



EDIT: SOLVED
Use a coroutine to fire the animation via code and not the editor.

6
DOTween & DOTween Pro / DOTween not working on Windows phone
« on: August 04, 2015, 02:16:07 PM »
Hi Can anyone verify if they can run a 'master' build from Visual Studio on a windows phone and if the Tweens work.. Currently all of mine are not working at all..

Thanks

Daniel

7
DOTween & DOTween Pro / Exporting to Windows Store
« on: August 03, 2015, 12:33:03 PM »
Hi When i Export to windows store and i select the phone export as it exports to both phone and windows store version..
All the dotween tweens wont work on the mobile build..

Is there something i should be doing to include DOTween in windows store/phone export?

How ever if i explicitly select the export for windows  8  in Unity then everything does work.. It just that as 'Windows Store' export should do both versions store and phone plus you can specify all the settings.

If i have got this arse over tit then please enlighten me.

Thanks

Daniel

8
DOTween & DOTween Pro / wp8 / windows apps store - error System.Type
« on: July 30, 2015, 05:23:59 PM »
Hi,

I would like to know if DOTween Pro is comnpatible with WP8 (10 as its launched) and the windows app store.

I have switched my build type to Windows app store and when i try to compile the application i get an error:
" Assets\Demigiant\DOTweenPro\DOTweenAnimation.cs(479,22): error CS1061: 'System.Type' does not contain a definition for 'IsSubclassOf' and no extension method 'IsSubclassOf' accepting a first argument of type 'System.Type' could be found (are you missing a using directive or an assembly reference?) "

I am running latest release of Unity and Dotween

Any suggestions would be great thanks

Daniel

9
DOTween & DOTween Pro / restart a tween and sequence.
« on: June 12, 2015, 01:29:08 PM »
Hi, I am struggling to get DOTween to work as i want it.. I am new to Unity and DOTween but i have come from Java libgdx platform. However, I have 3 simple tweens 2 are a sequence and one is a straight up move tween. Code:
Code: [Select]
void Update ()
{
breathCount = (int)touchCount.breathNumber;
textNum.text = breathCount.ToString ();
if (playedOnce == false) {
PlayTween ();
}
}

public void TransPortObject ()
{
//this.transform.position = new Vector3 (transform.position.x, transform.position.y, 100);
//
DOTween.RestartAll ();

print ("REst the tween has fired.. asif");
}


public void PlayTween ()
{

if (touchCount.state == touchCount.State.START) {
                        textNumber.DOMove (new Vector3 (transform.position.x, transform.position.y, 100), breathCount);
textNumber.GetComponent<MeshRenderer> ().material.color = new Color (1, 1, 1, 0);
s.Append (textNumber.GetComponent<Renderer> ().material.DOFade (1, touchCount.breathTime / 4));

s.Append (textNumber.GetComponent<Renderer> ().material.DOFade (0, touchCount.breathTime / 4 * 2).SetDelay (touchCount.breathTime / 4));

playedOnce = true;

}

}

Update calls the playTween(); then the transPortObject(); is top reset the Tweens. RestartAll();
But they are not restarting..

I have been over the example scripts to no joy and tried all kinds of resetting the transform position  to adding loops yoyo, restart.. and nothing works..

Something is up and i cant figure out how to simple restart the tweens. normal DoMove and 2 sequences.


the transportObject(); is called every time the set variable time is completed.

This is the entire Script:

Code: [Select]
using UnityEngine;
using System.Collections;
using DG.Tweening;
using UnityEngine.UI;
public class numberScript : MonoBehaviour
{


public Transform textNumber;
public bool playedOnce = false;
public Sequence s;
public TextMesh textNum;
private int breathCount;
void Start ()
{
s = DOTween.Sequence ();
textNumber.GetComponent<MeshRenderer> ().material.color = new Color (1, 1, 1, 0);
//textNumber.GetComponent<Renderer>().material.SetColor()
textNum = gameObject.GetComponent<TextMesh> ();

}

// Update is called once per frame
void Update ()
{
breathCount = (int)touchCount.breathNumber;
textNum.text = breathCount.ToString ();
if (playedOnce == false) {
PlayTween ();
}
}

public void TransPortObject ()
{
//this.transform.position = new Vector3 (transform.position.x, transform.position.y, 100);
//
DOTween.RestartAll ();

print ("REst the tween has fired.. asif");
}


public void PlayTween ()
{

if (touchCount.state == touchCount.State.START) {
textNumber.GetComponent<MeshRenderer> ().material.color = new Color (1, 1, 1, 0);
textNumber.DOMove (new Vector3 (transform.position.x, transform.position.y, 100),touchCount.breathTime);
s.Append (textNumber.GetComponent<Renderer> ().material.DOFade (1, touchCount.breathTime / 4));

s.Append (textNumber.GetComponent<Renderer> ().material.DOFade (0, touchCount.breathTime / 4 * 2).SetDelay (touchCount.breathTime / 4));

playedOnce = true;

}

}
}


please excuse the messy code.


I hope someone can point me in the right direction.. just dont understand why i am having such problems with it.

Thanks

10
DOTween & DOTween Pro / Fade in then fade out sequence
« on: June 10, 2015, 04:51:00 PM »
Hi all who read this.

I am trying to figure out how to go about setting a sequence on a text mesh.

It works if  i set one fade to the texture but will not work if i set 2 fades. this is my code:

Code: [Select]

public Transform textNumber;
bool playedOnce = false;
private Sequence s;
void Start ()
{
s = DOTween.Sequence ();
}


void Update ()
{
PlayTween ();
}

void PlayTween ()
{
if (playedOnce == false) {
if (touchCount.state == touchCount.State.START) {

print ("played the fade tween");
s.Append (textNumber.GetComponent<Renderer> ().material.DOFade (1, .5f));
s.Append (textNumber.GetComponent<Renderer> ().material.DOFade (1, 2));



playedOnce = true;
}
}
}
}

Any suggestions would be great.
Thanks

Pages: [1]