예제 #1
0
 public void SetSpriteOpen()
 {
     if (_animationSprite == null)
     {
         _animationSprite = transform.GetChild(0).GetComponent <SAnimation.SAnimation>();
     }
     _animationSprite.GetComponent <SpriteRenderer>().color = Color.white;
 }
예제 #2
0
 private void ResumeMobebleBlocksAnimations()
 {
     foreach (GameObject movableBlock in _movableBlocks)
     {
         SAnimation.SAnimation componentInChildren = movableBlock.GetComponentInChildren <SAnimation.SAnimation>();
         componentInChildren?.StartAnimation();
     }
 }
예제 #3
0
 public void ResumeAllAnimations()
 {
     if (_movableBlocks != null && _movableProblems != null)
     {
         ResumeMobebleBlocksAnimations();
         foreach (ProblemContainer movableProblem in _movableProblems)
         {
             SAnimation.SAnimation componentInChildren = movableProblem.GetComponentInChildren <SAnimation.SAnimation>();
             componentInChildren?.StartAnimation();
         }
     }
 }
예제 #4
0
 public void Start()
 {
     _animationSprite = transform.GetChild(0).GetComponent <SAnimation.SAnimation>();
     _normalPositionY = _animationSprite.transform.localPosition.y;
     _normalSize      = _animationSprite.transform.localScale;
     if (_animationSprite == null)
     {
         throw new InvalidOperationException();
     }
     if (!IsOpen)
     {
         _animationSprite.GetComponent <SpriteRenderer>().color = Color.black;
     }
     SetAnimationSprite();
 }
예제 #5
0
 public void StopAllAnimations()
 {
     if (_movableBlocks != null && _movableProblems != null)
     {
         foreach (GameObject movableBlock in _movableBlocks)
         {
             SAnimation.SAnimation componentInChildren = movableBlock.GetComponentInChildren <SAnimation.SAnimation>();
             componentInChildren?.StopAnimation();
         }
         foreach (ProblemContainer movableProblem in _movableProblems)
         {
             SAnimation.SAnimation componentInChildren = movableProblem.GetComponentInChildren <SAnimation.SAnimation>();
             componentInChildren?.StopAnimation();
         }
     }
 }
예제 #6
0
        private GameObject CreateBlock(BlockInfo problemBlock, Transform parent, int index)
        {
            GameObject newBlock = BlockInstance(problemBlock).Spawn(parent);

            //fix for ground blocks
            if (problemBlock.TypeOfBlock == BlockType.FlyingGround)
            {
                newBlock.GetComponentInChildren <SpriteRenderer>().sortingOrder = index;
            }
            if (problemBlock.TypeOfBlock == BlockType.FlyingProblem ||
                problemBlock.TypeOfBlock == BlockType.Problem ||
                problemBlock.TypeOfBlock == BlockType.Coin)
            {
                SAnimation.SAnimation sAnimation = newBlock.GetComponentInChildren <SAnimation.SAnimation>();
                sAnimation?.StartAnimation();

//                newBlock.GetComponentInChildren<SAnimation.SAnimation>().StartAnimation();
            }
            newBlock.transform.localPosition = problemBlock.Position;
            return(newBlock);
        }