SetTime() public method

public SetTime ( float trailTime, float timeToTweenTo, float tweenSpeed ) : void
trailTime float
timeToTweenTo float
tweenSpeed float
return void
コード例 #1
0
    IEnumerator PlayNow()
    {
        yield return(null);

        ani.PlayAnimation(animation["idle"]);
        //.CrossfadeAnimation (animation["rslash_1"], 0.2f);
        yield return(new WaitForSeconds(2));

        ani.CrossfadeAnimation(animation["rslash_1"], 0.2f);
        wt.SetTime(1, 0, 1);

        yield return(new WaitForSeconds(2));

        wt.SetTime(0.2f, 0, 1);
        //trail.SetActive (false);

        //yield return new WaitForSeconds (2);
        //wt.SetTime (1, 0, 1);

        //trail.SetActive (true);
        while (true)
        {
            wt.SetTime(1, 0, 2);
            yield return(new WaitForSeconds(0.8f));

            wt.SetTime(0.2f, 0, 2);
            yield return(new WaitForSeconds(0.2f));
        }
    }
コード例 #2
0
    void Start()

    {
        // 默认没有拖尾效果

        myTrail.SetTime(0.0f, 0.0f, 1.0f);
    }
コード例 #3
0
ファイル: Bird.cs プロジェクト: KIPKIPS/AngryBird
 // Start is called before the first frame update
 public void Start()
 {
     isFly     = false;
     isClick   = false;
     launchPos = GameObject.Find("LaunchPos").transform.position;
     //默认没有拖尾
     trail.SetTime(0.0f, 0.0f, 1.0f);
 }
コード例 #4
0
 protected void Start()
 {
     animationController.AddTrail(leftSwipe);          // Adds the trails to the animationController which will run them
     animationController.AddTrail(rightSwipe);
     //
     Initialise();
     //
     // This is just making him jump at the start... normally you would just hit PlayAnimation(idle)...
     //
     thinkTime = 1.5f;
     animationController.PlayAnimation(animationRespawn);
     leftSwipe.SetTime(2.1f, 0, 1);
     rightSwipe.SetTime(2.1f, 0, 1);
     //
 }
コード例 #5
0
    // Use this for initialization
    void Start()
    {
        ani = GetComponent <AnimationController> ();

        trail = Instantiate(Resources.Load <GameObject>("particles/newWeaponTrail")) as GameObject;
        var rightHand = ChuMeng.Util.FindChildRecursive(transform, "Point001");

        if (rightHand != null)
        {
            trail.transform.parent        = rightHand;
            trail.transform.localPosition = Vector3.zero;
            trail.transform.localScale    = Vector3.one;
            //X Rotate 90 For New Game Model
            //模型的挂点的z轴向上 因此需要调整 weaponTrail 的Y轴和模型z轴一致
            trail.transform.localRotation = Quaternion.Euler(90, 0, 0);
        }
        //GetComponent<AnimationController>().AddTrail(trail.GetComponent<WeaponTrail>());

        wt = trail.GetComponent <WeaponTrail>();
        wt.SetTime(0, 0, 1);
        trail.SetActive(true);
        ani.AddTrail(wt);

        StartCoroutine(PlayNow());
    }
コード例 #6
0
 protected void Initialise()
 {
     // The Animation Controller feeds on AnimationStates. You've got to assign your animations to variables so that you can call them from the controller
     //
     animation["attack01"].speed = 2.0f;
     animation["attack02"].speed = 2.0f;
     //
     //
     animationAttack01 = animation["attack01"];
     //
     animationAttack02 = animation["attack02"];
     animationAttack03 = animation["attack03"];
     //
     animationIdle           = animation["idle"];
     animationIdle.speed     = 0.4f;
     animationAttack03.speed = 0.8f;
     //
     swordSwipe.SetTime(0.0f, 0f, 1.0f);
     //
 }
