コード例 #1
0
    public override void parseSample(int sid)
    {
        MountsSample sample  = new MountsSample();
        string       dataStr = getSampleDataBySid(sid);

        sample.parse(sid, dataStr);
        samples.Add(sid, sample);
    }
コード例 #2
0
 public void init(NpcData data)
 {
     setPos(MissionInfoManager.Instance.mission.getPointInfoByIndex(data.mPointIndex));
     //相互关联
     this.data = data;
     data.ctrl = this;
     //mounts=MountsManagerment.Instance.getMountsBySid(data.mountsSid);
     if (data.mountsSid != 0)
     {
         mounts = MountsSampleManager.Instance.getMountsSampleBySid(data.mountsSid);
     }
     else
     {
         mounts = null;
     }
     initRoleAniCtrl(activeAnimCtrl, mounts, data.vipLevel);
     MissionNpcManagerment.Instance.nowObjCount += 1;
 }
コード例 #3
0
    /** 公共信息的更新 */
    private void updateComon(Mounts mounts)
    {
        name.text = temp.getExhangeItemName();
        if (mounts != null)
        {
            fight.text = mounts.getCombat().ToString();
        }
        MountsSample mountsSample = MountsSampleManager.Instance.getMountsSampleBySid(temp.exchangeSid);
        Mounts       activeMounts = MountsManagerment.Instance.getMountsBySid(temp.exchangeSid);

        if (mountsSample.isShowTime && activeMounts != null)
        {
            timeObject.SetActive(true);
        }
        else
        {
            timeObject.SetActive(false);
        }
        ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + mountsSample.imageID.ToString(), icon);
        iconBg.spriteName = QualityManagerment.qualityIDToIconSpriteName(mountsSample.qualityId);
    }
コード例 #4
0
    /// <summary>
    /// 初始化
    /// </summary>
    public virtual void initRoleAniCtrl(FuBenCardCtrl _animCtrl, MountsSample mountsSample, int vipLevel)
    {
        animCtrl       = _animCtrl;
        activeAnimCtrl = animCtrl;
        if (mountsSample != null)
        {
            ResourcesManager.Instance.LoadAssetBundleTexture("mounts/" + mountsSample.modelID, gameObject.transform, (obj) => {
                GameObject gameObj = obj as GameObject;
                if (mountsSample.modelID == "miluDeer")
                {
                    gameObj.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
                }
                else
                {
                    gameObj.transform.localScale = new Vector3(1, 1, 1);
                }
                mountsAnimCtrl = gameObj.transform.FindChild("body").gameObject.GetComponent <FuBenCardCtrl>();
                initMountsAniCtrl(mountsAnimCtrl);
            });
        }
        else
        {
            isCycling = false;
            setShadows();
        }
        string angelPath = AngelSampleManager.Instance.get3DObjPath(vipLevel);//这个函数没判断守护天使是否激活!!!!

        if (PlayerPrefs.GetString(PlayerPrefsComm.ANGEL_USER_NAME + UserManager.Instance.self.uid) != "ok")
        {
            angelPath = "";
        }
        if (angelPath != "")
        {
            ResourcesManager.Instance.LoadAssetBundleTexture(angelPath, gameObject.transform, (obj) => {
                GameObject gameObj = obj as GameObject;
                angelAnimCtrl      = gameObj.transform.FindChild("body").gameObject.GetComponent <FuBenCardCtrl>();
                initAngeAniCtrl(angelAnimCtrl);
            });
        }
    }
コード例 #5
0
        public int compare(object o1, object o2)
        {
            //排序 先显示激活的(骑乘,非骑乘(品质 品质一样用战斗力))
            if (o1 == null)
            {
                return(1);
            }
            if (o2 == null)
            {
                return(-1);
            }
            if (!(o1 is Exchange) || !(o2 is Exchange))
            {
                return(0);
            }
            Exchange       obj1  = (Exchange)o1;
            Exchange       obj2  = (Exchange)o2;
            ExchangeSample temp1 = obj1.getExchangeSample();
            ExchangeSample temp2 = obj2.getExchangeSample();
            MountsSample   ms1   = MountsSampleManager.Instance.getMountsSampleBySid(temp1.exchangeSid);
            MountsSample   ms2   = MountsSampleManager.Instance.getMountsSampleBySid(temp2.exchangeSid);

            if (ms1.sortIndex < ms2.sortIndex)
            {
                return(1);
            }
            MountsManagerment manager = MountsManagerment.Instance;
            Mounts            isHave1 = manager.getMountsBySid(temp1.exchangeSid);
            Mounts            isHave2 = manager.getMountsBySid(temp2.exchangeSid);

            if (isHave1 != null && isHave2 != null)
            {
                int quality1 = isHave1.getQualityId();
                int quality2 = isHave2.getQualityId();
                if (isHave1.isInUse())
                {
                    return(-1);
                }
                else if (isHave2.isInUse())
                {
                    return(1);
                }
                else
                {
                    if (quality1 == quality2)
                    {
                        int combat1 = isHave1.getMaxLevel();
                        int combat2 = isHave2.getMaxLevel();
                        if (combat1 > combat2)
                        {
                            return(-1);
                        }
                        if (combat1 < combat2)
                        {
                            return(1);
                        }
                        return(0);
                    }
                    else if (quality1 > quality2)
                    {
                        return(-1);
                    }
                    else
                    {
                        return(1);
                    }
                }
            }
            else if (isHave1 != null && isHave2 == null)
            {
                return(-1);
            }
            else if (isHave1 == null && isHave2 != null)
            {
                return(1);
            }
            else if (isHave1 == null && isHave2 == null)
            {
                ExchangeManagerment instanc = ExchangeManagerment.Instance;
                if (((instanc.isCheckPremises(temp1, 0) && instanc.isCheckConditions(temp1, 0)) || instanc.isCheckPremises(temp1, 1)) &&
                    (!(instanc.isCheckPremises(temp2, 0) && instanc.isCheckConditions(temp2, 0)) || !instanc.isCheckPremises(temp2, 1)))
                {
                    return(-1);
                }
                if (((instanc.isCheckPremises(temp2, 0) && instanc.isCheckConditions(temp2, 0)) || instanc.isCheckPremises(temp2, 1)) &&
                    (!(instanc.isCheckPremises(temp1, 0) && instanc.isCheckConditions(temp1, 0)) || !instanc.isCheckPremises(temp1, 1)))
                {
                    return(1);
                }
            }
            return(0);
        }