public static void StartPointer(Part rootPart, KIS_Item item, OnPointerClick pClick, OnPointerState pState, Transform from = null) { if (!running) { DebugEx.Fine("StartPointer()"); customRot = Vector3.zero; aboveDistance = 0; partToAttach = rootPart; sourceTransform = from; running = true; SendPointerClick = pClick; SendPointerState = pState; if (rootPart) { MakePointer(rootPart); } else { VariantsUtils.ExecuteAtPartVariant( item.availablePart, VariantsUtils.GetCurrentPartVariant(item.availablePart, item.partNode), MakePointer); pointer.transform.localScale *= KISAPI.PartNodeUtils.GetTweakScaleSizeModifier(item.partNode); } LockUI(); allowedAttachmentParts = allowedAttachmentParts; // Apply selection. SendPointerState(PointerTarget.Nothing, PointerState.OnPointerStarted, null, null); } }
public static void StartPointer(Part partToMoveAndAttach, OnPointerClick pClick, OnPointerState pState, Transform from = null) { if (!running) { KIS_Shared.DebugLog("StartPointer(pointer)"); customRot = Vector3.zero; aboveDistance = 0; partToAttach = partToMoveAndAttach; sourceTransform = from; running = true; SendPointerClick = pClick; SendPointerState = pState; // Set possible attach nodes attachNodes.Clear(); if (partToAttach.attachRules.srfAttach) { KIS_Shared.DebugLog("Surface node set to default"); attachNodes.Add(partToMoveAndAttach.srfAttachNode); } else if (partToAttach.attachNodes.Count == 0) { KIS_Shared.DebugLog("No attach nodes found, surface node set to default"); attachNodes.Add(partToMoveAndAttach.srfAttachNode); } else if (partToAttach.findAttachNode("bottom") != null) { KIS_Shared.DebugLog("Bottom node set to default"); attachNodes.Add(partToAttach.findAttachNode("bottom")); } else { KIS_Shared.DebugLog(partToAttach.attachNodes[0].id + " node set to default"); attachNodes.Add(partToAttach.attachNodes[0]); } foreach (AttachNode an in partToMoveAndAttach.attachNodes) { if (!attachNodes.Contains(an)) { attachNodes.Add(an); KIS_Shared.DebugLog("Node : " + an.id + " added"); } } attachNodeIndex = 0; InputLockManager.SetControlLock(ControlTypes.ALLBUTCAMERAS, "KISpointer"); } }
public static void StartPointer(Part partToMoveAndAttach, OnPointerClick pClick, OnPointerState pState, Transform from = null) { if (!running) { Logger.logInfo("StartPointer()"); customRot = Vector3.zero; aboveDistance = 0; partToAttach = partToMoveAndAttach; sourceTransform = from; running = true; SendPointerClick = pClick; SendPointerState = pState; MakePointer(); InputLockManager.SetControlLock(ControlTypes.ALLBUTCAMERAS, "KISpointer"); allowedAttachmentParts = allowedAttachmentParts; // Apply selection. } }
public static void StartPointer(Part partToMoveAndAttach, OnPointerClick pClick, OnPointerState pState, Transform from = null) { if (!running) { DebugEx.Fine("StartPointer()"); customRot = Vector3.zero; aboveDistance = 0; partToAttach = partToMoveAndAttach; sourceTransform = from; running = true; SendPointerClick = pClick; SendPointerState = pState; MakePointer(); LockUI(); allowedAttachmentParts = allowedAttachmentParts; // Apply selection. SendPointerState(PointerTarget.Nothing, PointerState.OnPointerStarted, null, null); } }
public static void StartPointer(Part partToMoveAndAttach, OnPointerClick pClick, OnPointerState pState, Transform from = null) { if (!running) { KIS_Shared.DebugLog("StartPointer(pointer)"); customRot = Vector3.zero; aboveDistance = 0; partToAttach = partToMoveAndAttach; sourceTransform = from; running = true; SendPointerClick = pClick; SendPointerState = pState; // Set possible attach nodes attachNodes.Clear(); if (partToAttach.attachRules.srfAttach) { KIS_Shared.DebugLog("Surface node set to default"); attachNodes.Add(partToMoveAndAttach.srfAttachNode); } else if (partToAttach.attachNodes.Count == 0) { KIS_Shared.DebugLog("No attach nodes found, surface node set to default"); attachNodes.Add(partToMoveAndAttach.srfAttachNode); } else if (partToAttach.findAttachNode("bottom") != null) { KIS_Shared.DebugLog("Bottom node set to default"); attachNodes.Add(partToAttach.findAttachNode("bottom")); } else { KIS_Shared.DebugLog(partToAttach.attachNodes[0].id + " node set to default"); attachNodes.Add(partToAttach.attachNodes[0]); } foreach (AttachNode an in partToMoveAndAttach.attachNodes) { if (!attachNodes.Contains(an)) { attachNodes.Add(an); KIS_Shared.DebugLog("Node : " + an.id + " added"); } } attachNodeIndex = 0; InputLockManager.SetControlLock(ControlTypes.ALLBUTCAMERAS, "KISpointer"); } }