setIterations() public method

sets the number of iterations. setting to -1 will loop infinitely
public setIterations ( int iterations ) : GoTweenConfig
iterations int
return GoTweenConfig
Esempio n. 1
0
    private void HideMainPanelPage()
    {
        bgColorConfig.setIterations(1);
        bgColorConfig.colorProp("color", Color.black);
        bgColorConfig.easeType = GoEaseType.ExpoOut;
        Image bgImg = bg.GetComponent <Image> ();

        Go.to(bgImg, 1f, bgColorConfig);

        for (int i = 0; i < btnsTrans.Count; i++)
        {
            GoTweenConfig config = new GoTweenConfig();
            config.localPosition(new Vector3(800, 110 * (1 - i), 0), false);
            config.delay = 0.05f * i;
            config.setIterations(1);
            config.easeType = GoEaseType.ExpoOut;
            Go.to(btnsTrans [i].transform, 1f, config);
        }

        GoTweenConfig topBarConfig = new GoTweenConfig();

        topBarConfig.setIterations(1);
        topBarConfig.localPosition(new Vector3(0, 250, 0));
        topBarConfig.delay    = 0.5f;
        topBarConfig.easeType = GoEaseType.ExpoOut;
        Go.to(GameObject.Find("TopBar").transform, 0.5f, topBarConfig);

        shipConfig = new GoTweenConfig();
        shipConfig.localPosition(new Vector3(-1200, -40, -162));
        shipConfig.easeType = GoEaseType.ExpoOut;
        Go.to(GameObject.Find("ShipModel").transform, 1f, shipConfig);
    }
    private void keyDownDetector()
    {
        if (Input.GetKey (KeyCode.W)) {
            transform.Translate(new Vector3(0,0,Speed));
        }else if(Input.GetKey (KeyCode.S)){
            transform.Translate(new Vector3(0,0,-Speed));
        }else if(Input.GetKey (KeyCode.A)){
            transform.Translate(new Vector3(-Speed,0,0));
        }else if(Input.GetKey (KeyCode.D)){
            transform.Translate(new Vector3(Speed,0,0));
        }else if(Input.GetKey (KeyCode.K)){
            myShip.transform.Rotate(new Vector3(0,0,Speed));
        }else if(Input.GetKey (KeyCode.L)){
            myShip.transform.Rotate(new Vector3(0,0,-Speed));
        }

        if (Input.GetKeyUp (KeyCode.K)) {
            GoTweenConfig config = new GoTweenConfig();
            config.setIterations(1);
            config.localRotation(new Vector3(0,0,360));
            config.easeType = GoEaseType.ExpoOut;
            Go.to(myShip.transform,0.5f,config);
        } else if (Input.GetKeyUp (KeyCode.L)) {
            GoTweenConfig config = new GoTweenConfig();
            config.setIterations(1);
            config.localRotation(new Vector3(0,0,-360));
            config.easeType = GoEaseType.ExpoOut;
            Go.to(myShip.transform,0.5f,config);
        }
    }
Esempio n. 3
0
 static public int setIterations(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 2)
         {
             GoTweenConfig self = (GoTweenConfig)checkSelf(l);
             System.Int32  a1;
             checkType(l, 2, out a1);
             var ret = self.setIterations(a1);
             pushValue(l, ret);
             return(1);
         }
         else if (argc == 3)
         {
             GoTweenConfig self = (GoTweenConfig)checkSelf(l);
             System.Int32  a1;
             checkType(l, 2, out a1);
             GoLoopType a2;
             checkEnum(l, 3, out a2);
             var ret = self.setIterations(a1, a2);
             pushValue(l, ret);
             return(1);
         }
         return(error(l, "No matched override function to call"));
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Esempio n. 4
0
    void Awake()
    {
        if (affectedTransform == null)
        {
            Debug.LogError("affectedTransform must be filled in.");
        }

        // Grab all platforms
        affectedPlatforms = affectedTransform.GetComponentsInChildren <SetupTextPlatform>();

        // Setup animation configuration
        itemAnimationConfiguration.setIterations((loopForever ? -1 : 1), loopType);
        itemAnimationConfiguration.setEaseType(animationType);

        // Setup scale and rotation
        itemAnimationConfiguration.localRotation(Quaternion.identity);
        itemAnimationConfiguration.scale(Vector3.one);
        itemAnimationConfiguration.localPosition(Vector3.zero);

        // Disable all parenting scripts
        if (disableParentingAutomatically == true)
        {
            ParentToRotateEverything[] allParentScripts = affectedTransform.GetComponentsInChildren <ParentToRotateEverything>();
            foreach (ParentToRotateEverything parentScript in allParentScripts)
            {
                parentScript.enabled = false;
            }
        }
    }
