Exemple #1
0
    void Start()
    {
        beatController = GameObject.Find("BeatController").GetComponent <BeatController>();
        beatController.SetCanAttack(canPlayerAttack);

        playerController = GameObject.Find("Player").GetComponent <PlayerController>();
        playerController.SetCanShift(canPlayerShift);

        scroller           = GameObject.Find("RainbowSideScroller").GetComponent <ParallaxController>();
        bScroller          = GameObject.Find("RainbowBottomScroller").GetComponent <ParallaxController>();
        startParallaxSpeed = scroller.GetComponent <ParallaxController>().speed;
        startTime          = Time.time;

        visualizers = GameObject.FindGameObjectsWithTag("AudioCube");
        foreach (var v in visualizers)
        {
            v.GetComponent <RandomColorAudioVisualizer>().SetColorRange(audioMinRed, audioMaxRed, audioMinGreen, audioMaxGreen, audioMinBlue, audioMaxBlue);
        }

        //Camera.main.orthographicSize = cameraSize;
        if (cameraSize != 12f) //TODO not this
        {
            StartCoroutine("ZoomOut");
            GameObject.Find("BoundaryBox").transform.localScale = new Vector3(46f, 35f, 26f);
            GameObject.Find("Player").transform.Find("Spearhead").GetComponent <SpearheadController>().screenSize = 20f;
        }
    }
Exemple #2
0
 void Awake()
 {
     cameraController = GameObject.Find("CameraManager").GetComponent <CameraController> ();
     beatController   = GameObject.Find("BeatController").GetComponent <BeatController> ();
     engineParticles  = GetComponentsInChildren <ParticleSystem> ();
     spearHead        = GetComponentInChildren <SpearheadController> ();
 }
 public override void OffBeat(int offBeatCounter)
 {
     _currentOffBeatCounter = offBeatCounter;
     MovePlayer(offBeatCounter);
     base.OffBeat(offBeatCounter);
     if (offBeatCounter == 1)
     {
         if (_currentlyQueuedDirection != EDirection.NONE && _isDead == false)
         {
             startMovement();
             comboBarController.SetBar(true);
         }
         else
         {
             comboBarController.SetBar(false);
         }
     }
     if (offBeatCounter == 7)
     {
         comboBarController.ResetIndicator();
         if (_isDead)
         {
             BeatController.GetInstance().BeatSubject.RemoveObserver(this);
             this._spawner.activate();
             Destroy(this.gameObject);
         }
     }
 }
Exemple #4
0
 void Start()
 {
     goalPosition          = transform.localPosition + new Vector3(0f, 0f, -15f);
     goalProtectorPosition = miniBossProtector.localPosition + new Vector3(0f, 0f, -15f);
     Move();
     MoveProtector();
     beatController = GameObject.Find("BeatController").GetComponent <BeatController> ();
 }
Exemple #5
0
 // Use this for initialization
 void Start()
 {
     song = gameObject.GetComponent <AudioSource>();
     song.Play();
     playerState = GetComponent <PlayerState>();
     bc          = GetComponent <BeatController>();
     destination = gameObject.transform.position;
 }
 // Use this for initialization
 void Start()
 {
     beatController = FindObjectOfType <BeatController>();
     ApplicationModel.screenSizeX = Screen.width;
     ApplicationModel.screenSizeY = Screen.height;
     ApplicationModel.yRatio      = 16;
     ApplicationModel.xRatio      = (float)ApplicationModel.screenSizeX / (float)ApplicationModel.screenSizeY * (float)ApplicationModel.yRatio;
     //Debug.Log(ApplicationModel.screenSizeX.ToString() + " " + ApplicationModel.screenSizeY.ToString());
 }
Exemple #7
0
 private void Start()
 {
     animator       = GetComponent <Animator>();
     beatController = GetComponent <BeatController>();
     audioSource    = GetComponent <AudioSource>();
     ScanSceneForBoxers();
     scoreboardAudio    = scoreboard.GetComponent <AudioSource>();
     scoreboardAnimator = scoreboard.GetComponent <Animator>();
     StartCoroutine(StartRound());
 }
Exemple #8
0
    // Use this for initialization
    void Start()
    {
        nextFireTime = Time.time + fireRate;

        SMNextMove   = Time.time + 1.0f;
        gameCamera   = GameObject.Find("CameraManager").GetComponent <CameraController> ();
        playerObject = GameObject.Find("Player");

        beatController = GameObject.Find("BeatController").GetComponent <BeatController>();
    }
