コード例 #1
0
ファイル: GameManager.cs プロジェクト: Scover-w/Among_Them
    public void UseOrb(bool isRed)
    {
        if (!playerCanClick)
        {
            return;
        }

        if (isRed && OrbManager.GetRedCount() < 1)
        {
            return;
        }

        if (!isRed && OrbManager.GetBlueCount() < 1)
        {
            return;
        }


        Vector3 position = RaycastMesh();

        if (position == Vector3.zero)
        {
            return;
        }
        OrbManager.DecrementOrb(isRed);
        GameObject orb = Instantiate(orbG, containerMap);

        orb.transform.position = position + new Vector3(0f, 1f, 0f);
        orb.GetComponent <OrbBehaviour>().StartTicTac(isRed);
    }