Example #1
0
 // Start is called before the first frame update
 void Start()
 {
     //alterLand.onClick.AddListener(AlterLand);
     //m_player = GameObject.FindWithTag("Player").GetComponent<PlayerComponent>();
     m_collider    = GetComponent <BoxCollider2D>();
     m_Size        = m_collider.bounds.size.x;
     m_gameManager = GameObject.FindWithTag("WorldManager").GetComponent <GameManagerForNetwork>();
 }
Example #2
0
    private void Awake()
    {
        if (!PhotonNetwork.IsConnected)
        {
            SceneManager.LoadScene("Menu");
            return;
        }


        // Singleton
        if (instance != null && instance != this)
        {
            Destroy(gameObject);
        }
        else
        {
            instance = this;
        }
        DontDestroyOnLoad(gameObject);
    }