示例#1
0
 public void Hide()
 {
     MyMotion.Get(gameObject)
     .Smooth(isSmooth)
     .Postion(defaultPostion)
     .Mode(MyMotion.Modes.Absolute)
     .BlendTime(motionTime)
     .Run();
 }
示例#2
0
 public void Display()
 {
     MyMotion.Get(gameObject)
     .Smooth(isSmooth)
     .Postion(targetPostion)
     .Mode(MyMotion.Modes.Absolute)
     .BlendTime(motionTime)
     .Run();
 }
示例#3
0
        //砍去底部树干
        public void RemoveTrunk(Vector3 postion, Vector3 rotate)
        {
            if (nodeList.Count == 0)
            {
                return;
            }
            audio.Play();
            TreeNode bottomNode = nodeList[0];

            bottomNode.GetComponent <SpriteRenderer>().sortingOrder = 3;
            lastNode = bottomNode;
            nodeList.Remove(bottomNode);
            MyMotion.Get(bottomNode.gameObject)
            .Mode(MyMotion.Modes.Absolute)
            .Postion(postion)
            .Gravity(new Vector3(0, 0.05f, 0))
            .Rotate(rotate)
            .BlendTime(0.75f)
            .AddOnFinishListener(() =>
            {
                Destroy(bottomNode.gameObject);
            })
            .Run();
            CreateTrunk();
            nodeList[0].transform.position = origin.transform.position + new Vector3(0, 0.5f * stump.bounds.size.y, 0) + new Vector3(0, 1.5f * trunk[index].bounds.size.y, 0) + originOffset;
            //TreeMotion();

            //只运动最后一节树干
            MyMotion.Get(nodeList[0].gameObject).WaitFinish(() =>
            {
                MyMotion.Get(nodeList[0].gameObject)
                .Mode(MyMotion.Modes.Relative)
                .Postion(new Vector3(0, -bottomNode.GetComponent <SpriteRenderer>().sprite.bounds.size.y))
                .BlendTime(0.075f)
                .AddOnBlendListener(() =>
                {
                    TreeMotion();
                })
                .AddOnFinishListener(() =>
                {
                    TreeMotion();
                })
                .Run();
            }, true);
        }