Esempio n. 1
0
    public void PlantNewLily(LilyType type)
    {
        if (PhotonView.Find(thislilyViewId) != null)
        {
            return;
        }
        GameObject child;

        switch (type)
        {
        case LilyType.Gold:
            child = PhotonNetwork.Instantiate(goldLily.name, Vector3.zero, quaternion.identity, 0); // Satisfy compiler
            break;

        case LilyType.Blue:
            child = PhotonNetwork.Instantiate(blueLily.name, Vector3.zero, quaternion.identity, 0);
            break;

        case LilyType.Pink:
            child = PhotonNetwork.Instantiate(pinkLily.name, Vector3.zero, quaternion.identity, 0);
            break;

        case LilyType.White:
            child = PhotonNetwork.Instantiate(whiteLily.name, Vector3.zero, quaternion.identity, 0);
            break;

        default:
            child = PhotonNetwork.Instantiate(whiteLily.name, Vector3.zero, quaternion.identity, 0); // Satisfy compiler
            break;
        }

        child.GetComponent <BaseLily>().parentID = viewid;
        child.transform.SetParent(gameObject.transform);
        child.transform.localPosition = new Vector3(50, 50, 0);
        child.transform.localScale    = new Vector3(1, 1, 1);
        child.transform.localRotation = Quaternion.identity;
        ReorderComponent();

        thislily       = child;
        thislilyViewId = thislily.GetComponent <PhotonView>().viewID;

        //update score
        PlayerScore playerScore = GameObject.Find("CanvasGlobal").GetComponent <PlayerScore>();

        if (child.GetPhotonView().owner.IsMasterClient)
        {
            playerScore.AddMasterScore();
        }
        else
        {
            playerScore.AddClientScore();
        }
    }
Esempio n. 2
0
 public void OnLilyDeselect()
 {
     mSelectedLilyType = LilyType.None;
 }
Esempio n. 3
0
 public void OnLilySelect(LilyType newType)
 {
     mSelectedLilyType = newType;
 }