Exemple #9
0
 // Use this for initialization
 void Awake()
 {
     beatController      = beatObject.GetComponent <BeatController>();
     particleSystem      = GetComponent <ParticleSystem>();
     rectTransform       = GetComponent <RectTransform>();
     onScreen            = false;
     image               = GetComponent <Image>();
     color               = image.color;
     color.a             = 0.0f;
     image.color         = color;
     startOffsetPosition = rectTransform.anchoredPosition.x;
 }
    public override void OnBeat()
    {
        if (_isDead)
        {
            //this.enabled = false;
            //this.GetComponent<TileAnimator>().enabled = false;
            //this.get
            Debug.Log("isdead");
            BeatController.GetInstance().BeatSubject.RemoveObserver(this);
            Destroy(this.gameObject);
        }
        base.OnBeat();

        endMovement();

        foreach (GameObject gameObject in _currentTrapTileList)
        {
            Debug.Log("Currently on trap " + gameObject.name);
            TileAnimator tileAnimator = gameObject.GetComponent <TileAnimator>();
            if (tileAnimator != null && tileAnimator.isActive)
            {
                switch (gameObject.tag)
                {
                case "SpikeTrap":
                    sprites = deathAnim;
                    break;

                case "Lava":
                    sprites = deathAnim;
                    break;

                case "SpearTrap":
                    sprites = deathAnim;
                    break;
                }
                _isDead = true;
            }
            TrapDoorAnimator trapDoorAnimator = gameObject.GetComponent <TrapDoorAnimator>();
            if (trapDoorAnimator != null && gameObject.tag == "TrapDoor")
            {
                if (trapDoorAnimator.isOpen)
                {
                    _isDead = true;
                    sprites = trapDoorAnim;
                }
                else
                {
                    trapDoorAnimator.isActivated = true;
                }
            }
        }
    }
Exemple #11
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }
 // Start is called before the first frame update
 void Start()
 {
     _beatController = BeatController.GetInstance();
     _beatController.BeatSubject.AddObserver(this);
     _inputManager = InputManager.GetInstance();
     changeDirection(_currentDirection);
     Debug.Log("Starting animation");
     _grid                = GameObject.FindGameObjectWithTag("TileGrid").GetComponent <Grid>();
     _collisionMap        = GameObject.FindGameObjectWithTag("ColliderMap").GetComponent <Tilemap>();
     _goalMap             = GameObject.FindGameObjectWithTag("GoalMap").GetComponent <Tilemap>();
     _trapMap             = GameObject.FindGameObjectWithTag("TrapMap").GetComponent <TrapMap>();
     _currentTrapTileList = new List <GameObject>();
 }
Exemple #13
0
    /// <summary>
    /// Creates the monaural beat object.
    /// </summary>
    /// <returns>The monaural beat object.</returns>
    private BeatController _CreateMonauralBeatObject()
    {
        GameObject beatObject = (GameObject)AssetDatabase.LoadAssetAtPath(
            "Assets/AccelBrainBeat/MonauralBeatObject.prefab",
            typeof(GameObject)
            );

        BeatObject      = (GameObject)Instantiate(beatObject);
        BeatObject.name = this._BeatObjectName;
        BeatController beatController = BeatObject.GetComponent <MonauralBeatController>();

        return(beatController);
    }
Exemple #14
0
 public UM()
 {
     this.Size = new Size(1440, 960);
     this.g    = this.CreateGraphics();
     health    = 50;
     b         = new SolidBrush(Color.Green);
     p         = new SoundPlayer();
     bc        = new BeatController();
     try
     {
         bg = new Bitmap("bg.bmp");
     }
     catch (ArgumentException)
     {
         Console.WriteLine("Error reading bg image");
     }
 }
Exemple #15
0
        public static void Start()
        {
            DIServiceLocator.Current.RegisterType <ISequencer, FakeSequencer>();
            var          beatModel          = new BeatModel();
            var          controller         = new BeatController(beatModel);
            IBPMObserver consoleBPMObserver = new ConsoleBPMObserver();

            var formBPMObserver = new DJView();

            formBPMObserver.Closing += delegate { beatModel.RemoveObserver((IBPMObserver)formBPMObserver); };
            var temp = formBPMObserver;

            Task.Factory.StartNew(() => Application.Run(temp));

            var formController = new DJController(controller);

            Task.Factory.StartNew(() => Application.Run(formController));

            beatModel.RegisterObserver(consoleBPMObserver);
            beatModel.RegisterObserver((IBPMObserver)formBPMObserver);
            controller.Start();
        }
