Exemple #1
0
    public void Initialize()
    {
        GroupComponent groupComponent = transform.parent.GetComponent <GroupComponent>();

        UseDestination = groupComponent.UseDestination;
        if (UseDestination)
        {
            Destination = VectorHelpers.Vector3ToVector2(groupComponent.DestinationWaypoint.position);
        }
        else
        {
            Direction = groupComponent.Direction;
        }
        Position = VectorHelpers.Vector3ToVector2(transform.position);
        Vector3 localScale = transform.localScale;
        float   scale      = ((localScale.x + localScale.y + localScale.z) / 3);

        Radius = (scale / 2);
    }
 private void Start()
 {
     Position = VectorHelpers.Vector3ToVector2(transform.position);
 }