Exemplo n.º 1
0
    protected virtual void Start()
    {
        if (rope == null)
        {
            rope = Instantiate(GameManager.instance.RopeDrawerPrefab, transform).GetComponent <CableProceduralSimple>();
        }
        var cP = transform.Find("ConnectionPoint");

        if (cP != null)
        {
            cP.GetComponentInChildren <MeshRenderer>().enabled = true;
            connectionPosition      = cP;
            rope.transform.position = connectionPosition.position;
            if (parent != null)
            {
                (parent as StaticNode).UpdateRopeEndTransform();
            }
        }
        UpdateRopeEndTransform();
        rope.sagAmplitude = 0f;
        rope.gameObject.SetActive(true);
    }
Exemplo n.º 2
0
 private void Awake()
 {
     rope = GetComponent <CableProceduralSimple>();
 }