Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        //set the room name to the panel
        GameObject.Find("RoomName").GetComponent<Text>().text = PhotonNetwork.room.name;

        //show the start button if you are the master client in this room
        if (!PhotonNetwork.isMasterClient)
        {
            GameObject.Find("StartButton").transform.position = new Vector3(-300,
                GameObject.Find("StartButton").transform.position.y,
                GameObject.Find("StartButton").transform.position.z);

            GameObject.Find("ReadyButton").transform.position = new Vector3(0,
                GameObject.Find("ReadyButton").transform.position.y,
                GameObject.Find("ReadyButton").transform.position.z);
        }

        persistentObjFunc = GameObject.Find("PersistentObject").GetComponent<PersistentObjectFunction>();

        //if this room has played the game for at least one time do the following
        if (!persistentObjFunc.firstTimeMoveToGame)
        {
            //retrieve the data back
            resetPlayerStatus();
        }
    }
Exemplo n.º 2
0
	// Use this for initialization
	void Start () {
        GameObject[] persistentObjs = GameObject.FindGameObjectsWithTag("PersistentObject");
        Debug.Log("persistentObjs: " + persistentObjs.Length);
        for(int i = persistentObjs.Length - 1; i > 0; i--)
        {
            Destroy(persistentObjs[i]);
        }
        persistentObjs[0].GetComponent<PersistentObjectFunction>().clearValues();
        persistentObjFunc = persistentObjs[0].GetComponent<PersistentObjectFunction>();
    }
    public void ViewFunction(BugableObjectFunctionInfo info)
    {
        PersistentObjectFunction persistentObjectFunction = ds.GetPersistentObjectFunction(info.identifier);

        persistentObjectFunction.isViewed = true;

        ds.UpdateObjectFunction(persistentObjectFunction);
        info.isViewed = true;
        //Debug.Log("updateFunctionDelegates " + updateFunctionDelegates);
        UpdateFunctionDelegate();
    }
    // Use this for initialization
    void Start () {

        //audio (background music) part
        audioSource = this.GetComponent<AudioSource>();

        persistentObjFunc = GameObject.Find("PersistentObject").GetComponent<PersistentObjectFunction>();

        playerNames = persistentObjFunc.playerNames;

        Screen.orientation = ScreenOrientation.LandscapeLeft;

        //create the player character based on their selection in room
        createPlayerCharacter();
    }
    // Use this for initialization
    void Start()
    {
        //audio (background music) part
        audioSource = this.GetComponent<AudioSource>();

        //locate the persistentobj
        PersistentObj = GameObject.Find("PersistentObject").GetComponent<PersistentObjectFunction>();

        //create the player character based on their selection in room
        createPlayerCharacter();

        if (PhotonNetwork.isMasterClient && PersistentObj.AI_Enabled)
        {
            createAICharacter();
        }
    }
Exemplo n.º 6
0
    // Use this for initialization
    void Start () {
        //set the room name to the panel
        GameObject.Find("RoomName").GetComponent<Text>().text = PhotonNetwork.room.name;

        persistentObjFunc = GameObject.Find("PersistentObject").GetComponent<PersistentObjectFunction>();

        //if this room has played the game for at least one time do the following
        if (!persistentObjFunc.firstTimeMoveToGame)
        {
            //retrieve the data back
            restorePlayerStatus();
        }

        //move the GameSetting Panel outsite the screen if player is not the master client
        if (!PhotonNetwork.isMasterClient)
        {
            GameObject.Find("GameSettingPanel").GetComponent<RectTransform>().localPosition = new Vector3(-5000, 0, 0);
        }
    }
    void ReadDatabase(BugableObjectFunctionInfo info)
    {
        Debug.Log("read db " + info);
        PersistentObjectFunction persistentObjectFunction = ds.GetPersistentObjectFunction(info.identifier);

        if (persistentObjectFunction == null)
        {
            //Debug.Log("persistentObjectFunction == null " + info);
            persistentObjectFunction            = new PersistentObjectFunction();
            persistentObjectFunction.identifier = info.identifier;
            info.isViewed = false;
            ds.InsertObjectFunction(persistentObjectFunction);
        }
        else
        {
            //Debug.Log("persistentObjectFunction != null " + info);
            info.isViewed = persistentObjectFunction.isViewed;
        }
    }
    // Use this for initialization
    void Start () {
        persistentObjFunc = GameObject.Find("PersistentObject").GetComponent<PersistentObjectFunction>();
        string winnerName = persistentObjFunc.winnerName;

        GameObject.Find("WinnerName").GetComponent<Text>().text = winnerName;

        if (PhotonNetwork.isMasterClient)
        {
            GameObject.Find("BackButtonDescription").transform.position = new Vector3(-1000,
                GameObject.Find("BackButtonDescription").transform.position.y,
                GameObject.Find("BackButtonDescription").transform.position.z);
        }
        else
        {
            GameObject.Find("BackButton").transform.position = new Vector3(-1000,
                GameObject.Find("BackButton").transform.position.y,
                GameObject.Find("BackButton").transform.position.z);
        }
    }
Exemplo n.º 9
0
    void IncreasePlayerHealth(int viewID)
    {
        persistentObjFunc = GameObject.Find("PersistentObject").GetComponent<PersistentObjectFunction>();
        
        //check if the player still exists, and this code is run for once only
        if (GameObject.Find(persistentObjFunc.localPlayerName) != null && !playerHitHeartObj)
        {
            //use the photonview id for identification
            if (GameObject.Find(persistentObjFunc.localPlayerName).GetComponent<PhotonView>().viewID == viewID)
            {
                //if the player doesn't reach the max limit of the player's health
                if (GameObject.Find(persistentObjFunc.localPlayerName).GetComponent<PlayerHealth>().playerHealth < 5)
                {
                    GameObject.Find(persistentObjFunc.localPlayerName).GetComponent<PlayerHealth>().playerHealth++;
                    Debug.Log(GameObject.Find(persistentObjFunc.localPlayerName).GetComponent<PlayerHealth>().playerHealth + " " + viewID);
                }
            }
        }

        playerHitHeartObj = true;
    }
 // Use this for initialization
 void Start ()
 {
     persistentObjFunc = GameObject.Find("PersistentObject").GetComponent<PersistentObjectFunction>();
 }
    // Use this for initialization
    void Start () {
        //GetAbility();    
        persistentObjFunc = GameObject.Find("PersistentObject").GetComponent<PersistentObjectFunction>();
        localPlayerName = persistentObjFunc.localPlayerName;
        owner = persistentObjFunc.localPlayerName;
	}
Exemplo n.º 12
0
 public void UpdateObjectFunction(PersistentObjectFunction achieve)
 {
     _connection.Update(achieve);
 }
Exemplo n.º 13
0
 public void InsertObjectFunction(PersistentObjectFunction achieve)
 {
     _connection.Insert(achieve);
 }
Exemplo n.º 14
0
 // Use this for initialization
 void Start()
 {
     persistentObjFunc = GameObject.Find("PersistentObject").GetComponent<PersistentObjectFunction>();
     localPlayerName = persistentObjFunc.localPlayerName;
 }