Exemple #16
0
    // Start is called before the first frame update
    void Start()
    {
        win                  = false;
        canPause             = true;
        inProgress           = true;
        currentPhase         = 0;
        timer                = initialSeconds;
        currentRequiredKills = initialKillRequirement;
        aud                  = GetComponent <AudioSource>();
        if (timerText == null)
        {
            timerText = GameObject.Find("UICanvas").transform.GetChild(1).GetChild(0).GetComponent <TextMeshProUGUI>();
        }
        if (killsText == null)
        {
            killsText = GameObject.Find("UICanvas").transform.GetChild(0).GetChild(0).GetComponent <TextMeshProUGUI>();
        }
        if (pauseMenu == null)
        {
            pauseMenu = GameObject.Find("UICanvas").transform.GetChild(GameObject.Find("UICanvas").transform.childCount - 1).gameObject;
        }
        if (endCard == null)
        {
            endCard = GameObject.Find("UICanvas").transform.GetChild(GameObject.Find("UICanvas").transform.childCount - 2).gameObject;
        }
        if (beatController == null)
        {
            beatController = GameObject.Find("BeatController").transform.GetComponent <BeatController>();
        }

        if (hasTutorial)
        {
            Invoke("Tutorial", 0.1f);
        }

        Invoke("StartBeat", 1f);
    }
 public static void Run()
 {
     IBeatModel  model      = new BeatModel();
     IController controller = new BeatController(model);
 }
Exemple #18
0
 //private GameObject[] visualizers;
 // Use this for initialization
 void Awake()
 {
     beatController = GameObject.Find("BeatController").GetComponent <BeatController>();
     //visualizers = GameObject.FindGameObjectsWithTag("AudioCube");
 }
Exemple #19
0
    // Start is called before the first frame update

    private void Awake()
    {
        BeatController.beatController = this;
    }