Esempio n. 5
0
 private void MovePanel()
 {
     GoTweenConfig config = new GoTweenConfig ();
     config.easeType = GoEaseType.BackOut;
     config.setIterations (1);
     config.localPosition (Vector3.zero,false);
     Go.to (GameObject.Find ("ScorePanel").transform, 0.5f, config);
 }
Esempio n. 6
0
    private void HideTopBar()
    {
        GoTweenConfig topBarConfig = new GoTweenConfig();

        topBarConfig.setIterations(1);
        topBarConfig.localPosition(new Vector3(0, 375, 0));
        topBarConfig.easeType = GoEaseType.ExpoOut;
        Go.to(GameObject.Find("TopBar").transform, 0.5f, topBarConfig);
    }
Esempio n. 7
0
    private void MovePanel()
    {
        GoTweenConfig config = new GoTweenConfig();

        config.easeType = GoEaseType.BackOut;
        config.setIterations(1);
        config.localPosition(Vector3.zero, false);
        Go.to(GameObject.Find("ScorePanel").transform, 0.5f, config);
    }
    public override void Start()
    {
        base.Start();
        currentState = startingState;
        pickupLabel  = GetComponent <TextMesh>();

        // Setup animation configuration
        itemAnimationConfiguration.setIterations(1, GoLoopType.RestartFromBeginning);
        itemAnimationConfiguration.setEaseType(animationType);
    }
    void Start()
    {
        var config = new GoTweenConfig().localRotation(new Vector3(-30, 0, 0)).setEaseType(GoEaseType.CubicInOut);
        config.loopType = GoLoopType.PingPong;
        config.setIterations(-1);

        float duration = 2;

        var tween = new GoTween(transform, duration, config);
        Go.addTween(tween);
    }
Esempio n. 10
0
    private void Init()
    {
        Ship.transform.localScale = Vector3.zero;

        //init bg
        bg = GameObject.Find("Bg");
        bg.GetComponent <Image> ().color = Color.black;

        //init btns transforms
        btnsTrans.Add(GameObject.Find("PlayBtn"));
        btnsTrans.Add(GameObject.Find("HelpBtn"));
        btnsTrans.Add(GameObject.Find("RankBtn"));

        bgColorConfig.setIterations(1);
        bgColorConfig.colorProp("color", Color.gray);
        bgColorConfig.easeType = GoEaseType.ExpoOut;

        GameObject.Find("TopBar").GetComponentInChildren <Button> ().onClick.AddListener(delegate {
            gotoMainPanelPage();
        });
    }
Esempio n. 11
0
    // set up the tweens used in health behavior
    protected void InitializeTweens()
    {
        // Tween configuration
        MaterialColorTweenProperty red = new MaterialColorTweenProperty(Color.red);
        GoTweenConfig rConfig = new GoTweenConfig();
        rConfig.addTweenProperty(red);
        rConfig.setIterations(6);
        rConfig.loopType = GoLoopType.PingPong;

        // Make a tween to turn the gameObject red
        turnRed = new GoTween(this.gameObject, .5f, rConfig);
    }
