예제 #1
0
 void Awake()
 {
     if (!instance)
     {
         instance = this;
     }
 }
        /// <summary>
        /// sets the controller
        /// </summary>
        /// <param name="ac"></param>
        public void SetAlarmController(AlarmController ac)
        {
            AlarmC = ac;
            AlarmC.ReadFromFile();

            snooze = AlarmC.SnoozeEvent;
            edit   = AlarmC.EditAlarm;
        }
예제 #3
0
    // Use this for initialization
    void Start()
    {
        HighScore = gameObject.GetComponentsInChildren<Text>()[0];
        CurrentScore = gameObject.GetComponentsInChildren<Text>()[1];

        playerInput = GameObject.FindGameObjectWithTag("Player").GetComponent<inputHandler>();

        highScoreValue = PlayerPrefs.GetInt(highScoreKey, 0);
    }
예제 #4
0
 /// <summary>
 /// Links the View to the controller.
 /// </summary>
 /// <param name="c">The App's main controller object. Later
 /// this shold be a delegate.</param>
 public void SetController(inputHandler c)
 {
     iHandler = c;
 }
예제 #5
0
 public LoginMP(inputHandler ih)
 {
     InitializeComponent();
     this.iHandler = ih;
 }
예제 #6
0
 void Init()
 {
     birdMoveScr    = bird.GetComponent <birdMovement>();
     spawnerScr     = spawner.GetComponent <SpawnerScript>();
     inputHandleScr = inputManager.GetComponent <inputHandler>();
 }
예제 #7
0
    // Use this for initialization
    void Start()
    {
        startingHeight = 10;
        ResetMenuPosition();

        playerInput = GameObject.FindGameObjectWithTag("Player").GetComponent<inputHandler>();

        scoreScript = GameObject.FindGameObjectWithTag("MainUI").GetComponent<ScoreUIScript>();
        tipsScript = gameObject.GetComponentInChildren<TipScript>();

        HighScore = gameObject.GetComponentsInChildren<Text>()[0];
        CurrentScore = gameObject.GetComponentsInChildren<Text>()[1];
    }
예제 #8
0
파일: gm.cs 프로젝트: meat4every1/Goo
    void Start()
    {
        cellQ     = new List <Vector2>(400);
        qDist     = new List <float>(400);
        cellSize  = .2f;
        hCellNum  = 25;
        vCellNum  = 25;
        origin    = new Vector3(-3, 3, 0);
        newPaint  = false;
        newPaint2 = false;
        maxTimer  = 60;
        Vector3 pos;
        //Quaternion angle = new Quaternion(0, 0, 0, 0);
        //Debug.Log(cellPrefab);



        GameObject backdrop = GameObject.CreatePrimitive(PrimitiveType.Cube);

        backdrop.transform.position   = origin + 2.5f * Vector3.right + 2.5f * Vector3.down;
        backdrop.transform.localScale = new Vector3(5, 5, .01f);
        backdrop.GetComponent <Renderer>().material       = new Material(Shader.Find("Sprites/Default"));
        backdrop.GetComponent <Renderer>().material.color = Color.white;

        backdrop.GetComponent <Renderer>().sortingLayerName = "Default";
        backdrop.GetComponent <Renderer>().sortingOrder     = 2;

        cells   = new GameObject[hCellNum, vCellNum];
        gotCell = new cell[hCellNum, vCellNum];
        for (int i = 0; i < hCellNum; i++)
        {
            for (int j = 0; j < vCellNum; j++)
            {
                pos = origin + Vector3.right * cellSize * i + Vector3.down * cellSize * j;
                //newCell = Instantiate(cellPrefab, pos, angle) as UnityEngine.Object;
                //Debug.Log(newCell.GetComponent<cell>());
                //GameObject c = GameObject.FindGameObjectWithTag("newCell");
                //Debug.Log(newCell.GetType());
                //cells[i][j] = newCell;
                newCell = GameObject.CreatePrimitive(PrimitiveType.Cube);
                newCell.transform.position   = pos;
                newCell.transform.localScale = new Vector3(cellSize, cellSize, cellSize);
                newCell.GetComponent <Renderer>().material = new Material(Shader.Find("Sprites/Default"));
                //Debug.Log(newCell.GetType());
                newCell.AddComponent <cell>();
                //newCell.AddComponent<Collider2D>();   CHECK THIS LATER

                //moving to nontrigger paradigm

                //newCell.GetComponent<BoxCollider>().isTrigger = true;
                newCell.tag = "cell";
                cells[i, j] = newCell;
            }
        }

        celLox = new Vector2[hCellNum, vCellNum];

        for (int i = 0; i < hCellNum; i++)
        {
            for (int j = 0; j < vCellNum; j++)
            {
                celLox[i, j]  = cells[i, j].transform.position;
                gotCell[i, j] = cells[i, j].GetComponent <cell>();
            }
        }

        //p1

        p1Brush = Instantiate(brushPrefab).GetComponent <brush>();
        //Debug.Log(p1Brush);
        p1Brush.playerNum = 1;
        p1Input           = Instantiate(inputHandlerPrefab).GetComponent <inputHandler>();
        var initPos = new Vector3(-3, -3, 0);

        p1bucket           = Instantiate(bucketPrefab, initPos, Quaternion.identity).GetComponent <bucket>();
        p1bucket.playerNum = 1;
        //p1oom = false;
        p1color         = Color.blue;
        p1Brush.myColor = Color.blue;

        //p2

        p2Brush = Instantiate(brushPrefab).GetComponent <brush>();
        //Debug.Log(p1Brush);
        p2Brush.playerNum  = 2;
        p2Input            = Instantiate(p2testInputPrefab).GetComponent <p2testInputHandler>();
        initPos            = new Vector3(3, -3, 0);
        p2bucket           = Instantiate(bucketPrefab, initPos, Quaternion.identity).GetComponent <bucket>();
        p2bucket.playerNum = 2;
        //p2oom = false;
        p2color         = Color.magenta;
        p2Brush.myColor = Color.magenta;



        frame1 = true;

        cellQ.Clear();
        qDist.Clear();

        //bfsSort=
    }