public void Shoot(Vector3 shootDirection)
    {
        this.GetComponent <Rigidbody>().AddForce(shootDirection * bulletSpeed, ForceMode.Impulse);
        if (ropeContainerPrefab != null)
        {
            ropeContainer = GameObject.Instantiate(ropeContainerPrefab, this.transform.position, Quaternion.identity);
            ropeContainer.AddEventListener(this.gameObject);

            Transform originTransform = GetOriginGo().transform;
            if (GetOriginGo().GetComponent <AlienTarget>())
            {
                originTransform =
                    GetOriginGo().GetComponent <AlienTarget>()
                    .GetCenterTransform();
            }
            ropeContainer.ExtendRope(originTransform, this.transform);
        }
    }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     ropeContainer.ExtendRope(source, target);
 }