Example #1
0
 public void CopyDataTo(Swimmer tar)
 {
     tar.BoundCircleRadius = BoundCircleRadius;
     tar.Speed             = Speed;
     tar.RotateSpd         = RotateSpd;
     tar.mLiveDimension    = mLiveDimension;
     //Prefab复制没有计算mLiveDimenesion
     //tar.SetLiveDimension(BoundCircleRadius);
 }
Example #2
0
        private void SetSwimmer(Swimmer swimmer, BirthHole hole)
        {
            swimmer.gameObject.AddComponent <FishDimenSetWhenEnterWorld>();
            swimmer.SetLiveDimension(Radius / swimmer.BoundCircleRadius * 2F);
            var tsSwimmer = swimmer.transform;

            tsSwimmer.parent = hole.Parent;
            Vector3 localPos = Random.insideUnitCircle * (Radius - swimmer.BoundCircleRadius);

            localPos = hole.Position + localPos;
            tsSwimmer.localPosition = localPos;
            tsSwimmer.rotation      = hole.Rotation;
        }
Example #3
0
        void Awake()
        {
            Swimmer s = GetComponent <Swimmer>();

            s.EvtSwimOutLiveArea += Handle_SwimOutLiveArea;
        }