/// <summary> /// 添加编辑建筑配件 /// </summary> /// <returns></returns> private static void AddBuildingEditPlugin(TouchMove touch) { if (touch == null) { return; } GameObject selectEffectParent = null; selectEffectParent = new GameObject("SelectEffectParent"); selectEffectParent.transform.parent = touch.gameObject.transform.parent; selectEffectParent.transform.localPosition = new Vector3(0, 0, -1); selectEffectParent.transform.localRotation = touch.gameObject.transform.parent.localRotation; if (touch.MyCore().m_type == ShipBuildType.Soldier) { selectEffectParent.transform.localPosition = new Vector3(-RoomGrid.m_width / 2.0f, 0, -1); } else if (touch.MyCore().m_type == ShipBuildType.BuildStair) { selectEffectParent.transform.localPosition = new Vector3(0, RoomGrid.m_heigth / 2.0f + 0.3f, -1); } touch.SetPlugin(selectEffectParent); }