Example #1
0
    private void UpdateMercuryThiocyanateStack(float mercuryThiocyanateQuantityDelta)
    {
        if (mercuryThiocyanateQuantityDelta < 0)
        {
            mercuryThiocyanateQuantityDelta = 0;
        }

        m_stackSize += mercuryThiocyanateQuantityDelta / m_fullVolume * 2;
        m_stackSize  = Mathf.Min(1, m_stackSize);

        if (m_stackSize > 0)
        {
            m_stack.gameObject.SetActive(true);
            m_stack.localScale = m_baseStackSize * m_stackSize;

            if (m_currentVolume == 0)
            {
                float directionFactor = Vector3.Project(transform.forward, Vector3.down).magnitude;
                directionFactor *= Vector3.Dot(transform.forward, Vector3.down);
                directionFactor  = Mathf.Max(0, directionFactor);

                float delta = Time.deltaTime * directionFactor;
                m_stackSize -= delta;

                m_stackSize = Mathf.Max(m_stackSize, 0);

                if (MercuryThiocyanateCup.Contains(this))
                {
                    MercuryThiocyanateCup.AddToStack(delta);
                }
            }
        }
    }
Example #2
0
 private void Awake()
 {
     s_singleton = this;
 }