             })
             
             self.view.sendSubviewToBack(self.AnimationMenuView)
+            finishedcount = 0
         }
         
     }

            let lineShapeLayerwork = CAShapeLayer()
            let lineAnimationwork = CABasicAnimation(keyPath: "strokeStart")
            
            linework.moveToPoint(CGPointMake(CGFloat(moveToPoint[i][0]), CGFloat(moveToPoint[i][1])))
            linework.addLineToPoint(CGPointMake(CGFloat(addToPoint[i][0]), CGFloat(addToPoint[i][1])))
            Straightline.append(linework)
            Straightline[i].stroke()
            
            lineShapeLayerwork.path = Straightline[i].CGPath
            lineShapeLayerwork.strokeColor = UIColor.clearColor().CGColor

            //メニューが出ていない時は何も動作しない
        }
    }
    
    var finishedcount = 0
    let moveToPointSecond: [[Int]] = [[110,110],[200,570],[300,640]]
    let addToPointSecond: [[Int]] = [[248,110],[100,570],[230,640]]
    
    //CAanimation終了後に呼ばれる
    override func animationDidStop(anim: CAAnimation, finished flag: Bool) {
        
        finishedcount++

        if(finishedcount == 3){  //最初の線が伸びていくアニメーション終了後
            ShowSecondLine()
        }
        
        if(finishedcount == 6){ //2番目に線が伸びていくアニメーション終了後
            ShowLabel()
        }
        
    }
    
    func ShowSecondLine(){
        for(var i = 3; i < 6; i++){
            let linework = UIBezierPath()
            let lineShapeLayerwork = CAShapeLayer()
            let lineAnimationwork = CABasicAnimation(keyPath: "strokeStart")
            
            linework.moveToPoint(CGPointMake(CGFloat(moveToPointSecond[i-3][0]), CGFloat(moveToPointSecond[i-3][1])))
            linework.addLineToPoint(CGPointMake(CGFloat(addToPointSecond[i-3][0]), CGFloat(addToPointSecond[i-3][1])))
            Straightline.append(linework)
            
            lineShapeLayerwork.path = Straightline[i].CGPath
            lineShapeLayerwork.strokeColor = UIColor.clearColor().CGColor
            lineShapeLayerwork.lineWidth = 2.0
            lineShapeLayerwork.lineDashPattern = [2,3]
            lineShapeLayer.append(lineShapeLayerwork)
            
            lineAnimationwork.fromValue = 1.0
            lineAnimationwork.toValue = 0.0
            lineAnimationwork.duration = 0.3
            lineAnimation.append(lineAnimationwork)
            lineAnimation[i].delegate = self
            
            //アニメーションの途中でボタンを押されても見えないようにするため
            if(menushow == 1){
                self.lineShapeLayer[i].strokeColor = UIColor.hex("ffffff", alpha: 1.0).CGColor
            }else{
            }
            self.lineShapeLayer[i].addAnimation(self.lineAnimation[i], forKey: nil)
            self.view.layer.addSublayer(self.lineShapeLayer[i])
        }
    }
    
    func ShowLabel(){
        
    }
}
