public void attack(CombatFlow target) { amOffensive(); bool readyToFire = readyToFireAt(target); bool tryLock = tryLockTarget(target); bool hardpointReady = hardpoints.isReadyToFire(); //Debug.Log("ReadyToFire: " + readyToFire + ", tryLock: " + tryLock + ", hardpointReady: " + hardpointReady); if (readyToFire && tryLock && hardpointReady) { Debug.Log("AI ready to fire"); // do attack here rippleFireCounter = rippleFireDelay; GameObject launchedWeap = hardpoints.launchButtonDown(); Debug.Log("======================== Launching weapon: " + launchedWeap); tryAddOutgoingWeap(launchedWeap); } else { // keep waiting until can do attack hardpoints.launchButtonUp(); } }
// CALL FROM FIXEDUPDATE -- determine precise physics update when button pressed void launchManagement() { if (Input.GetButton("Weapon Launch")) { hardpointController.launchButtonDown(); } else { hardpointController.launchButtonUp(); } //// button pressed, but no launch active // if (Input.GetButton("Weapon Launch") && !hardpointController.launchActive) //{ // // launchprocess // hardpointController.launchProcess(); //} //// button NOT pressed, but launch IS active //if(!Input.GetButton("Weapon Launch") && hardpointController.launchActive) //{ // // end the launch // hardpointController.launchEndProcess(); //} }