예제 #1
0
 private void GetInstantiateWing(int wingId, WingBody dataWing, Action <GameObject> loaded)
 {
     if (string.IsNullOrEmpty(dataWing.prefabPath))
     {
         if (loaded != null)
         {
             loaded.Invoke(null);
         }
         return;
     }
     this.LoadAsset(wingId, dataWing.prefabPath, EquipCustomization.EquipType.Wing, delegate(bool isSuccess)
     {
         if (!isSuccess)
         {
             if (loaded != null)
             {
                 loaded.Invoke(null);
             }
             return;
         }
         if (loaded != null)
         {
             loaded.Invoke(EquipCustomizationTool.GetInstantiate(dataWing.prefabPath));
         }
     });
 }
예제 #2
0
    public void EquipWingOn(int wingModelId)
    {
        if (wingModelId <= 0)
        {
            this.ClearWing();
            return;
        }
        WingBody wingBody = DataReader <WingBody> .Get(wingModelId);

        if (wingBody == null)
        {
            Debug.LogError("GameData.WingBody no find, wingId = " + wingModelId);
            return;
        }
        this.DoEquipWingOn(wingModelId, wingBody);
    }
예제 #3
0
 private void DoEquipWingOn(int wingId, WingBody dataWing)
 {
     if (this.ActorTarget == null)
     {
         this.mWingId      = 0;
         this.mCacheWingId = wingId;
         return;
     }
     this.mWingId      = wingId;
     this.mCacheWingId = 0;
     this.InstantiateEquipWing(wingId, dataWing, delegate(bool isSuccess)
     {
         if (isSuccess)
         {
             EventDispatcher.Broadcast("EquipCustomization.ACTSELF_CHANGE_WEAPON");
             this.EquipWingSuccess();
         }
     });
 }
예제 #4
0
 private void InstantiateEquipWing(int wingId, WingBody dataWing, Action <bool> finished)
 {
     this.GetInstantiateWing(wingId, dataWing, delegate(GameObject goInstantiate1)
     {
         if (this.ActorTarget == null)
         {
             finished.Invoke(false);
             return;
         }
         if (!this.VerifyWing(wingId))
         {
             if (goInstantiate1 != null)
             {
                 Object.Destroy(goInstantiate1);
             }
             finished.Invoke(false);
             return;
         }
         if (goInstantiate1 == null)
         {
             finished.Invoke(false);
             return;
         }
         this.ClearWing();
         if (goInstantiate1 != null)
         {
             EquipCustomizationTool.SetLayer(goInstantiate1, this.ActorTarget);
             ShadowController.SetShadowModelRender2Child(this.ActorTarget.get_transform(), goInstantiate1.get_transform(), false);
             this.m_goWing = goInstantiate1;
             this.SetWing2Slot();
         }
         if (finished != null)
         {
             finished.Invoke(goInstantiate1 != null);
         }
     });
 }