Esempio n. 1
0
    public void spawnC(GameObject doctor)
    {
        sharedCannon.transform.position = doctor.transform.Find("Player").gameObject.GetComponent <NavMeshAgent>().transform.position;

        FireCannonball fireCannonball = sharedCannon.GetComponent <FireCannonball>();


        fireCannonball.SetDoctor(doctor);
        fireCannonball.resetCannonball();
        fireCannonball.attachDoctor();
        fireCannonball.animatorSettings();

        //reduce charge
    }
Esempio n. 2
0
    void Update()
    {
        if (!fireC.HasDoctor())
        {
            return;
        }

        registerControls();
        switch (stage)
        {
        case 0:
            if (getSelectRelease)
            {
                getSelectRelease = false;
                stage            = 1;
            }
            break;

        case 1:
            checkHorizontal();
            break;

        case 2:
            checkVertical();
            break;

        case 3:
            checkCharge();
            break;

        case 4:
            pushFire();
            break;

        default:
            break;
        }
        if (reset)
        {
            firePower            = 0;
            canpos.canHorizontal = false;
            canpos.canVertical   = false;
            canpos.charging      = false;
            fireC.resetCannonball();
            reset = false;
            stage = 0;
        }
    }