Exemple #1
0
 void Start()
 {
     _audioSource       = gameObject.AddComponent <AudioSource>();
     _lockRotation      = true;
     _colliderStartSize = _collider.size;
     data = GetComponent <AbstractTube>();
 }
    //public override void CheckSurrounding()
    //{
    //    foreach(Direction hole in _holeLocations)
    //    {
    //        Point targetPoint = GetPoint().AddPoint(DirectionExtensions.GetDirectionPoint(hole));

    //        GameObject obj = LevelManager_v2.Instance.GetTubePositioning(targetPoint);

    //        if(obj != null)
    //        {
    //            AbstractTube connectingTube =
    //        }

    //    }
    //}

    public void AddConnectingTube(AbstractTube obj, Direction dirComingFrom)
    {
        if (_holeDict.ContainsKey(dirComingFrom))
        {
            if (_holeDict[dirComingFrom].Equals(_prevHole))
            {
                _prevHole = obj;
            }
            else if (_holeDict[dirComingFrom].Equals(_nextHole))
            {
                _nextHole = obj;
            }
        }
    }
    private void StartFlow()
    {
        if (_gridTube[0, 0] == null)
        {
            EndGame();
        }

        GameObject obj = _gridTube[0, 0];

        while (obj != null)
        {
            AbstractTube t = obj.GetComponent <AbstractTube>();
            if (t != null)
            {
            }
            else
            {
                EndGame();
            }
        }
    }