public void Configure(DwarfStatus dwarf) { mDwarfStatus = dwarf; mDwarfSelect = dwarf.GetComponent <DwarfSelect>(); mDwarfBehaviour = dwarf.GetComponent <DwarfBehaviour>(); mNameText.text = mDwarfStatus.dwarfName; }
public virtual void Perform(DwarfInventory inventory, System.Action onFinish) { mDwarfInventory = inventory; mDwarfStatus = inventory.GetComponent <DwarfStatus>(); mDwarfBehaviour = inventory.GetComponent <DwarfBehaviour>(); mOnFinishCallback = onFinish; }
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()); }
void Awake() { mSelectedSprite = transform.Find("SelectedSprite").GetComponent <SpriteRenderer>(); mBehaviour = GetComponent <DwarfBehaviour>(); }
public void FocusOnDwarf(DwarfBehaviour dwarf) { CameraBehaviour.main.SetPosition(dwarf.transform.position); }
void Awake() { mBehaviour = GetComponent <DwarfBehaviour>(); mInventory = GetComponent <DwarfInventory>(); }