Ejemplo n.º 1
0
 private void Start()
 {
     mg     = FindObjectOfType <MapGenerater>();
     cursor = Instantiate(cursorPrefab) as Cursor;
     cursor.gameObject.SetActive(false);
     GlobalEventContainer.onGameEnded += OnGameEnded;
 }
Ejemplo n.º 2
0
        public static POSITION ConvertWorldCoordToMapCoord(Vector3 worldCoord, MapGenerater mg)
        {
            POSITION result;

            result.x = Mathf.CeilToInt((worldCoord.x - mg.MapStartPosition.x) / mg.CellSize.x);
            result.y = Mathf.CeilToInt((worldCoord.y - mg.MapStartPosition.y) / mg.CellSize.y);
            return(result);
        }
Ejemplo n.º 3
0
        private void Start()
        {
            mg = FindObjectOfType <MapGenerater>();
            im = FindObjectOfType <InputManager>();
            ScoreBoard.RemainMovePoint = 3;
            ScoreBoard.Score           = 0;
            StartCoroutine(UpdateGame());

            JAdmob.Init();
        }
Ejemplo n.º 4
0
        public static Vector3 ConvertMapCoordToWorldCoord(POSITION mapCoord, MapGenerater mg)
        {
            Vector3 result;

            result.x = mg.MapStartPosition.x + mapCoord.x * mg.CellSize.x;
            result.y = mg.MapStartPosition.y + mapCoord.y * mg.CellSize.y;
            result.z = 0f;

            return(result);
        }
Ejemplo n.º 5
0
        public IEnumerator Start()
        {
            yield return(null);

            yield return(null);

            MapGenerater mg = FindObjectOfType <MapGenerater>();

            img = GetComponent <Image>();

            var canvas = FindObjectOfType <Canvas>();

            this.transform.parent = canvas.transform;

            img.rectTransform.sizeDelta = new Vector2(mg.CellSize.x, mg.CellSize.y);
            transform.SetAsLastSibling();
        }