示例#1
0
 void ResourceChangeHandler(ResourceChangeEvent rc)
 {
     if (rc.PlayerID == PlayerID)
     {
         resources = rc.resource;
     }
 }
示例#2
0
 void _OnResourceStatusUpdated(ResourceChangeEvent e)
 {
     if (PlayerID == e.PlayerID)
     {
         resource = e.resource;
     }
 }
        public void CheckForChanges()
        {
            if (!this._isThereAnyUnhandledChange)
            {
                return;
            }
            this.CollectResources();
            ResourceChangeEvent onResourceChange = this.OnResourceChange;

            if (onResourceChange != null)
            {
                onResourceChange();
            }
            this._isThereAnyUnhandledChange = false;
        }
示例#4
0
        public static void EventHandler(string script)
        {
            var e = new ResourceChangeEvent(script);

            switch (script)
            {
            case RESOURCE_ADDED:
                ResourceAdded(e);
                break;

            case RESOURCE_REMOVED:
                ResourceRemoved(e);
                break;

            case RESOURCE_MODIFIED:
                ResourceModified(e);
                break;
            }
        }
示例#5
0
    void _OnResourceStatusUpdated(ResourceChangeEvent e)
    {
        // if (PlayerID == e.PlayerID)
        // {
        //     resource = e.resource;
        // }

        // if (free_bomb == 0) {
        //     cost = 1000;
        // } else {
        //     cost = 0;
        // }

        // if (resource >= cost) {
        //     panelImage.color = new Color(1.0f, 1.0f, 1.0f, 0.4f);
        //     bombImage.color = new Color(1.0f, 1.0f, 1.0f, 1.0f);
        //     progressImage.fillAmount = 1.0f;
        //     foreach (Text text in texts){
        //         text.color = new Color(text.color.r, text.color.g, text.color.b, 1.0f);
        //         if (text.name == "Cost") {
        //             text.text = cost.ToString();
        //             if (cost == 0) {
        //                 text.text = "Free";
        //             }
        //         }
        //     }
        // }
        // else {
        //     panelImage.color = new Color(1.0f, 1.0f, 1.0f, 0.2f);
        //     bombImage.color = new Color(1.0f, 1.0f, 1.0f, 0.4f);
        //     progressImage.fillAmount = (cost == 0) ? 1 : resource / cost;
        //     foreach (Text text in texts){
        //         text.color = new Color(text.color.r, text.color.g, text.color.b, 0.4f);
        //         if (text.name == "Cost") {
        //             text.text = cost.ToString();
        //         }
        //         if (cost == 0) {
        //             text.text = "Free";
        //         }
        //     }
        // }
    }
示例#6
0
 void ResChangeHandler(ResourceChangeEvent e)
 {
     resources[e.PlayerID] = e.resource;
 }