public override void SetPrivates() { base.SetPrivates(); _spriteRenderer = gameObject.GetComponent <SpriteRenderer>(); _soundControler = GameObject.Find(Constants.TagSoundControler).GetComponent <SoundControlerBhv>(); _isStretching = false; _resetedScale = new Vector3(transform.localScale.x, transform.localScale.y, transform.localScale.z); _pressedScale = new Vector3(transform.localScale.x * 1.2f, transform.localScale.y * 1.1f, transform.localScale.z * 1.0f); _isResetingColor = false; _resetedColor = Constants.ColorPlain; _pressedColor = new Color(0.7f, 0.7f, 0.7f, 1.0f); }
public override void SetPrivates() { base.SetPrivates(); _fightSceneBhv = GameObject.Find(Constants.GoSceneBhvName).GetComponent <FightSceneBhv>(); _gridBhv = GameObject.Find(Constants.GoSceneBhvName).GetComponent <GridBhv>(); _soundControler = GameObject.Find(Constants.TagSoundControler).GetComponent <SoundControlerBhv>(); _isStretching = false; _resetedScale = new Vector3(1.0f, 1.0f, 1.0f); _pressedScale = new Vector3(1.1f, 1.1f, 1.0f); _onSprite = transform.Find("OnSprite").GetComponent <SpriteRenderer>(); _offSprite = transform.Find("OffSprite").GetComponent <SpriteRenderer>(); _overSprite = transform.Find("OverSprite").GetComponent <SpriteRenderer>(); SetStartVisuals(); }
public virtual void SetPrivates(int id, int day, Biome biome, Character character, Instantiator instantiator) { SetPrivates(); SceneManager.sceneLoaded += OnSceneLoad; _soundControler = GameObject.Find(Constants.TagSoundControler).GetComponent <SoundControlerBhv>(); _spriteRenderer = GetComponent <SpriteRenderer>(); _cacheSpriteRenderer = transform.Find("Cache")?.GetComponent <SpriteRenderer>(); _instantiator = instantiator; _character = character; _swipeSceneBhv = GameObject.Find(Constants.GoSceneBhvName).GetComponent <SwipeSceneBhv>(); _initialPosition = Constants.CardInitialPosition; _initialTouchPosition = _initialPosition; _likePosition = new Vector3(6.0f, 0.0f); _dislikePosition = new Vector3(-6.0f, 0.0f); _state = CardState.Active; _rotateAngle = -15.0f; _isReseting = false; _hasMoved = false; _isStretching = false; _resetedScale = new Vector3(1.0f, 1.0f, 1.0f); _pressedScale = new Vector3(1.05f, 1.05f, 1.0f); _disabledScale = new Vector3(0.95f, 0.95f, 1.0f); gameObject.name = "Card" + id; HandleSortingLayerAndOrder(id); _boxColliders2D = gameObject.GetComponents <BoxCollider2D>(); transform.localScale = _disabledScale; if (id == 0) { _cacheSpriteRenderer.enabled = true; foreach (BoxCollider2D box in _boxColliders2D) { box.enabled = false; } } else { _isStretching = true; } }
private void Start() { _soundControler = GameObject.Find(Constants.TagSoundControler).GetComponent <SoundControlerBhv>(); }
private void OnSceneLoad(Scene arg0, LoadSceneMode arg1) { _soundControler = GameObject.Find(Constants.TagSoundControler).GetComponent <SoundControlerBhv>(); _swipeSceneBhv = GameObject.Find(Constants.GoSceneBhvName).GetComponent <SwipeSceneBhv>(); }