/// <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(); }
/// <summary> /// 重置当前临时坦克组装 /// </summary> private void ResetTemTankAssemble() { temTankAssemble = ScriptableObject.CreateInstance <TankAssembleManager>(); temTankAssemble.CopyFrom(CurrentTankAssemble); temTankAssemble.name = "TemporaryPreviewTank"; }