コード例 #7
0
ファイル: PlayerCtrl.cs プロジェクト: Shintaroumx/ACT-demo
        private void ProcessInput()
        {
            //idle
            GameObject.Find("AnimatorController").GetComponent <AnimatorController> ().SetInt("animation,1");

            //move
            if (moveTrigger)
            {
                if (inputVector.sqrMagnitude > 0.001f)
                {
                    movementVector   = _mainCameraTransform.TransformDirection(inputVector);
                    movementVector.y = 0f;
                    movementVector.Normalize();
                    _transform.forward = movementVector;
                    GameObject.Find("AnimatorController").GetComponent <AnimatorController> ().SetInt("animation,2");
                }
                //walk
                if (inputVector.sqrMagnitude < 0.16f)
                {
                    _characterController.Move(movementVector * Time.deltaTime * MovementSpeed * 0.2f);
                    Dash(0.2f);
                }
                //run
                else if (inputVector.sqrMagnitude > 0.305f)
                {
                    _characterController.Move(movementVector * Time.deltaTime * MovementSpeed);
                    Dash(1.0f);
                }
                //lerp within walk and run
                else if (inputVector.sqrMagnitude < 0.305f && inputVector.sqrMagnitude > 0.16f)
                {
                    Vector3.Normalize(inputVector);
                    _characterController.Move(movementVector * Time.deltaTime * MovementSpeed * Mathf.Lerp(0.2f, 1.0f, inputVector.sqrMagnitude));
                }
            }

            //jump
            if (jump)
            {
                jumpTrigger = true;
                GameObject.Find("AnimatorController").GetComponent <AnimatorController> ().SetInt("animation,3");
                StartCoroutine(DelaytoInvoke(() => {
                    jumpTrigger = false;
                }, 1.4f));
            }

            //circle attack
            if (circleAtk)
            {
                GameObject.Find("AnimatorController").GetComponent <AnimatorController> ().SetInt("animation,5");
                if (!jumpTrigger)
                {
                    Katana.SetTime(0.7f, 0, 1);
                }
                //Katana.StartTrail (0.15f, 0.1f);
            }

            //circle attack long
            if (circleAtkLong)
            {
                GameObject.Find("AnimatorController").GetComponent <AnimatorController> ().SetInt("animation,4");
                moveTrigger = false;
                Katana.SetTime(1.0f, 0, 1);
                StartCoroutine(DelaytoInvoke(() => {
                    moveTrigger = true;
                }, 1.4f));
            }

            //triangle attack
            if (triangleAtk)
            {
                GameObject.Find("AnimatorController").GetComponent <AnimatorController> ().SetInt("animation,6");
                Katana.SetTime(1.0f, 0, 1);
            }
        }
コード例 #8
0
ファイル: TestMyTrail.cs プロジェクト: DanielChunLei/unity
 void Start()
 {
     myTrail.SetTime(0.0f, 0.0f, 1.0f);
 }
コード例 #9
0
 private void Start()
 {
     // 默认没有拖尾效果
     myTrail.SetTime(0.0f, 0.0f, 1.0f);
 }
コード例 #10
0
 void Start()
 {
             // 默认没有拖尾效果
             myTrail.SetTime(0.0f, 0.0f, 1.0f);
 }
コード例 #11
0
 public void ShowTrail()
 {
     myTrail.SetTime(2.0f, 0.0f, 1.0f);
     myTrail.StartTrail(0.5f, 0.4f);
 }
コード例 #12
0
 private void Awake()
 {
     myTrail = GetComponent <WeaponTrail>();
     myTrail.SetTime(0, 0, 1);//初始的时候不要拖尾
 }
コード例 #13
0
 protected void Start()
 {
     myTrail.SetTime(2.1f, 0, 1);
 }
コード例 #14
0
 void Start()
 {
     // 默认没有拖尾效果
     currentWeaponTrail.SetTime(0.0f, 0.0f, 1.0f);
 }
コード例 #15
0
 void Start()
 {
     animator = GetComponent <Animator>();
     // 默认没有拖尾效果
     myTrail.SetTime(0.0f, 0.0f, 1.0f);
 }
コード例 #16
0
    private AnimEvent animEvent;//事件接收

    void Start()
    {
        //先把残影关掉
        TrailObj.SetTime(0.0f, 0.0f, 1.0f);
        initAnimEvent();
    }
コード例 #17
0
 public void Reset()
 {
     weaponTrail.SetTime(0.0f, 0, 1);
 }
コード例 #18
0
 void Start()
 {
             // set no trail by default
             myTrail.SetTime(0.0f, 0.0f, 1.0f);
 }
コード例 #19
0
ファイル: Trails.cs プロジェクト: KIPKIPS/AngryBird
 void Start()
 {
     // 默认没有拖尾效果
     trail.SetTime(0.0f, 0.0f, 1.0f);
 }