public void Awake() { _playerSpeed = new TweakableFloat("pSpeed", 0.0f, 10.0f, 2.0f); _spriteTransforms = transform.Find("Sprites"); _rigidbody = GetComponent<Rigidbody2D>(); _animator = GetComponent<Animator>(); }
private void CreateFloat(TweakableFloat tweakable) { TweakableFloatUI tweakableFloatUI = UnityEngine.Object.Instantiate(m_prefabFloat); tweakableFloatUI.transform.SetParent(m_content, worldPositionStays: false); TweakableFloatUI component = tweakableFloatUI.GetComponent <TweakableFloatUI>(); component.Init(tweakable); PostCreate(component); }
public void Init(TweakableFloat tweakable) { base.TweakableObject = tweakable; base.TweakableName = tweakable.TweakableName; m_text.text = GetShortName(); tweakable.Float.Subscribe(delegate(float f) { m_value.text = f.ToString("0.00"); m_slider.value = (f - tweakable.Min) / (tweakable.Max - tweakable.Min); }).AddTo(this); }
protected void Awake() { _basePosition = transform.position; _thrusterForce = new TweakableFloat("_thrusterForce", 800.0f, 10000.0f, PLAYER_THRUSTER_FORCE_DEFAULT); _hammerObj = transform.Find("BiscuitHammer").gameObject; _characterCenterObj = transform.Find("CharacterCenter").gameObject; _rigidbody = GetComponent<Rigidbody2D>(); _heatController = GetComponent<HeatController>(); _injuredParticleSystem = transform.Find("PInjuredParticleSystem").gameObject.GetComponent<ParticleSystem>(); }
protected void Awake() { _suspicionMultiplier = new TweakableFloat("AnimalSuspicionMultiplier", 0.0f, 1.0f, 0.5f); _animator = GetComponent<Animator>(); GameObject[] players = GameObject.FindGameObjectsWithTag("Player"); if (players.Length != 1) { Debug.LogError("Weird number of players found: " + players.Length); } _player = players[0].GetComponent<PlayerMovementController>(); IndicatorView[] indicatorViews = transform.GetComponentsInChildren<IndicatorView>(); if (indicatorViews.Length != 1) { Debug.LogError("Weird number of indicator views found: " + indicatorViews.Length); } _indicatorView = indicatorViews[0]; (transform.Find("Indicator").gameObject as GameObject).SetActive(false); SetUpStateMachine(); }
public void OnChanged() { TweakableFloat tweakableFloat = (TweakableFloat)base.TweakableObject; tweakableFloat.Float.Value = m_slider.value * (tweakableFloat.Max - tweakableFloat.Min) + tweakableFloat.Min; }