Exemplo n.º 1
0
 public virtual void LocationConnect(AssignableLocation location)
 {
     enabled      = true;
     _assignedLoc = location;
     AntsPerSec   = 0;
     _assignedLoc.UpdateAssignmentText(AntsPerSec);
     this.transform.position = _assignedLoc.transform.position;
 }
Exemplo n.º 2
0
    public void SelectLocation(AssignableLocation loc)
    {
        if (loc != selectedLoc)
        {
            Deselect();

            selectedLoc                     = loc;
            locationMenu.enabled            = true;
            locationMenu.transform.position = selectedLoc.transform.position;
        }
    }
Exemplo n.º 3
0
    public void DisconnectStreamAssignment(AssignableLocation location)
    {
        StreamAssignment stream = streamAssignmentDict[location.LocID];

        streamAssignmentDict.Remove(location.LocID);
        stream.LocationDisconnect();
        streamPool.Enqueue(stream);
        if (streamPool.Count > 10)
        {
            Debug.Log("(DEBUG) Stream pool is grater than 10");
        }
    }
Exemplo n.º 4
0
    public void SelectAssignment(AssignableLocation loc, Assignment assign)
    {
        if (loc != selectedLoc)
        {
            Deselect();

            selectedLoc                       = loc;
            selectedAssign                    = assign;
            assignmentMenu.enabled            = true;
            assignmentMenu.transform.position = selectedLoc.transform.position;
        }
    }
Exemplo n.º 5
0
    public void Deselect()
    {
        if (selectedLoc != null)
        {
            locationMenu.enabled = false;
            selectedLoc          = null;
        }

        if (selectedAssign != null)
        {
            selectedAssign.Deselect();
            assignmentMenu.enabled = false;
            selectedAssign         = null;
        }
    }
Exemplo n.º 6
0
    public StreamAssignment ConnectStreamAssignment(AssignableLocation location)
    {
        StreamAssignment newStream;

        if (streamPool.Count != 0)
        {
            newStream = streamPool.Dequeue();
        }
        else
        {
            newStream = PrefabManager.instance.CreateStreamAssignment();
        }
        newStream.LocationConnect(location);
        streamAssignmentDict.Add(location.LocID, newStream);
        return(newStream);
    }
Exemplo n.º 7
0
    protected void Awake()
    {
        // Only have one in game
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        //Sets this to not be destroyed when reloading scene
        DontDestroyOnLoad(gameObject);

        selectedLoc            = null;
        selectedAssign         = null;
        locationMenu.enabled   = false;
        assignmentMenu.enabled = false;
    }
Exemplo n.º 8
0
 public override void LocationConnect(AssignableLocation location)
 {
     base.LocationConnect(location);
 }
Exemplo n.º 9
0
 public virtual void LocationDisconnect()
 {
     enabled      = false;
     _assignedLoc = null;
 }