示例#1
0
 private void Awake() //получене ссылок на компоненты
 {
     rigidbody  = GetComponent <Rigidbody2D>();
     animator   = GetComponent <Animator>();
     sprite     = GetComponentInChildren <SpriteRenderer>();
     controller = GetComponent <BlocksController>();
 }
示例#2
0
        protected void Init()
        {
            Field.Width  = 40;
            Field.Height = 30;

            Console.CursorVisible = false;

            _blockController = new BlocksController();
        }
示例#3
0
    private void Start()
    {
        gameTime = new Stopwatch();

        blocksController = FindObjectOfType <BlocksController>();
        canvasAnimator   = gameCanvas.GetComponent <Animator>();
        gameState        = GameState.Menu;
        music.volume     = PlayerPrefs.GetFloat(GameConstants.MusicVolume, 1);
        PlayerPrefs.GetFloat(GameConstants.SFXVolume, 0.8f);
    }
示例#4
0
    private void Start()
    {
        gameController   = FindObjectOfType <GameController>();
        blocksController = FindObjectOfType <BlocksController>();
        paddle           = FindObjectOfType <Paddle>();
        rigidBody        = GetComponent <Rigidbody2D>();
        spriteRenderer   = GetComponent <SpriteRenderer>();

        paddleToBallVector = transform.position - paddle.transform.position;
        boostCharge        = 1f;
        additionalSpeed    = -1;

        StartCoroutine(BoostRecharge());
        StartCoroutine(MagnetRecharge());
    }
示例#5
0
    public void Awake()
    {
        //crate singleton
        if (instance == null)
        {
            instance = this;
        }

        //set blockController from current object
        blocksController = this.gameObject.GetComponent <BlocksController>();

        CheckValues();


        //set word point screen corners
        SetScreenCornersToWord();

        //set start saved material
        SetMaterialToBall();
    }
示例#6
0
 private void Awake()
 {
     Instance = this;
 }
 void Start()
 {
     bc = GameObject.Find ("Blocks").GetComponent<BlocksController>();
     harvest = GameObject.Find ("Harvest").GetComponent<Harvest>();
     guiOn = false;
     int width = 700, height = 80;
     savings = int.Parse(GameObject.FindGameObjectWithTag("Savings").GetComponent<Text>().text);
     windowRect = new Rect((Screen.width-width)/2,(Screen.height-height)/2,width,height);
     flag = -1;
 }
示例#8
0
 void Start()
 {
     counter = 1;
     bc = GameObject.Find ("Blocks").GetComponent<BlocksController>();
     paused = false;
     fixedExpenditures=1000;
     Init ();
     livingExpenseText = new string[]{
     "Living expenses stayed close to the average expenses this year.",
     "There was a high inflation rate this year, and living expenses increased by Rs. 1200.",
     "Due to ill health of a family member, you had to pay Rs. 2000 for treatment.",
     "Due to ill health of a family member, you had to pay Rs. 3000 for treatment."};
 }
示例#9
0
 void Awake()
 {
     _gameOver      = GetComponent <GameOver>();
     _textControll  = GetComponent <TextController>();
     _blockControll = GetComponent <BlocksController>();
 }