Esempio n. 1
0
    //
    void OnSucc(float xPos, int columnIndex, bool isPlayerFacingLeft, SuccModule succModule)
    {
        float xDist = transform.position.x - xPos;

        if (isPlayerFacingLeft && transform.position.x < xPos)
        {
            if (xDist > -1.49f && isEdible)
            {
                SetYZ();
                succModule.DepositSucc(this, columnIndex);
                gameObject.SetActive(false);
            }
            else
            {
                transform.position = transform.position + new Vector3(1.0f, 0);
            }
        }
        else if (!isPlayerFacingLeft && transform.position.x > xPos)
        {
            if (xDist < 1.49f && isEdible)
            {
                SetYZ();
                succModule.DepositSucc(this, columnIndex);
                gameObject.SetActive(false);
            }
            else
            {
                transform.position = transform.position - new Vector3(1.0f, 0);
            }
        }
    }
Esempio n. 2
0
    //
    void OnUnsucc(float xPos, int columnIndex, bool isPlayerFacingLeft, SuccModule succModule)
    {
        float xDist = transform.position.x - xPos;

        if (isPlayerFacingLeft && transform.position.x < xPos)
        {
            transform.position = transform.position - new Vector3(1.0f, 0);
        }
        else if (!isPlayerFacingLeft && transform.position.x > xPos)
        {
            transform.position = transform.position + new Vector3(1.0f, 0);
        }
    }