// Use this for initialization
 void Start()
 {
     gameStateManager = GameObject.Find("GameStateManager");
     gameStateScript = gameStateManager.GetComponent<GameStateScript>();
     MainCamera = GameObject.Find("Main Camera");
     BackgroundController = MainCamera.GetComponent<BackgroundController>();
 }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        id_dd.ClearOptions();
        for (int i = 0; i < PD::Parameter.FISH; i++)
        {
            id_dd.options.Add(new Dropdown.OptionData("ID : " + (i + 1)));
        }
        type_dd.ClearOptions();
        foreach (string name in Enum.GetNames(typeof(DataType)))
        {
            type_dd.options.Add(new Dropdown.OptionData(name));
        }

        bc            = bg.GetComponent <BackgroundController> ();
        toggle.isOn   = bc.active;
        id_dd.value   = 1; id_dd.value = bc.id;
        type_dd.value = 1; type_dd.value = (int)bc.type;
        slider.value  = bc.threshold;

        db = DataBase.Instance;
        slider.minValue = db.GetMin(bc.type);
        slider.maxValue = db.GetMax(bc.type);
        min_text.text   = db.GetMin(bc.type) + "";
        max_text.text   = db.GetMax(bc.type) + "";
        thre_text.text  = "Threshold : " + (float)((int)(slider.value * 100) / 100f);

        Deactivate();
    }
Beispiel #3
0
        private void SetBackgroundTheme()
        {
            var listOfElements = new List <FrameworkElement>();

            listOfElements.Add(BacklogItemGrid);
            BackgroundController.SetBackgroundTheme(listOfElements);
        }
    public Renderer waterTexture, cloudsTexture; //ref to the renderer

    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
    }
    void Start()
    {
#if !(UNITY_IOS || UNITY_ANDROID)
        postBestsBtn.SetActive(false);
#endif

        bgCtrl  = GetComponent <BackgroundController>();
        tbCtrl  = GetComponent <TableController>();
        camCtrl = GetComponent <CameraController>();

        music      = GetComponent <AudioSource> ();
        music.loop = true;

        persistorObj         = GameObject.Find("Persistor");
        audioCtrl            = persistorObj.GetComponent <AudioController>();
        AudioListener.volume = audioCtrl.CurrVolume;

        adCtrl     = GameObject.Find("Persistor").GetComponent <AdController>();
        adLaunched = false;

        // Make sure to incorporate SCALE!!!
        player      = playerObj.GetComponent <Player>();
        prevFlipAcc = Player.FlipAccuracy.none;

        highFlips        = 0;
        highScore        = 0;
        highComboOverall = 0;

        bgCtrl.OnLoad();
        tbCtrl.OnLoad();

        Reset();
    }
Beispiel #6
0
    private float my_generate_y;        // 生成的y的位置
    public override void Start()
    {
        base.Start();
        p_script = get_parent_script();
        if (p_script == null)
        {
            Debug.LogError("We cannot find p_script in it " + gameObject.name);
        }
        parentTransform = p_script.transform;
        var ymin = p_script.ymin;

        if (Mathf.Abs(ymin - transform.position.y) < 0.1f)
        {
            oc_direct     = new Vector2(0, -2.8f);
            my_generate_y = -2.8f;
        }
        else
        {
            oc_direct     = new Vector2(0, -0.2f);
            my_generate_y = -0.2f;
        }

        bound  = GetComponent <BoxCollider2D>().bounds;
        width  = bound.size.x * transform.localScale.x;
        height = bound.size.y * transform.localScale.y;
        rd     = new System.Random();
    }
Beispiel #7
0
 void SpawnLine()
 {
     enemyLine.preconfs = preconfsQueue.Peek();
     line = Instantiate(enemyLine.gameObject, transform.position, Quaternion.identity) as GameObject;
     line.transform.parent = this.transform;
     if (idx < 6)
     {
         if (++currentLine == limits [idx])
         {
             currentLine = 0;
             idx++;
             if (idx < 6)
             {
                 preconfsQueue.Dequeue();
                 BackgroundController backgroundController = GameObject.Find("BackgroundController").
                                                             GetComponent <BackgroundController>();
                 backgroundController.ActivateEndless();
             }
         }
     }
     else if (idx == 6 && spawnInterval > 0.01f)
     {
         if (spawnInterval != 0.01f)
         {
             spawnInterval -= 0.005f;
         }
         CancelInvoke("SpawnLine");
         Invoke("SpawnLine", spawnInterval);
         Invoke("SpawnEnemy", maxSpawnRateInSeconds);
     }
 }
