Exemple #1
0
 public int SendChat(string chatMsg, int friendId = 0, int playerId = 0, string token = "")
 {
     if (ParseToken(playerId, token))
     {
         ChatParam param = new ChatParam();
         param.player_id = apiPlayerId;
         param.token     = apiToken;
         param.chat_msg  = chatMsg;
         param.friend_id = friendId;
         string paramJson = JsonUtility.ToJson(param);
         API    api       = new API("sendchat.php", (friendId == 0 ? "RSendChatPublic" : "RSendChatPrivate"), paramJson, 1);
         param = null; paramJson = "";
         StartCoroutine(Congest.SendPOST(this, api));
         return(api.seed);
     }
     return(0);
 }
Exemple #2
0
 virtual public void Awake()
 {
     // Set Params
     musicController = GameObject.Find("MusicController");
     ChatParam.InitChat();
 }
Exemple #3
0
    private void ActionMenu(ActionCellParam actionCellParam)
    {
        // NPC
        if (actionCellParam.NPC != null &&
            actionCellParam.NPC.GetComponent <BaseNPC>() != null)
        {
            if (Vector3.Distance(actionCellParam.NPC.transform.position, gameObject.transform.position) > GameParams.actionDistance)
            {
                ChatParam.AddMSG("You too far");
                return;
            }
            switch (actionCellParam.actionName)
            {
            case "Loock":
                ChatParam.AddMSG("You loock at: " + actionCellParam.NPC.NPCParam.privateParams.name);
                break;

            case "Talk":
                // Cloase Prev Panel
                UIBuilder.ClosePanel("PanelNPCDialog");
                // Open New NPC Dialog Panel
                GameObject     NPCDialog      = UIBuilder.OpenPanel("PanelNPCDialog");
                PanelNPCDialog panelNPCDialog = NPCDialog.GetComponent <PanelNPCDialog>();
                panelNPCDialog.SetParam(actionCellParam.NPC.GetComponent <BaseNPC>());
                break;
            }
        }
        // Scene Object
        if (actionCellParam.sceneObject != null &&
            actionCellParam.sceneObject.GetComponent <BaseSceneObject>() != null)
        {
            if (Vector3.Distance(actionCellParam.sceneObject.transform.position, gameObject.transform.position) > GameParams.actionDistance)
            {
                ChatParam.AddMSG("You too far");
                return;
            }
            switch (actionCellParam.actionName)
            {
            case "Loock":
                ChatParam.AddMSG("Description: " + actionCellParam.sceneObject.description);
                break;

            case "Hurvest":

                break;

            case "GetStick":

                break;

            case "CutTree":

                break;

            case "Open":
                // Close Pld Panel
                UIBuilder.ClosePanel("PanelBoxInventory");
                // Open Box Inventory Panel
                GameObject panelBoxInventory = UIBuilder.OpenPanel("PanelBoxInventory");
                panelBoxInventory.GetComponent <PanelBoxInventory>().UpdatePanel(actionCellParam.sceneObject);
                break;
            }
        }
        UIBuilder.ClosePanel("PanelActionMenu");
        UIBuilder.UpdateAllPanels();
    }