コード例 #1
0
 /// <summary>
 /// 创建新的坦克
 /// </summary>
 public void CreateNewTank()
 {
     if (allCustomTank.Count >= allCustomTank.maxSize)
     {
         toast.ShowToast("坦克库已满。");
         return;
     }
     newTankAssemble = ScriptableObject.CreateInstance <TankAssembleManager>();
     newTankAssemble.CopyFrom(defaultTankAssemble);
     allCustomTank.AddNewTank(newTankAssemble);
     allCustomTankPreview.CatchTankTexture(allCustomTank.Count - 1);
     allCustomTank.SelectCurrentTank(allCustomTank.Count - 1);
     allCustomTankPreview.OnTankPreviewClicked();
     createdSuccessedEvent.Invoke();
     //OnTankSelected();
 }
コード例 #2
0
 /// <summary>
 /// 重置当前临时坦克组装
 /// </summary>
 private void ResetTemTankAssemble()
 {
     temTankAssemble = ScriptableObject.CreateInstance <TankAssembleManager>();
     temTankAssemble.CopyFrom(CurrentTankAssemble);
     temTankAssemble.name = "TemporaryPreviewTank";
 }