Esempio n. 12
0
    public void HideList()
    {
        CancelInvoke ("RotateShip");

        _ship.SetActive(false);

        GoTweenConfig config = new GoTweenConfig ();
        config.setIterations (1);
        config.easeType = GoEaseType.ExpoOut;
        config.localPosition (new Vector3 (-590, -30, 0));
        config.delay = 0.5f;
        Go.to (transform, 0.5f, config);
    }
Esempio n. 13
0
    private void UpdateHpBar(bool isAdd)
    {
        GoTweenConfig config;

        config = new GoTweenConfig();
        config.setIterations(1);
        config.easeType = GoEaseType.ExpoOut;

        float endX;

        if (isAdd)
        {
            if (HpBar.transform.localPosition.x < 0)
            {
                endX = HpBar.transform.localPosition.x + medicine;
                if (endX > 0)
                {
                    endX = 0;
                }
            }
            else
            {
                endX = 0;
            }
        }
        else
        {
            if (HpBar.transform.localPosition.x > -STARTX)
            {
                endX = HpBar.transform.localPosition.x - damage;
                if (endX < -STARTX)
                {
                    endX = -STARTX;
                }
            }
            else
            {
                endX = -STARTX;
            }
        }

        config.localPosition(new Vector3(endX, HpBar.transform.localPosition.y, HpBar.transform.localPosition.z));
        Go.to(HpBar.transform, 0.3f, config);

        //player dead
        if (endX == -STARTX)
        {
            MyShip.SendMessage("DestroyPlayerShip");
        }
    }
Esempio n. 14
0
    public void HideList()
    {
        CancelInvoke("RotateShip");

        _ship.SetActive(false);

        GoTweenConfig config = new GoTweenConfig();

        config.setIterations(1);
        config.easeType = GoEaseType.ExpoOut;
        config.localPosition(new Vector3(-590, -30, 0));
        config.delay = 0.5f;
        Go.to(transform, 0.5f, config);
    }
Esempio n. 15
0
 // Use this for initialization
 void Start()
 {
     ProgressBar.transform.localPosition = new Vector3 (-500,0,0);
     GoTweenConfig config = new GoTweenConfig ();
     config.localPosition(new Vector3 (0, 0, 0));
     config.delay = 1f;
     config.setIterations (1);
     config.onUpdate (delegate(AbstractGoTween obj)
     {
         onProgress();
     });
     config.onComplete (delegate {
         GlobalManager.GotoGamePanel();
     });
     Go.to (ProgressBar.transform, 4, config);
 }
Esempio n. 16
0
    // Use this for initialization
    void Start()
    {
        ProgressBar.transform.localPosition = new Vector3(-500, 0, 0);
        GoTweenConfig config = new GoTweenConfig();

        config.localPosition(new Vector3(0, 0, 0));
        config.delay = 1f;
        config.setIterations(1);
        config.onUpdate(delegate(AbstractGoTween obj)
        {
            onProgress();
        });
        config.onComplete(delegate {
            GlobalManager.GotoGamePanel();
        });
        Go.to(ProgressBar.transform, 4, config);
    }
Esempio n. 17
0
    private void keyDownDetector()
    {
        if (Input.GetKey(KeyCode.W))
        {
            transform.Translate(new Vector3(0, 0, Speed));
        }
        else if (Input.GetKey(KeyCode.S))
        {
            transform.Translate(new Vector3(0, 0, -Speed));
        }
        else if (Input.GetKey(KeyCode.A))
        {
            transform.Translate(new Vector3(-Speed, 0, 0));
        }
        else if (Input.GetKey(KeyCode.D))
        {
            transform.Translate(new Vector3(Speed, 0, 0));
        }
        else if (Input.GetKey(KeyCode.K))
        {
            myShip.transform.Rotate(new Vector3(0, 0, Speed));
        }
        else if (Input.GetKey(KeyCode.L))
        {
            myShip.transform.Rotate(new Vector3(0, 0, -Speed));
        }

        if (Input.GetKeyUp(KeyCode.K))
        {
            GoTweenConfig config = new GoTweenConfig();
            config.setIterations(1);
            config.localRotation(new Vector3(0, 0, 360));
            config.easeType = GoEaseType.ExpoOut;
            Go.to(myShip.transform, 0.5f, config);
        }
        else if (Input.GetKeyUp(KeyCode.L))
        {
            GoTweenConfig config = new GoTweenConfig();
            config.setIterations(1);
            config.localRotation(new Vector3(0, 0, -360));
            config.easeType = GoEaseType.ExpoOut;
            Go.to(myShip.transform, 0.5f, config);
        }
    }