Beispiel #8
0
    void OnMouseUp()
    {
        snapPiece();

        if (snapped)
        {
            // play snapped audio
            mainAudioSource.clip = Resources.Load("Audio/SnapPiece") as AudioClip;
            mainAudioSource.Play();
        }
        else
        {
            // play put down audio
            mainAudioSource.clip = Resources.Load("Audio/PutDownPiece") as AudioClip;
            mainAudioSource.Play();
        }

        GameObject           background           = GameObject.FindGameObjectWithTag("BackgroundEffect");
        BackgroundController backgroundController = background.GetComponent <BackgroundController>();

        backgroundController.setColor(Color.white);

        //Destroy rotation icon
        Destroy(displayedRotationIconTop);
        Destroy(displayedRotationIconBottom);

        boardWrapper.updateErrors();
    }
Beispiel #9
0
 void OnLevelWasLoaded(int level)
 {
     if (level == Constants.LEVEL_LOCATION) {
         mBackgroundController = GameObject.Find("cnvBackground").GetComponent<BackgroundController>();
         setLocation();
     }
 }
Beispiel #10
0
        private void SetBackgroundTheme()
        {
            var listOfElements = new List <FrameworkElement>();

            listOfElements.Add(OptionDockPanel);
            BackgroundController.SetBackgroundTheme(listOfElements);
        }
Beispiel #11
0
 void Awake()
 {
     uiController         = GameObject.Find("UI Root").GetComponent <UIController>();
     colors               = GameObject.Find("Colors");
     enemyGenerator       = GameObject.Find("EnemyGenerator").GetComponent <EnemyGenerator>();
     backgroundController = GameObject.Find("Background").GetComponent <BackgroundController>();
 }
Beispiel #12
0
    //The background object is shifted behind the sibling and the sprite is changed
    public void Reposition()
    {
        BackgroundController controller = FindObjectOfType <BackgroundController>();

        this.transform.position += Vector3.right * offset * 2;
        GetComponent <SpriteRenderer>().sprite = backgroundSprites[Random.Range(0, backgroundSprites.Length)];
    }
Beispiel #13
0
    private void Awake()
    {
        DataController       _dataController       = gameObject.AddComponent <DataController>() as DataController;
        BackgroundController _backgroundController = gameObject.AddComponent <BackgroundController>() as BackgroundController;

        this.initEvents();
    }
 void Awake()
 {
     parallaxSpawnTimer.SetTimer(Random.Range(minimumTime, maximumTimer));
     instance = this;
     controllerTransform.position     = Camera.main.ScreenToWorldPoint(controllerPosition.position);
     controllerTransform.position     = new Vector3(controllerTransform.position.x, controllerTransform.position.y, 0);
     centerChecker.transform.position = Camera.main.ScreenToWorldPoint(Interface.interfaceSt.center.transform.position);
 }
Beispiel #15
0
        private void SetBackgroundTheme()
        {
            var listOfElements = new List <FrameworkElement>();

            listOfElements.Add(GridHello);
            listOfElements.Add(HelloTextBlock);
            BackgroundController.SetBackgroundTheme(listOfElements);
        }
        public Frm_Wall()
        {
            InitializeComponent();
            weather    = new WeatherApi();
            background = new BackgroundController();

            // Start with the right weather
            background.DefineBackgroundWeather(weather);
            tmr_atualizador.Enabled = true;
        }
Beispiel #17
0
 // Use this for initialization
 void Start()
 {
     musicCon       = GameObject.FindGameObjectWithTag("MusicController").GetComponent <MusicController> ();
     player         = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController> ();
     level          = GameObject.FindGameObjectWithTag("LevelParent").GetComponent <LevelSegment> ();
     noteParent     = GameObject.FindGameObjectWithTag("NoteParent");
     parallax       = GameObject.FindGameObjectWithTag("Parallax").GetComponent <BackgroundController> ();
     resettingLevel = false;
     musicCon.startMusic();
 }
    public void RespawnBG(BackgroundController bg)
    {
        if (bg != currentBG)
        {
            return;
        }
        BackgroundController other = (bg == bg1) ? bg2 : bg1;

        bg.transform.position = new Vector3(other.transform.position.x, other.transform.position.y, other.transform.position.z + backgoundDislpace);
        currentBG             = other;
    }
