public void MatlChange()
    {
        MatlInfo matlInfo = this.GetComponent <MatlInfo>();
        Image    image    = this.GetComponent <Image>();

        if (matlInfo.matlList != MatlInfo.MatlList.empty)
        {
            image.color = new Color(255, 255, 255, 255);
        }
        if (matlInfo.matlList == MatlInfo.MatlList.stick)
        {
            image.sprite = stickSprite;
        }
        else if (matlInfo.matlList == MatlInfo.MatlList.triangle)
        {
            image.sprite = triangleSprite;
        }
        else if (matlInfo.matlList == MatlInfo.MatlList.lessThan)
        {
            image.sprite = lessThanSprite;
        }
        else if (matlInfo.matlList == MatlInfo.MatlList.circle)
        {
            image.sprite = circleSprite;
        }
        else
        {
            image.color = Color.clear;
        }
    }
Esempio n. 2
0
    public void OnSelect()
    {
        if (setMatls.GetComponent <SynthesisController>().EndFlag == true)
        {
            return;
        }
        MatlInfo thisMatlInfo = this.GetComponent <MatlInfo>();

        if (thisMatlInfo.matlList != MatlInfo.MatlList.empty)
        {
            for (int i = 0; i < 5; i++)
            {
                if (setMatl[i].GetComponent <MatlInfo>().matlList == MatlInfo.MatlList.empty)
                {
                    setMatl[i].GetComponent <MatlInfo>().matlList = thisMatlInfo.matlList;
                    if (thisMatlInfo.matlList == MatlInfo.MatlList.stick)
                    {
                        MatlManager.NowMatl[0] -= 1;
                        if (MatlManager.NowMatl[0] == 0)
                        {
                            thisMatlInfo.matlList = MatlInfo.MatlList.empty;
                        }
                    }
                    if (thisMatlInfo.matlList == MatlInfo.MatlList.triangle)
                    {
                        MatlManager.NowMatl[1] -= 1;
                        if (MatlManager.NowMatl[1] == 0)
                        {
                            thisMatlInfo.matlList = MatlInfo.MatlList.empty;
                        }
                    }
                    if (thisMatlInfo.matlList == MatlInfo.MatlList.lessThan)
                    {
                        MatlManager.NowMatl[2] -= 1;
                        if (MatlManager.NowMatl[2] == 0)
                        {
                            thisMatlInfo.matlList = MatlInfo.MatlList.empty;
                        }
                    }
                    if (thisMatlInfo.matlList == MatlInfo.MatlList.circle)
                    {
                        MatlManager.NowMatl[3] -= 1;
                        if (MatlManager.NowMatl[3] == 0)
                        {
                            thisMatlInfo.matlList = MatlInfo.MatlList.empty;
                        }
                    }
                    break;
                }
            }
        }
    }
Esempio n. 3
0
    //プレイヤーにぶつかったものがCrystalだったら10個まで取得
    void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Crystal")
        {
            if (SceneManager.GetActiveScene().name == "Tutorial")
            {
                if (TutorialController.instance.CrystalGet == false)
                {
                    TutorialController.instance.CrystalGet = true;
                }
                else if (TutorialController.instance.CrystalGet == true)
                {
                    TutorialController.instance.CrystalGet_2 = true;
                }
            }

            MatlInfo matlInfo = other.GetComponent <MatlInfo>();
            other.GetComponent <CapsuleCollider>().enabled = false;
            if (MatlManager.NowMatl[(int)matlInfo.matlList] >= 10)
            {
                Debug.Log("所持上限を超えています");
                other.GetComponent <CapsuleCollider>().enabled = true;
                return;
            }
            else
            {
                Destroy(other.gameObject);
                MatlManager.NowMatl[(int)matlInfo.matlList]++;
            }
        }

        if (other.tag == "WeaponCrystal")
        {
            WeaponInfo weaponInfo = other.GetComponent <WeaponInfo>();
            if (WeaponManager.NowWeapon[(int)weaponInfo.weaponList] >= 5)
            {
                Debug.Log("所持上限を超えています");
                return;
            }
            else
            {
                WeaponManager.NowWeapon[(int)weaponInfo.weaponList]++;
                Destroy(other.gameObject);
            }
        }
    }