public static string GetRelaIcon(int intimacyValue, byte state)
		{
			return IntimacyRelationViewUT.GetRelaIcon(intimacyValue, (COM_INTIMACY_STATE)state);
		}
Esempio n. 2
0
        public void ShowIntimacyNum(int value, CFriendModel.EIntimacyType type, bool bFreeze, COM_INTIMACY_STATE state)
        {
            GameObject gameObject = this.full.transform.parent.FindChild("rela").gameObject;
            bool       flag       = IntimacyRelationViewUT.IsRelaState(state);
            bool       flag2      = IntimacyRelationViewUT.IsRelaStateDeny(state);

            if (flag || flag2)
            {
                this.intimacyNum.gameObject.CustomSetActive(false);
                this.freeze.CustomSetActive(false);
                this.full.CustomSetActive(false);
                this.high.CustomSetActive(false);
                this.mid.CustomSetActive(false);
                this.low.CustomSetActive(false);
                gameObject.CustomSetActive(true);
                COM_INTIMACY_STATE cOM_INTIMACY_STATE = flag2 ? IntimacyRelationViewUT.GetStateByDenyState(state) : state;
                if (cOM_INTIMACY_STATE != COM_INTIMACY_STATE.COM_INTIMACY_STATE_NULL)
                {
                    string relaIcon = IntimacyRelationViewUT.GetRelaIcon(value, cOM_INTIMACY_STATE);
                    if (!string.IsNullOrEmpty(relaIcon))
                    {
                        Image componetInChild = Utility.GetComponetInChild <Image>(gameObject, "icon");
                        if (componetInChild != null)
                        {
                            componetInChild.gameObject.CustomSetActive(true);
                            componetInChild.SetSprite(relaIcon, this.formScript, true, false, false, false);
                        }
                    }
                    Text componetInChild2 = Utility.GetComponetInChild <Text>(gameObject, "txt");
                    if (componetInChild2 != null)
                    {
                        componetInChild2.gameObject.CustomSetActive(true);
                        componetInChild2.set_text(Singleton <CFriendContoller> .instance.model.GetPrefixString(value, state));
                    }
                }
            }
            else
            {
                gameObject.CustomSetActive(false);
                if (this.intimacyNum != null)
                {
                    this.intimacyNum.gameObject.CustomSetActive(true);
                    if ((long)value >= (long)((ulong)Singleton <CFriendContoller> .instance.model.GetIntimacyMaxValue()))
                    {
                        this.intimacyNum.set_text("Max");
                    }
                    else
                    {
                        this.intimacyNum.set_text(value.ToString());
                    }
                }
                if (bFreeze)
                {
                    this.freeze.CustomSetActive(true);
                    this.intimacyNum.set_color(CUIUtility.Intimacy_Freeze);
                }
                else
                {
                    this.freeze.CustomSetActive(false);
                    if (type == CFriendModel.EIntimacyType.Low)
                    {
                        this.full.CustomSetActive(false);
                        this.high.CustomSetActive(false);
                        this.mid.CustomSetActive(false);
                        this.low.CustomSetActive(true);
                        this.intimacyNum.set_color(CUIUtility.Intimacy_Low);
                    }
                    else if (type == CFriendModel.EIntimacyType.Middle)
                    {
                        this.full.CustomSetActive(false);
                        this.high.CustomSetActive(false);
                        this.mid.CustomSetActive(true);
                        this.low.CustomSetActive(false);
                        this.intimacyNum.set_color(CUIUtility.Intimacy_Mid);
                    }
                    else if (type == CFriendModel.EIntimacyType.High)
                    {
                        this.full.CustomSetActive(false);
                        this.high.CustomSetActive(true);
                        this.mid.CustomSetActive(false);
                        this.low.CustomSetActive(false);
                        this.intimacyNum.set_color(CUIUtility.Intimacy_High);
                    }
                    else if (type == CFriendModel.EIntimacyType.full)
                    {
                        this.full.CustomSetActive(true);
                        this.high.CustomSetActive(false);
                        this.mid.CustomSetActive(false);
                        this.low.CustomSetActive(false);
                        this.intimacyNum.set_color(CUIUtility.Intimacy_Full);
                    }
                }
            }
        }