Beispiel #1
0
    public void setTxtMood(unitBase unit)
    {
        string s = "";

        if (unit.type == 4)
        {
            int moodLevel = unit.iGet(UIA.moodLevel);
            switch (moodLevel)
            {
            case 1:
            {
                s = "<color=red>" + "崩溃" + "</color>";
                break;
            }

            case 2:
            {
                s = "<color=#FF9912ff>" + "难受" + "</color>";
                break;
            }

            case 3:
            {
                s = "<color=#87ceebff>" + "一般" + "</color>";
                break;
            }

            case 4:
            {
                s = "<color=#00ffffff>" + "满足" + "</color>";
                break;
            }

            case 5:
            {
                s = "<color=green>" + "幸福" + "</color>";
                break;
            }
            }
        }
        txtMood.text = s;
    }
Beispiel #2
0
 public bool deleteCheck()
 {
     if (conditionData.Instance.get(id).deleteMethod > 0 || conditionData.Instance.get(id).deleteTime >= 0)
     {
         if (conditionData.Instance.get(id).deleteMethod == 1)
         {
             //Debug.Log("检测1 : "+ conditionData.Instance.get(id).deleteAttr +" = "+ unit.iGet(conditionData.Instance.get(id).deleteAttr) + " : "+ conditionData.Instance.get(id).deleteValue);
             if (unit.iGet(conditionData.Instance.get(id).deleteAttr) >= conditionData.Instance.get(id).deleteValue)
             {
                 if (conditionData.Instance.get(id).deleteTime >= 0)
                 {
                     if (deleteTick > 0)
                     {
                         if (GTime.Instance.GTick - deleteTick >= conditionData.Instance.get(id).deleteTime)
                         {
                             return(true);
                         }
                         else
                         {
                             return(false);
                         }
                     }
                     else
                     {
                         deleteTick = GTime.Instance.GTick;
                         return(false);
                     }
                 }
                 else
                 {
                     return(true);
                 }
             }
             else
             {
                 if (deleteTick > 0)
                 {
                     deleteTick = GTime.Instance.GTick;
                     return(false);
                 }
             }
         }
         else if (conditionData.Instance.get(id).deleteMethod == 2)
         {
             if (unit.iGet(conditionData.Instance.get(id).deleteAttr) <= conditionData.Instance.get(id).deleteValue)
             {
                 if (conditionData.Instance.get(id).deleteTime >= 0)
                 {
                     if (deleteTick > 0)
                     {
                         if (GTime.Instance.GTick - deleteTick >= conditionData.Instance.get(id).deleteTime)
                         {
                             return(true);
                         }
                         else
                         {
                             return(false);
                         }
                     }
                     else
                     {
                         deleteTick = GTime.Instance.GTick;
                         return(false);
                     }
                 }
                 else
                 {
                     return(true);
                 }
             }
             else
             {
                 if (deleteTick > 0)
                 {
                     deleteTick = GTime.Instance.GTick;
                     return(false);
                 }
             }
         }
         else
         {
             if (GTime.Instance.GTick - deleteTick >= conditionData.Instance.get(id).deleteTime)
             {
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
     }
     return(false);
 }