Beispiel #19
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(this.gameObject);
     }
 }
 void Awake()
 {
     if (_instance == null)
     {
         GameObject.DontDestroyOnLoad(gameObject);
         _instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
 /// <summary>
 /// Singleton for smooth ui when game is restart.
 /// </summary>
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Beispiel #22
0
    void Start()
    {
        _audio = GetComponent <AudioSource>();
        _anim  = GetComponent <Animator>();

        _allRenderers = GetComponentsInChildren <SpriteRenderer>();

        _allRenderers[0].sprite = sprites[Random.Range(0, sprites.Length)];

        _background   = GameObject.FindObjectOfType <BackgroundController>();
        nextShootSide = -1;
    }
Beispiel #23
0
    public IController updateController(IControllerValue c)
    {
        pManager  = (PipeController)gameObject.GetComponent <PipeController>().updateController(((GameControllerValue)c).pControllerValues);
        bgManager = (BackgroundController)gameObject.GetComponent <BackgroundController>();

        this.main    = ((GameControllerValue)c).main;
        this.UIview  = ((GameControllerValue)c).view;
        this.weights = ((GameControllerValue)c).weights;

        this.runAi          = ((GameControllerValue)c).aiActive;
        this.scoreIncrement = ((GameControllerValue)c).scoreIncrement;
        return(this);
    }
Beispiel #24
0
    // Start is called before the first frame update
    void Start()
    {
        Instance          = this;
        bc                = new BackgroundController(background, Resources.LoadAll <Sprite>("Textures/bg"));
        menuButtonSprites = Resources.LoadAll <Sprite>("Textures/MenuSprites");
        menuButtons       = buttonHolder.GetComponentsInChildren <Image>();

        for (int i = 0; i < menuButtons.Length; i++)
        {
            menuButtons[i].color = Color.blue;
        }
        menuButtons[0].color = Color.magenta;
    }
    // Use this for initialization
    void Start()
    {
        isRunning = false;

        menu        = GameObject.Find("Canvas/StartMenu").GetComponent <MenuView>();
        scorePanel  = GameObject.Find("Canvas/ScorePanel").GetComponent <ScoreView>();
        gameSummary = GameObject.Find("Canvas/GameSummary").GetComponent <GameSummaryView>();

        bird                 = Camera.main.transform.Find("Bird").GetComponent <BirdController>();
        obstacleManager      = GameObject.Find("ObstacleManager").GetComponent <ObstacleManager>();
        backgroundController = GameObject.Find("Background").GetComponent <BackgroundController>();

        menu.Activate();
    }
 // Use this for initialization
 void Start()
 {
     gameStateManager = GameObject.Find("GameStateManager");
     gameStateScript = gameStateManager.GetComponent<GameStateScript>();
     MainCamera = GameObject.Find("Main Camera");
     BackgroundController = MainCamera.GetComponent<BackgroundController>();
     MainGUI = MainCamera.GetComponent<MainGUI>();
     JumpSoundObject = GameObject.Find("JumpSoundDumpster");
     jumpSoundScript = JumpSoundObject.GetComponent<JumpSoundScript>();
     PlayerLose = PlayerStart - 2;
     Lost = false;
     gameStateScript.Lost = false;
     gameStateScript.Won = false;
     gameStateScript.GameOver = false;
 }
    private void Start()
    {
        characterList.Clear();
        characterPosition.Clear();

        backgroundController = background.GetComponent <BackgroundController>();

        characterList = GameController.charactersObjectList;

        totalCharacterPosition = Vector2.zero;

        for (int i = 0; i < characterList.Count; i++)
        {
            characterPosition.Add(characterList[i].gameObject.transform.position);
        }
    }
Beispiel #28
0
    void Start()
    {
        rigidbody    = GetComponent <Rigidbody2D>();
        entity       = GetComponent <Entity>();
        pathfinding  = GetComponent <Pathfinding>();
        feetAnimator = feet.GetComponent <Animator>();
        gameManager  = GameObject.Find("Game Manager").GetComponent <GameManager>();
        bgController = GameObject.Find("Background").GetComponent <BackgroundController>();

        rigidbody.mass = Random.Range(75, 125);

        audioManager = GameObject.Find("Audio Manager").GetComponent <AudioManager>();

        entity.deathEvent  += OnEntityDeath;
        entity.damageEvent += OnEntityDamage;
    }
    void changeBackgroundSpeed()
    {
        BackgroundController backg = Background.GetComponent <BackgroundController>();

        if ((backSmallFire.GetComponent <Renderer>()).enabled)
        {
            backg.speed = backgroundSlowSpeed;
        }
        if ((backMiddleFire.GetComponent <Renderer>()).enabled)
        {
            backg.speed = backgroundStandartSpeed;
        }
        if ((backBigFire.GetComponent <Renderer>()).enabled)
        {
            backg.speed = backgroundFastSpeed;
        }
    }
    void Awake()
    {
        if (instance)
        {
            DestroyImmediate(gameObject);
            return;
        }
        instance = this;

        levelGenerator       = FindObjectOfType <LevelGenerator>();
        uiController         = FindObjectOfType <UIController>();
        backgroundController = FindObjectOfType <BackgroundController>();
        ball = FindObjectOfType <Ball>();

        LoadProgress();
        LoadLevel();
    }
Beispiel #31
0
    // Start is called before the first frame update
    public void Start()
    {
        nextY = FirstPlatform.y;
        _BackgroundController = GameObject.FindObjectOfType <BackgroundController>();

        // getting size of the screen in in-game units
        ScreenDims = new Vector2(CameraExtensions.OrthographicBounds(Camera.main).size.x,
                                 CameraExtensions.OrthographicBounds(Camera.main).size.y);

        HalfDims = ScreenDims / 2;


        // initial platform
        Instantiate(PlatformPrefab, FirstPlatform, Quaternion.identity);

        // generate rows of platforms
        GenerateRows(5);
    }
Beispiel #32
0
    public static void LayerChange(HumanController human, BackgroundController bkg_layer)
    {
        var to_script = bkg_layer;

        human.gameObject.layer = to_script.gameObject.layer;
        var script = human;

        /*
         *  need to change layer.
         */
        // change the child and change camera
//		if (CameraScript.Instance.watched_player == script.transform) {
//			CameraScript.Instance.relayer_child_camera ();
//			Debug.Log ("Camera Layer num: " + CameraScript.Instance.gameObject.layer);
//		}

        float resizeRate = 0.6f;

        if (to_script.gameObject.name.Contains("First"))
        {
            script.transform.localScale = new Vector3(0.007142857f, 0.025f, 5.0f) * resizeRate;
        }
        else if (to_script.gameObject.name.Contains("Second"))
        {
            script.transform.localScale = new Vector3(0.00625f, 0.03333334f, 5.0f) * resizeRate;
        }
        else if (to_script.gameObject.name.Contains("Stair"))
        {
            if (to_script.gameObject.name.Contains("Mid"))
            {
                script.transform.localScale = new Vector3(0.02f, 0.3f, 5f) * resizeRate;
            }
            else
            {
                script.transform.localScale = new Vector3(0.02f, 0.3f, 5f) * resizeRate;
            }
        }


        script.gameObject.layer = to_script.gameObject.layer;
//		script.transform.rotation = rotate;
        HelperScript.change_z(script);
    }
Beispiel #33
0
    public void Awake()
    {
        //loveInterests = new List<LoveInterest>(GameObject.FindObjectsOfType<LoveInterest>());
        mansion = GameObject.FindObjectOfType <Mansion>();

        sfxManager           = GameObject.FindObjectOfType <SFXManager>();
        bgmManager           = GameObject.FindObjectOfType <BGMManager>();
        dialogControls       = GameObject.FindObjectOfType <DialogController>();
        mapControls          = GameObject.FindObjectOfType <MapController>();
        diaryControls        = GameObject.FindObjectOfType <DiaryController> ();
        timeUI               = GameObject.FindObjectOfType <TimeUI>();
        backgroundControls   = GameObject.FindObjectOfType <BackgroundController>();
        foregroundControls   = GameObject.FindObjectOfType <ForegroundController>();
        loveInterestControls = GameObject.FindObjectOfType <LoveInterestSelectController>();
        screenFader          = GameObject.FindObjectOfType <ScreenFader>();
        dayControls          = GameObject.FindObjectOfType <DayManager>();

        instance = this;
    }
Beispiel #34
0
    void Start()
    {
        if( backgroundQuadPrefab )
        {
            GameObject go = Instantiate( backgroundQuadPrefab ) as GameObject;
            backgroundQuadController = go.GetComponent<BackgroundController>();
        }

        textStyle = FontAgent.GetTextStyle();
        textRect = new Rect( 0f, 0f, Screen.width, Screen.height );

        StartCoroutine( "ResolveGestures" );

        GetNextGoal();
    }
 void Awake()
 {
     script = this;
 }
Beispiel #36
0
        public void initialize()
        {
            // Initialize graphics device service
            _graphicsDeviceService = GraphicsDeviceService.AddRef(view.Handle, view.Width, view.Height);

            // Initialize core resource controller
            ResourceManager.initialize(_graphicsDeviceService.GraphicsDevice);
            ResourceManager.rootDirectory = resourcesSourcePath + "\\";

            // Create controllers
            _levelController = new LevelController(this, _editorView.levelView);
            _materialController = new MaterialController(this, _editorView.materialView);
            _blueprintController = new BlueprintController(this, _editorView.blueprintView);
            _circuitController = new CircuitController(this, _editorView.circuitsView);
            _backgroundController = new BackgroundController(this, _editorView.backgroundView);
        }