protected override bool JointWithOverride(GameObject other) { if (!Used()) { m_baseDistance = Vector3.Distance(transform.position, other.transform.position); m_baserotation = m_parentJoint.connectedGameobject.transform.rotation; m_initVec = other.transform.position - transform.parent.position; m_currentController = other.GetComponentInParent <MTK_InputManager>(); // joint // m_anchor = transform.InverseTransformPoint(other.transform.position); // m_confJoint = other.AddComponent<ConfigurableJoint>(); // m_confJoint.connectedBody = transform.parent.GetComponent<Rigidbody>(); // m_confJoint.autoConfigureConnectedAnchor = false; // m_confJoint.xMotion = ConfigurableJointMotion.Locked; // m_confJoint.yMotion = ConfigurableJointMotion.Locked; // m_confJoint.zMotion = ConfigurableJointMotion.Locked; // m_confJoint.enableCollision = true; return(true); } else { return(false); } }
void Awake() { m_inputManager = GetComponentInParent <MTK_InputManager>(); m_inputManager.m_onTrigger.AddListener(Terraform); m_inputManager.m_onGrip.AddListener(TerraformDown); m_inputManager.m_onPad.AddListener(Teleport); m_colonisator = FindObjectOfType <Colonisator>(); }
private void OnTriggerEnter(Collider other) { if (!State) { State = true; } m_currentController = other.GetComponentInParent <MTK_InputManager>(); }
private void Start() { m_inputManager = GetComponentInParent <MTK_InputManager>(); m_setup = GetComponentInParent <MTK_Setup>(); m_telekinesis = GetComponent <TelekinesisPointer>(); m_inputManager.m_onPad.AddListener(OnPad); }
void Awake() { m_inputManager = GetComponentInParent <MTK_InputManager>(); m_inputManager.m_onTrigger.AddListener(TriggerAttract); m_lastPos = transform.position; m_hand = GetComponentInParent <MTK_InteractHand>(); m_hand.m_onTouchInteractable.AddListener(GrabIfTarget); m_interactiblesManager = MTK_InteractiblesManager.Instance; m_fxManager = GetComponentInChildren <FXManager>(); }
private void Update() { if (m_newScale > 0f) { m_scaleEffect.transform.localScale = Vector3.one * m_newScale; if (!m_currentInputmanager) { m_currentInputmanager = m_catchedObjectJoint.GetComponent <MTK_InertJoint>().connectedGameobject.GetComponentInParent <MTK_InputManager>(); } else { m_currentInputmanager.Haptic(Mathf.Abs(m_oldScale - m_newScale) * 10); } m_oldScale = m_newScale; m_newScale = -1f; } }
private void OnEnable() { m_inputManager = GetComponentInParent <MTK_InputManager>(); }