コード例 #1
0
        void Awake()
        {
            // #Important
            // used in GameManager.cs: we keep track of the localPlayer instance to prevent instantiation when levels are synchronized
            if (photonView.IsMine)
            {
                PlayerManager.LocalPlayerInstance = this.gameObject;
            }
            // #Critical
            // we flag as don't destroy on load so that instance survives level synchronization, thus giving a seamless experience when levels load.
            DontDestroyOnLoad(this.gameObject);

            environment = GameObject.Find("Environment");

            boundaries _boundaries = environment.GetComponent <boundaries>();

            if (_boundaries != null)
            {
                if (photonView.IsMine)
                {
                    _boundaries.SetBoundaries();
                }
            }
            else
            {
                Debug.LogError("<Color=Red><a>Missing</a></Color> boundaries Component on Environment.", this);
            }
        }
コード例 #2
0
ファイル: geoTile.cs プロジェクト: Kartessian/MVC
        public geoTile(int x, int y, int zoom)
        {
            this.X = x;
            this.Y = y;
            this.zoom = zoom;
            this.mapSize = 256 << zoom;
            this.tileSize = Convert.ToInt32(mapSize / Math.Pow(2, zoom));
            this.topLeft = new Point(x * tileSize, y * tileSize);
            this.bottomRight = new Point(x * tileSize + tileSize, y * tileSize + tileSize);

            bounds = getBounds(0);
        }