public void SetSpriteOpen() { if (_animationSprite == null) { _animationSprite = transform.GetChild(0).GetComponent <SAnimation.SAnimation>(); } _animationSprite.GetComponent <SpriteRenderer>().color = Color.white; }
private void ResumeMobebleBlocksAnimations() { foreach (GameObject movableBlock in _movableBlocks) { SAnimation.SAnimation componentInChildren = movableBlock.GetComponentInChildren <SAnimation.SAnimation>(); componentInChildren?.StartAnimation(); } }
public void ResumeAllAnimations() { if (_movableBlocks != null && _movableProblems != null) { ResumeMobebleBlocksAnimations(); foreach (ProblemContainer movableProblem in _movableProblems) { SAnimation.SAnimation componentInChildren = movableProblem.GetComponentInChildren <SAnimation.SAnimation>(); componentInChildren?.StartAnimation(); } } }
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(); }
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(); } } }
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); }