예제 #1
0
    public GameObject ConstructAndBindViewLink(Vector3 to, Vector3 from)
    {
        var gameObjectLink = Instantiate(linkPrefab, new Vector3(0, 0, 0), Quaternion.identity);
        var viewLink       = gameObjectLink.GetComponent <ViewLink>();
        var modelLink      = new ModelLink(to, from);
        var linkBinding    = new LinkBinding(viewLink, modelLink, environmentChanged);

        linkBindings.Add(linkBinding);
        me.AddLink(modelLink);
        viewLink.Initialize(to, from, linkBinding);

        return(gameObjectLink);
    }
예제 #2
0
 public void Initialize(Vector3 to, Vector3 from, LinkBinding binding)
 {
     SetTargets(to, from);
     this.binding = binding;
 }
예제 #3
0
 public void DeleteLink(LinkBinding binding)
 {
     binding.DeleteFromViewAndModel(me);
     linkBindings.Remove(binding);
     me.RemoveLink(binding.ml);
 }