Example #1
0
    // Use this for initialization
    void Start()
    {
        GetComponent <InstructionsMenu>().SceneRequiresPlayer = false;
        // Full health
        PlayerScript.Instance.SetInitialHealth();
        Spotlight.rotation = Quaternion.Euler(155, 100, 0);

        // Start animation

        /*
         * this.Delay(SceneStartDelay, () =>
         * {
         *  LightColumn.FadeAlpha(this, LightColumn.color.a, 0, 2f, false);
         * });
         */
        PlayerPosLeft             = PlayerPositions.Find("Left").position;
        PlayerPosMiddle           = PlayerPositions.Find("Middle").position;
        PlayerPosRight            = PlayerPositions.Find("Right").position;
        Avatar.transform.position = PlayerPosMiddle;

        foreach (AuraLight light in LandScene.FindObjectsOfTypeAll <AuraLight>())
        {
            light.enabled = true; //sometimes the lights just randomly disable for some reason
        }

        this.Delay(5, () => { PlayerRun(); });
        this.Delay(15, () => { SpotlightMoving = false; });
    }
Example #2
0
 new void Start()
 {
     base.Start();
     GameManager.Instance.StopTimer();
     instance = this;
     Invoke("DropCutters", DelayBeforeCutters);
     CutterInfo.SetActive(false);
     Phase2Objects.SetActive(false);
     LoseSound    = GetComponent <AudioSource>();
     CurrentPhase = 1;
     //Phase2Objects.SetActive(false);
     foreach (AuraLight light in FindObjectsOfTypeAll <AuraLight>())
     {
         light.enabled = true; //sometimes the lights just randomly disable for some reason
     }
     GetComponentInChildren <ChildScript>().StartFollowing(PlayerScript.Instance.transform);
     PlayerScript.Instance.transform.rotation = Quaternion.identity;
     PlayerScript.Instance.transform.position = new Vector3(0, -2.65f, 1.62f);
 }
Example #3
0
    private void SetDifficulty()
    {
        DifficultySetting difficulty = difficultySettings[currentDifficulty];

        switch (SceneManager.GetActiveScene().name)
        {
        case "WarScene":
            FindObjectOfType <WarScene>().CollectableLifeSeconds = difficulty.CollectableLifeSeconds;
            BombEmitter bombEmitter = FindObjectOfType <BombEmitter>();
            bombEmitter.BombIntervalSeconds = difficulty.BombInterval;
            bombEmitter.BombDrag            = difficulty.BombDrag;
            foreach (BombScript bomb in FindObjectsOfType <BombScript>())
            {
                bomb.GetComponent <Rigidbody2D>().drag = difficulty.BombDrag;
            }
            break;

        case "SeaScene":
            SeaScene sea = FindObjectOfType <SeaScene>();
            sea.StartingWaveStrength = difficulty.StartingWaveSize;
            sea.EndingWaveStrength   = difficulty.EndingWaveSize;
            LandScene.FindObjectsOfTypeAll <EnemyGun>()[0].ShootDelay = difficulty.ShootDelay;
            break;

        case "LandScene":
            Searchlight light = LandScene.FindObjectsOfTypeAll <Searchlight>()[0];    //Find it even if it is disabled
            light.SweepSpeed           = difficulty.SearchlightSpeed;
            light.FramesVisibleForLoss = difficulty.SearchlightTime;
            GuardScript guard = LandScene.FindObjectsOfTypeAll <GuardScript>()[0];
            guard.FramesVisibleForLoss = difficulty.GuardTime;
            guard.WalkSpeed            = difficulty.GuardSpeed;
            LandScene.FindObjectsOfTypeAll <FenceCut>()[0].CutSpeed = difficulty.CutFenceSpeed;
            break;

        default:
            Debug.Log("Can't change difficulty in this scene");
            break;
        }

        ShowText();
        DiffText.color = DifficultyTextColours[currentDifficulty];
        switch (currentDifficulty)
        {
        case 0:
            DiffText.text = "E";
            break;

        case 1:
            DiffText.text = "N";
            break;

        case 2:
            DiffText.text = "H";
            break;

        case 3:
            DiffText.text = "EX";
            break;

        default:
            Debug.LogError("...What just happened?");
            break;
        }
    }