Esempio n. 18
0
    public void ShowList()
    {
        _ship.transform.localPosition = new Vector3 (1500, 0, -120);
        _ship.SetActive(true);
        InvokeRepeating ("RotateShip", 0f, 0.002f);

        GoTweenConfig config = new GoTweenConfig ();
        config.setIterations (1);
        config.easeType = GoEaseType.ExpoOut;
        config.localPosition (new Vector3 (-390, -30, 0));
        config.delay = 0.5f;
        Go.to (transform, 0.5f, config);

        config = new GoTweenConfig ();
        config.scale (new Vector3 (200, 200, 200));
        config.localPosition (new Vector3 (50, 0, -120));
        config.easeType = GoEaseType.ExpoOut;
        Go.to (_ship.transform, 1f, config);
    }
Esempio n. 19
0
    public void ShowList()
    {
        _ship.transform.localPosition = new Vector3(1500, 0, -120);
        _ship.SetActive(true);
        InvokeRepeating("RotateShip", 0f, 0.002f);

        GoTweenConfig config = new GoTweenConfig();

        config.setIterations(1);
        config.easeType = GoEaseType.ExpoOut;
        config.localPosition(new Vector3(-390, -30, 0));
        config.delay = 0.5f;
        Go.to(transform, 0.5f, config);

        config = new GoTweenConfig();
        config.scale(new Vector3(200, 200, 200));
        config.localPosition(new Vector3(50, 0, -120));
        config.easeType = GoEaseType.ExpoOut;
        Go.to(_ship.transform, 1f, config);
    }
Esempio n. 20
0
    public void Show()
    {
        base.Show();

        if (!isFirstShow)
        {
            isFirstShow = true;
            InvokeRepeating("RotateShip", 0, 0.02f);
        }

        Image bgImg = bg.GetComponent <Image> ();

        Go.to(bgImg, 2f, bgColorConfig);

        GlobalManager.shipColor = Ship.GetComponent <MeshRenderer>().material.color;

        shipConfig = new GoTweenConfig();
        shipConfig.setIterations(1);
        shipConfig.easeType = GoEaseType.ExpoInOut;
        shipConfig.localPosition(new Vector3(-50, -30, -130));
        shipConfig.scale(new Vector3(200, 200, 200));
        Ship.transform.localScale = new Vector3(0, 0, 0);
        Go.to(Ship.transform, 1, shipConfig);

        for (int i = 0; i < btnsTrans.Count; i++)
        {
            GoTweenConfig config = new GoTweenConfig();
            config.localPosition(new Vector3(350, 110 * (1 - i), 0), false);
            config.delay = 0.5f + 0.05f * i;
            config.setIterations(1);
            config.easeType = GoEaseType.ExpoOut;
            Go.to(btnsTrans[i].transform, 1f, config);
            string btnName = btnsTrans[i].name;
            btnsTrans[i].GetComponent <Button>().onClick.AddListener(delegate {
                onClickBtn(btnName);
            });
        }
    }
