scale() публичный Метод

scale tween
public scale ( Vector3 endValue, bool isRelative = false ) : GoTweenConfig
endValue Vector3
isRelative bool
Результат GoTweenConfig
Пример #1
0
 static public int scale(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (matchType(l, argc, 2, typeof(UnityEngine.Vector3), typeof(bool)))
         {
             GoTweenConfig       self = (GoTweenConfig)checkSelf(l);
             UnityEngine.Vector3 a1;
             checkType(l, 2, out a1);
             System.Boolean a2;
             checkType(l, 3, out a2);
             var ret = self.scale(a1, a2);
             pushValue(l, ret);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(float), typeof(bool)))
         {
             GoTweenConfig self = (GoTweenConfig)checkSelf(l);
             System.Single a1;
             checkType(l, 2, out a1);
             System.Boolean a2;
             checkType(l, 3, out a2);
             var ret = self.scale(a1, a2);
             pushValue(l, ret);
             return(1);
         }
         return(error(l, "No matched override function to call"));
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Пример #2
0
    private IEnumerator Spawn(bool initial)
    {
        if (!initial)
        {
            inputEnabled = false;
            HideShip();

            Vector3 messagePoint = StartPosition() + new Vector3(-0.25f, 0.25f, 0.0f);

            MessageManager.ShowMessage("3", messagePoint);
            yield return(new WaitForSeconds(1.2f));

            MessageManager.ShowMessage("2", messagePoint);
            yield return(new WaitForSeconds(1.2f));

            MessageManager.ShowMessage("1", messagePoint);
            yield return(new WaitForSeconds(1.2f));
        }

        inputEnabled = true;
        ResetShip();

        var tween = new GoTweenConfig();

        tween.easeType = GoEaseType.BounceOut;
        tween.onComplete(SpawnComplete);
        Go.to(transform, 1.0f, tween.scale(1.0f));

        StartCoroutine(ApplyInvincibility());
    }
Пример #3
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;
            }
        }
    }
Пример #4
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);
    }
    public void AnimatePositioningItem(Transform parentTo, System.Action <ItemPickup> endAnimationEvent, AudioType playSound = AudioType.None)
    {
        // Setup variables
        onAnimationEnd   = endAnimationEvent;
        transform.parent = parentTo;

        // Setup animation configuration
        itemAnimationConfiguration.clearEvents();
        itemAnimationConfiguration.clearProperties();

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

        // Setup path
        itemTweenPath[0] = transform.localPosition;
        itemTweenPath[1] = new Vector3((transform.localPosition.x / 2f), midTweenOffset, 0);
        itemAnimationConfiguration.localPositionPath(new GoSpline(itemTweenPath));

        // Check if we need to clean up the animation
        if (itemAnimation != null)
        {
            // Clean up this item animation from the animation queue
            Go.removeTween(itemAnimation);
            itemAnimation = null;
        }

        // Create and play a new animation
        itemAnimation = Go.to(transform, animationDuration, itemAnimationConfiguration);
        itemAnimation.setOnCompleteHandler(OnAnimationEnds);
        itemAnimation.play();

        // Play a sound effect
        if (playSound == AudioType.Place)
        {
            PlayClip(dropSound);
        }
        else if (playSound == AudioType.PickUp)
        {
            PlayClip(pickupSound);
        }
    }
Пример #6
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);
    }
Пример #7
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);
            });
        }
    }
Пример #8
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);
            });
        }
    }
Пример #9
0
 private void resetConfig(float scale)
 {
     config = new GoTweenConfig ();
     config.onComplete (originalTween => animate = false);
     config.scale (scale);
 }