Example #1
0
    void Update()
    {
        if (launching)
        {
            if (lifeTimer < lifeTime)
            {
                lifeTimer += Time.deltaTime;

                if (bulletCollider.height < bulletTargetLength)
                {
                    bulletCollider.height = bulletCollider.height + (bulletTargetLength / raiseTime) * Time.deltaTime;
                }
                if (bulletLength < bulletTargetLength)
                {
                    bulletLength = bulletLength + (bulletTargetLength / raiseTime) * Time.deltaTime;
                    Vector3 pos = new Vector3(0, 0, bulletLength);
                    bulletBody.SetPosition(1, pos);
                }
                if (bulletColliderPos.z < bulletTargetLength / 2)
                {
                    bulletColliderPos     = bulletColliderPos + new Vector3(0, 0, (bulletTargetLength / 2 / raiseTime) * Time.deltaTime);
                    bulletCollider.center = bulletColliderPos;
                }
            }
            else if (disapperTimer < disapperTime)
            {
                disapperTimer += Time.deltaTime;
                if (!disappering)
                {
                    Disapper();
                }
                if (beamBodyCurrentWidth > 0)
                {
                    beamBodyCurrentWidth -= (beamBodyWidth / disapperTime) * Time.deltaTime;
                    bulletBody.SetWidth(beamBodyCurrentWidth, beamBodyCurrentWidth);
                }
            }
            else
            {
                cameraFollower.ChangeCameraMode(false);
                Reset();
            }
        }
    }
Example #2
0
    void Reset()
    {
        inTransAM = false;
        transAmShadowDelayTimer = 0;
        transAmTimer            = 0;
        foreach (MeshRenderer singleMeshRenderer in aircraftBody.GetComponentsInChildren <MeshRenderer>())
        {
            singleMeshRenderer.material = bodyNomalMaterial;
        }

        foreach (MeshRenderer singleMeshRenderer in aircraftWings.GetComponentsInChildren <MeshRenderer>())
        {
            singleMeshRenderer.material = wingsNomalMaterial;
        }

        aircraftController.AircraftMaxEnginePower(normalMaxEnginePower);

        gnParticle.enableEmission = false;

        cameraFollower.ChangeCameraMode(false);

        inSpecialState = false;
    }
 public void Reload()
 {
     microMissilePod = null;
     cameraFollower.ChangeCameraMode(false);
 }