Esempio n. 21
0
    private void UpdateHpBar(bool isAdd)
    {
        GoTweenConfig config;
        config = new GoTweenConfig();
        config.setIterations(1);
        config.easeType = GoEaseType.ExpoOut;

        float endX;

        if (isAdd) {
            if(HpBar.transform.localPosition.x<0){
                endX = HpBar.transform.localPosition.x+medicine;
                if(endX>0){
                    endX = 0;
                }
            }else{
                endX = 0;
            }
        } else {
            if(HpBar.transform.localPosition.x>-STARTX){
                endX = HpBar.transform.localPosition.x-damage;
                if(endX<-STARTX){
                    endX = -STARTX;
                }
            }else{
                endX = -STARTX;
            }
        }

        config.localPosition(new Vector3(endX,HpBar.transform.localPosition.y,HpBar.transform.localPosition.z));
        Go.to(HpBar.transform,0.3f,config);

        //player dead
        if (endX == -STARTX) {
            MyShip.SendMessage("DestroyPlayerShip");
        }
    }
Esempio n. 22
0
    public void Show()
    {
        base.Show ();

        if (!isFirstShow) {
            isFirstShow = true;
            InvokeRepeating ("RotateShip", 0, 0.02f);
        }

        Image bgImg = bg.GetComponent<Image> ();
        Go.to (bgImg, 2f, bgColorConfig);

        GlobalManager.shipColor = Ship.GetComponent<MeshRenderer>().material.color;

        shipConfig = new GoTweenConfig ();
        shipConfig.setIterations (1);
        shipConfig.easeType = GoEaseType.ExpoInOut;
        shipConfig.localPosition(new Vector3(-50,-30,-130));
        shipConfig.scale (new Vector3 (200, 200, 200));
        Ship.transform.localScale = new Vector3 (0, 0, 0);
        Go.to (Ship.transform, 1, shipConfig);

        for (int i=0; i<btnsTrans.Count; i++) {
            GoTweenConfig config = new GoTweenConfig();
            config.localPosition(new Vector3(350,110*(1-i),0),false);
            config.delay = 0.5f+0.05f*i;
            config.setIterations(1);
            config.easeType = GoEaseType.ExpoOut;
            Go.to (btnsTrans[i].transform, 1f , config);
            string btnName = btnsTrans[i].name;
            btnsTrans[i].GetComponent<Button>().onClick.AddListener(delegate {
                onClickBtn(btnName);
            });
        }
    }
Esempio n. 23
0
 private void HideTopBar()
 {
     GoTweenConfig topBarConfig = new GoTweenConfig ();
     topBarConfig.setIterations (1);
     topBarConfig.localPosition (new Vector3 (0,375,0));
     topBarConfig.easeType = GoEaseType.ExpoOut;
     Go.to (GameObject.Find ("TopBar").transform, 0.5f, topBarConfig);
 }
Esempio n. 24
0
    private void HideMainPanelPage()
    {
        bgColorConfig.setIterations(1);
        bgColorConfig.colorProp ("color", Color.black);
        bgColorConfig.easeType = GoEaseType.ExpoOut;
        Image bgImg = bg.GetComponent<Image> ();
        Go.to (bgImg, 1f, bgColorConfig);

        for (int i=0; i<btnsTrans.Count; i++) {
            GoTweenConfig config = new GoTweenConfig ();
            config.localPosition (new Vector3 (800, 110 * (1 - i), 0), false);
            config.delay = 0.05f * i;
            config.setIterations (1);
            config.easeType = GoEaseType.ExpoOut;
            Go.to (btnsTrans [i].transform, 1f, config);
        }

        GoTweenConfig topBarConfig = new GoTweenConfig ();
        topBarConfig.setIterations (1);
        topBarConfig.localPosition (new Vector3 (0,250,0));
        topBarConfig.delay = 0.5f;
        topBarConfig.easeType = GoEaseType.ExpoOut;
        Go.to (GameObject.Find ("TopBar").transform, 0.5f, topBarConfig);

        shipConfig = new GoTweenConfig ();
        shipConfig.localPosition (new Vector3 (-1200, -40, -162));
        shipConfig.easeType = GoEaseType.ExpoOut;
        Go.to (GameObject.Find ("ShipModel").transform, 1f, shipConfig);
    }