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; } }
public virtual void SetPrivates(Instantiator instantiator, Character character, SwipeSceneBhv swipeSceneBhv) { _instantiator = instantiator; _character = character; _swipeSceneBhv = swipeSceneBhv; }
public override void SetPrivates(Instantiator instantiator, Character character, SwipeSceneBhv swipeSceneBhv) { base.SetPrivates(instantiator, character, swipeSceneBhv); _xpGained = (int)(Helper.XpNeedForLevel(_character.Level) * 0.2f); _hpLost = (int)(_character.HpMax * 0.15f); }
private void OnSceneLoad(Scene arg0, LoadSceneMode arg1) { _soundControler = GameObject.Find(Constants.TagSoundControler).GetComponent <SoundControlerBhv>(); _swipeSceneBhv = GameObject.Find(Constants.GoSceneBhvName).GetComponent <SwipeSceneBhv>(); }