Esempio n. 1
0
 protected override void Init()
 {
     typeID = ObjectType.Mount;
     base.Init();
     this.id = actorInfo.ConfigID;
     if (animFSM != null)
     {
         InitAnimation();
         if (actorInfo.IsMoving)
         {
             animFSM.Move();
         }
         else
         {
             animFSM.StopMoving();
         }
     }
     rendererCtrl = base.rendererCtrl as MountRendererCtrl;
     if (rendererCtrl != null)
     {
         rendererCtrl.Show(actorInfo.IsRiding, true);
         rendererCtrl.Init(actorInfo);
     }
     OnEffectChangeEvent(0);
     inited_ = true;
 }
Esempio n. 2
0
    IEnumerator CreateAsync(System.Action <PreviewEquipment> _callback)
    {
        if (isDummy_ == false)
        {
            GameSys.LogError("You can only start create Equipment in dummy: " + actorInfo.InstanceID);
            yield break;
        }

        //
        PreviewEquipment  item           = null;
        MountRendererCtrl myRendererCtrl = null;
        bool failed = false;

        pendingDownload = Create(actorInfo, delegate(PreviewEquipment _eq, EResult _result)
        {
            if (_result != EResult.Success)
            {
                failed = true;
                return;
            }
            item            = _eq;
            pendingDownload = null;
            myRendererCtrl  = item.gameObject.GetComponentInChildrenFast <MountRendererCtrl>();
            if (myRendererCtrl != null)
            {
                myRendererCtrl.Show(true, true);
            }
        });
        if (mutualExclusion)
        {
            GameCenter.previewManager.PushDownLoadTask(pendingDownload);
        }
        while (item == null || item.inited == false)
        {
            if (failed)
            {
                yield break;
            }
            yield return(null);
        }
        if (mutualExclusion)
        {
            GameCenter.previewManager.EndDownLoadTask(pendingDownload);
        }
        pendingDownload = null;

        item.isDownloading_ = false;
        if (_callback != null)
        {
            _callback(item);
        }
    }
Esempio n. 3
0
    IEnumerator CreateAsync(System.Action <Mount, EResult> _callback)
    {
        if (isDummy_ == false)
        {
            GameSys.LogError("You can only start create Mob in dummy: " + actorInfo.ConfigID);
            yield break;
        }

        //
        Mount             mount          = null;
        MountRendererCtrl myRendererCtrl = null;
        bool failed = false;

        pendingDownload = Create(actorInfo, delegate(Mount _mount, EResult _result)
        {
            if (_result != EResult.Success)
            {
                failed = true;
                return;
            }
            mount           = _mount;
            pendingDownload = null;
            myRendererCtrl  = mount.gameObject.GetComponentInChildrenFast <MountRendererCtrl>();
            if (myRendererCtrl != null)
            {
                myRendererCtrl.Show(actorInfo.IsRiding, true);
            }
        });
        while (mount == null || mount.inited == false)
        {
            if (failed)
            {
                yield break;
            }
            yield return(null);
        }
        pendingDownload = null;


        mount.isDownloading_ = false;
        if (_callback != null)
        {
            _callback(mount, failed ? EResult.Failed : EResult.Success);
        }
    }
Esempio n. 4
0
 protected override void Init()
 {
     base.Init();
     OnEqChangeEvent(0);
     this.gameObject.SetMaskLayer(LayerMask.NameToLayer("Preview"));
     if (animFSM != null)
     {
         InitAnimation();
     }
     rendererCtrl = base.rendererCtrl as MountRendererCtrl;
     if (rendererCtrl != null)
     {
         rendererCtrl.Show(true, true);
         rendererCtrl.Init(actorInfo);
     }
     inited_ = true;
     if (actorInfo != null)
     {
         actorInfo.OnEffectChangeEvent += OnEqChangeEvent;
     }
     OnEffectChangeEvent(0);
 }