Example #1
0
 public void Configure(DwarfStatus dwarf)
 {
     mDwarfStatus    = dwarf;
     mDwarfSelect    = dwarf.GetComponent <DwarfSelect>();
     mDwarfBehaviour = dwarf.GetComponent <DwarfBehaviour>();
     mNameText.text  = mDwarfStatus.dwarfName;
 }
Example #2
0
 public virtual void Perform(DwarfInventory inventory, System.Action onFinish)
 {
     mDwarfInventory   = inventory;
     mDwarfStatus      = inventory.GetComponent <DwarfStatus>();
     mDwarfBehaviour   = inventory.GetComponent <DwarfBehaviour>();
     mOnFinishCallback = onFinish;
 }
Example #3
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            mActiveBuilding = null;
            mCurrentDwarf   = null;
        }
        else if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            mHUDController.ToggleBuildingsListMenu();
        }
        else if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            mHUDController.ToggleInventoryMenu();
        }

        if (mCurrentDwarf == null || mCurrentDwarf.path == null)
        {
            return;
        }

        List <Vector3> pos = new List <Vector3>();

        pos.Add(new Vector3(mCurrentDwarf.transform.position.x, mCurrentDwarf.transform.position.y, -1f));
        foreach (Node n in mCurrentDwarf.path)
        {
            pos.Add(new Vector3(n.worldPosition.x, n.worldPosition.y, -1f));
        }
        mPathRenderer.positionCount = pos.Count;
        mPathRenderer.SetPositions(pos.ToArray());
    }
Example #4
0
 void Awake()
 {
     mSelectedSprite = transform.Find("SelectedSprite").GetComponent <SpriteRenderer>();
     mBehaviour      = GetComponent <DwarfBehaviour>();
 }
Example #5
0
 public void FocusOnDwarf(DwarfBehaviour dwarf)
 {
     CameraBehaviour.main.SetPosition(dwarf.transform.position);
 }
Example #6
0
 void Awake()
 {
     mBehaviour = GetComponent <DwarfBehaviour>();
     mInventory = GetComponent <DwarfInventory>();
 }