private void MakeRain() { //activate cannon here //move cannon to point b, start timer //if < 2s and hit, move to point a and fire case 2 else >= 2s fire case 1 //cannon goes back as it rains //case 1 rain without red object, case 2 rain with red object and Fallen() CannonBehaviour cannonBehaviour = cannon.GetComponent <CannonBehaviour>(); cannonBehaviour.Move(); }
private void CallCannon(){ CannonBehaviour cannonScript = cannon.GetComponent<CannonBehaviour>(); if(reset){ cannonScript.waypointIndex = 1; cannonScript.cannonTimeStamp = 0.0f; cannonScript.cannonDmg = false; cannonScript.bossDmg = false; reset = false; } cannonScript.Move(); if(cannonScript.bossDmg && bossTimer > 15.0f){ bossHit = true; } else { if(bossTimer > 15.0f){ ResetBoss(); } } }