コード例 #1
0
    public bool InteractionValid()
    {
        if (m_canTakeSandwich)
        {
            m_finalSandwhich  = m_playerHand.CurrentHeldObject().ReturnCurrentObject().GetComponent <HoldablePlate>();
            m_currentSandwich = m_finalSandwhich.GetComponent <HoldablePlate>().m_currentSandwhichType;
            m_playerHand.EmptyHand(true, false);

            StartTakenSandwichAnim();
            m_sandwichHandedIn.Invoke();
        }
        return(true);
    }
コード例 #2
0
    private IEnumerator GetNewPlate()
    {
        while (!m_canGetPlate)
        {
            yield return(null);
        }
        HoldablePlate newPlate = m_pooler.NewObject(m_plateObject, transform.position, Quaternion.identity).GetComponent <HoldablePlate>();

        newPlate.CreatePlate(m_transformsInSandwhich, m_currentSandwhich);
        m_currentSandwhich.ResetMe();
        m_playerHand.PickUpObject(newPlate.gameObject);

        m_transformsInSandwhich.Clear();
        m_lastPlacedObject     = null;
        m_plateCollider.size   = new Vector3(m_plateCollider.size.x, m_colOriginalSizeY, m_plateCollider.size.z);
        m_plateCollider.center = new Vector3(m_plateCollider.center.x, m_colOriginalPositionY, m_plateCollider.center.z);

        m_playerHand.SetHoldingSandwhichState(true);
    }