///neighbor: Neighbor/cenlist
    public override void InitializeAgent()
    {
        _String.Clear();
        Pos.Clear();
        cenList.Clear();

        eObj.SetAsDefualt();
        //ResetTargetPosition();

        var S = eObj.elements.Strings;

        foreach (var s in S)
        {
            if (s.CompareTag(agentType.ToString()))
            {
                _String.Add(s);
            }
        }
        SetPos();
        ///unbaked
        SetCenter();
        _neighborManager = GetComponentInParent <NeighborManager>();
        var neigh = _neighborManager.GetNeighbor();

        foreach (var n in neigh)
        {
            if (n.name != this.name)
            {
                Neighbor.Add(n);
            }
        }

        foreach (var n in Neighbor)
        {
            cenList.Add(n.center);
        }
        distanceRecord = prevDistance = Vector3.Distance(target.transform.position, center.transform.position);
        defColor       = center.GetComponent <MeshRenderer>().material.color;
    }
Example #2
0
 void SetUnitAsDefualt(TensegrityObject abObj)
 {
     abObj.SetAsDefualt();
 }
Example #3
0
 void SetUnitAsDefualt()
 {
     abObj.SetAsDefualt();
 }
Example #4
0
 public override void InitializeAgent()
 {
     tObj.SetAsDefualt();
     ResetTargetPosition();
 }