Ejemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     ropeManager = GameObject.Find("RopeManager").GetComponent <RopeManager>();
     Anchors     = ropeManager.Anchor;
     lineRender  = GetComponent <LineRenderer>();
     lineRender.positionCount = ropeManager.AnchorCount;
 }
Ejemplo n.º 2
0
    public virtual void CreateBalloon(EBalloonType pType)
    {
        if(mBalloons.Count < m_MaxBalloonCount)
        {
            RopeManager ropeManager = new RopeManager (m_RopePrefab, m_Tack);

            Vector2 baseBalloonPosition = GetPositionXOffset(m_Tack.transform.position);
            Balloon balloon = BalloonFactory.CreateBalloon (pType, baseBalloonPosition);

            GameObject balloonObject = balloon.GameObject;

            var physics = balloonObject.GetComponent<BalloonPhysics>();
            SetBalloonProperties(balloon, physics, mBalloons.Count);

            LineRenderer balloonLineRenderer = balloonObject.GetComponent<LineRenderer>();
            Rope rope = ropeManager.CreateRopeForBalloon(balloonLineRenderer, balloonObject);
            ropeManager.AttachRope(balloonObject, rope, m_Tack);
            balloonObject.transform.parent = this.gameObject.transform;

            mBalloons.Add(balloon);
            mBalloons [mBalloons.Count - 1].InstantDeflate ();
            mBalloons [mBalloons.Count - 1].SetInflate (true);
        }
    }
Ejemplo n.º 3
0
 public void Init(){
     manager = this.transform.parent.GetComponent<RopeManager>();
 }
Ejemplo n.º 4
0
 void Awake()
 {
     Debug.Log("Attracted Awake");
     ropeManager = FindObjectOfType<RopeManager>();
     currentAttractor = null;
 }