public bool SwapPlayerChar(CharacterComponent charac) { if (charac.Equals(currPlayerChar)) { return(false); } //remove highlight HighlightManager.instance.ClearHighlight(); //swap currChar and charac position in turnOrder //(since curr is already dequeued, then remove the charac from the order and get the new one) turnOrders.ReplaceItem(charac, currPlayerChar); //swap charId int tempId = charac.charId; charac.charId = currPlayerChar.charId; currPlayerChar.charId = tempId; //replace currChar isPlayer to new one currPlayerChar.RevokePlayer(); SetPlayerChar(charac); //replace currUnit to this char currUnit = charac; //change to new charac turn currUnit.MyTurn(); return(true); }
public void FocusCamTo(CharacterComponent charac, Transform newTrans) { if (charac.Equals(currentFocus)) //if already focuses on this char, ignore { return; } currentFocus = charac; //parent cam to new char cam.transform.parent = charac.transform; //move cam to new char StartCoroutine(LerpTo(newTrans)); }