示例#1
0
 public void Silking(Transform destination)
 {
     if (_silkManager.CanSilk(transform, destination))
     {
         // CreateSilk will make old silk go away, so make sure
         // spider is not at the child of any silk
         transform.SetParent(_savedParent);
         Silk silk = _silkManager.CreateSilk(transform, destination);
         if (silk != null)
         {
             List <GameObject> chains = silk.GetChains();
             Debug.Log("chains # " + chains.Count);
             if (_spiderClimbCoroutine != null)
             {
                 StopCoroutine(_spiderClimbCoroutine);
                 _state = State.Floating;
                 transform.SetParent(_savedParent);
                 _spiderClimbCoroutine = null;
             }
             _spiderClimbCoroutine = StartCoroutine(ClimbUp(chains));
         }
     }
 }