private void ActivatePrimitives() { var points = FibonacciSphere.Sample((uint)Primitives.Count); for (var i = 0; i < Primitives.Count; i++) { var ps = Primitives[i].GetComponent <PointingSwarm>(); ps.SetInteractRange(InteractRange); ps.OffsetTarget = points[i]; ps.DistanceFromTarget = DistanceFromTarget; ps.SetActive(true); } }
protected override void RepositionPrimitives() { var points = FibonacciSphere.Sample((uint)Primitives.Count); for (var i = 0; i < Primitives.Count; i++) { var ps = Primitives[i].GetComponent <PointingSwarm>(); ps.transform.position = transform.position + points[i] * DistanceFromTarget; ps.transform.LookAt(transform.position); ps.GetComponent <PointingSwarm>().SetIdleLootAtTarget(transform.position); RpcSetLocation(ps.GetComponent <NetworkIdentity>(), ps.transform.position, transform.position); } UpdateInteractRange(); }