Exemple #20
0
    /// <summary>
    /// Raises the GU event.
    /// </summary>
    void OnGUI()
    {
        EditorGUILayout.Space();
        EditorGUILayout.Space();
        EditorGUILayout.LabelField("Choose Binaural Beats or Monaural Beats.");
        this._BeatTypePopup = EditorGUILayout.Popup(
            "Beat Type: ",
            this._BeatTypePopup,
            new string[] { "Binaural Beat", "Monaural Beat" }
            );

        EditorGUILayout.Space();
        EditorGUILayout.Space();
        EditorGUILayout.LabelField("Tune rhythms or frequencies to choice your favorite brain waves.");
        this._RhythmPopup = EditorGUILayout.Popup(
            "Rhythms: ",
            this._RhythmPopup,
            new string[] {
            "Not selected.",
            "Gamma Rhythms(30-100 Hz): To be the peak concentration.",
            "Alpha Rhythms(8-12 Hz): To be relaxed state.",
            "Theta Rhythms(4-7 Hz): To be the meditative state and focusing the mind.",
            "Delta Rhythms(1-3 Hz): To have a good sleep."
        }
            );
        EditorGUILayout.Space();
        EditorGUILayout.Space();

        this._LeftFrequencySlider = EditorGUILayout.IntSlider(
            "Left Frequency (Hz): ",
            this._LeftFrequencySlider,
            this._MinFrequency,
            this._MaxFrequency
            );

        if (this._RhythmPopup == 1)
        {
            this._RightFrequencySlider = this._LeftFrequencySlider + 30;
        }
        else if (this._RhythmPopup == 2)
        {
            this._RightFrequencySlider = this._LeftFrequencySlider + 8;
        }
        else if (this._RhythmPopup == 3)
        {
            this._RightFrequencySlider = this._LeftFrequencySlider + 5;
        }
        else if (this._RhythmPopup == 4)
        {
            this._RightFrequencySlider = this._LeftFrequencySlider + 3;
        }

        this._RightFrequencySlider = EditorGUILayout.IntSlider(
            "Right Frequency (Hz): ",
            this._RightFrequencySlider,
            this._MinFrequency,
            this._MaxFrequency
            );

        EditorGUILayout.IntField(
            "Brain Wave (Hz): ",
            Mathf.Abs(this._LeftFrequencySlider - this._RightFrequencySlider)
            );

        EditorGUILayout.Space();
        EditorGUILayout.Space();
        EditorGUILayout.LabelField("Regulate the sample Rate. This value depends on your device.");
        this._SampleRate = EditorGUILayout.IntField(
            "Sample Rate: ",
            this._SampleRate
            );

        EditorGUILayout.Space();
        EditorGUILayout.Space();
        EditorGUILayout.LabelField("Tune volumes. But it is recommended that the value is approximately 0.5.");
        this._Gain = EditorGUILayout.Slider(
            "Volumes",
            this._Gain,
            0.1f,
            1.0f
            );

        EditorGUILayout.Space();
        EditorGUILayout.Space();
        if (GUILayout.Button("Assign the object in the Hierarchy View."))
        {
            this._DeleteBeatObject();
            BeatController beatController = null;
            AudioListener  audioListener  = (AudioListener)FindObjectOfType(typeof(AudioListener));
            if (audioListener == null)
            {
                if (this._BeatTypePopup == 0 || this._BeatTypePopup == 1)
                {
                    if (this._BeatTypePopup == 0)
                    {
                        beatController = this._CreateBinauralBeatObject();
                    }
                    else
                    {
                        beatController = this._CreateMonauralBeatObject();
                    }
                }
            }
            else
            {
                if (this._BeatTypePopup == 0 || this._BeatTypePopup == 1)
                {
                    if (this._BeatTypePopup == 0)
                    {
                        bool attachFlag = EditorUtility.DisplayDialog(
                            "May I attach to existing GameObject ?",
                            "May I attach the object of Binaural Beats to the GameObject named " + audioListener.name + "? In the Hierarchy View, this GameObject is attached with AudioListener. Each scene can only have one Audio Listener.",
                            "OK",
                            "cancel"
                            );
                        if (attachFlag)
                        {
                            beatController = GameObject.Find(audioListener.name).AddComponent <BinauralBeatController>();
                        }
                    }
                    else
                    {
                        bool attachFlag = EditorUtility.DisplayDialog(
                            "May I attach to existing GameObject ?",
                            "May I attach the object of Monaural Beats to the GameObject named " + audioListener.name + "? In the Hierarchy View, this GameObject is attached with AudioListener. Each scene can only have one Audio Listener.",
                            "OK",
                            "cancel"
                            );
                        if (attachFlag)
                        {
                            beatController = GameObject.Find(audioListener.name).AddComponent <MonauralBeatController>();
                        }
                    }
                }
            }

            if (beatController != null)
            {
                beatController.LeftFrequency  = (float)this._LeftFrequencySlider;
                beatController.RightFrequency = (float)this._RightFrequencySlider;
                beatController.SampleRate     = (float)this._SampleRate;
                beatController.Gain           = this._Gain;

                EditorUtility.DisplayDialog(
                    "Info",
                    "Successful completion!!",
                    "OK"
                    );
            }
        }

        if (GUILayout.Button("Delete the object from the Hierarchy View."))
        {
            bool attachFlag = EditorUtility.DisplayDialog(
                "May I delete that?",
                "Is it really okay for me to delete this?",
                "OK",
                "cancel"
                );

            if (attachFlag)
            {
                this._DeleteBeatObject();
                EditorUtility.DisplayDialog(
                    "Info",
                    "Successful completion!!",
                    "OK"
                    );
            }
        }
    }
Exemple #21
0
 private void Start()
 {
     instance = this;
 }
 private void Start()
 {
     myBeatController = GetComponent <BeatController>();
 }
 // Start is called before the first frame update
 void Start()
 {
     BeatController.GetInstance().BeatSubject.AddObserver(this);
     // Debug.Log("Starting animation for " + gameObject.name);
 }
Exemple #24
0
    //private GameObject ScoreValue;

    void Awake()
    {
        beatController = GameObject.Find("BeatController").GetComponent <BeatController> ();
        //ScoreValue = GameObject.FindGameObjectWithTag("Score");
    }
 // Start is called before the first frame update
 void Start()
 {
     BeatController.GetInstance().BeatSubject.AddObserver(this);
 }
Exemple #26
0
 // Use this for initialization
 void Start()
 {
     beatController = beatObject.GetComponent <BeatController>();
     rectTransform  = GetComponent <RectTransform>();
     originialY     = transform.position.y;
 }
Exemple #27
0
 void Start()
 {
     beatController = GameObject.Find("BeatController").GetComponent <BeatController>();
 }
Exemple #28
0
 void Start()
 {
     beatController = FindObjectOfType <BeatController>();
 }
Exemple #29
0
 // Use this for initialization
 void Start()
 {
     beatController = beatObject.GetComponent <BeatController>();
     rectTransform  = this.GetComponent <RectTransform>();
 }
 // Use this for initialization
 void Start()
 {
     beatController = beatObject.GetComponent <BeatController>();
     animator       = GetComponent <Animator>();
     isActive       = false;
 }