示例#1
0
    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);
    }