public void SetRightShip( GameObject go, Ship ship ) { float distance = 2 * ship.shieldRadius; Vector3 position = new Vector3( -distance, 0f, 0f );//BattleGrid.GetRightPosition( SelectedRightPosition_ ); GroupRight_.SetShip( go, ship, SelectedRightPosition_, position ); ShowShip( GroupRight_.GetShip( SelectedRightPosition_ ), position ); SelectedRightPosition_ = 0; }
public static void PreviewCharacter( Ship ship, GameObject go ) { Reset(); go.transform.position = Vector3.zero; CurrentObject = go; //CurrentObject.AddComponent<EditorCharacterObject>(); SetupCamera(); //SetupParts( ship, go ); ReplaceShader( go ); }
public void SetShip( GameObject go, Ship ship, int index, Vector3 position ) { ResetShip( index ); EditorShip ec = new EditorShip(); ec.Go = go; ec.ship = ship; ec.OrginPosition = position; ec.Index = index; ec.Group = this; Ships_[index] = ec; }
/// <summary> /// 根据路径读取舰船并缓存 /// </summary> /// <param name="path"></param> /// <returns></returns> private static IEnumerator LoadShip(string path) { using (WWW www = SmartCreateWww(path)) { if (www != null) { yield return(www); if (!Utility.CheckWww(www)) { yield break; } string assetName = Path.GetFileNameWithoutExtension(path); if (!www.assetBundle.Contains(assetName)) { Debug.Log("Error, assetBundle doesn't have Ship Define: " + path); yield break; } Object obj = www.assetBundle.LoadAsset <Object>(assetName); PalmPoineer.Mobile.Ship shipDef = obj as PalmPoineer.Mobile.Ship; www.assetBundle.Unload(false); if (!shipDef) { Debug.Log("Error, Load Ship Define Failed: " + path); yield break; } if (ShipDefines.ContainsKey(assetName)) { Debug.Log("ship config list already has key:" + assetName); yield break; } ShipDefines.Add(assetName, shipDef); } else { yield return(null); } } }