void setFace(UnitFaceDirection pFace) { _face = pFace; var lScale = turnObject.localScale; lScale.x = -lScale.x; turnObject.localScale = lScale; }
public Transform prepareProduce() { switch(nowProduceDirection) { case UnitFaceDirection.left: nowProduceDirection = UnitFaceDirection.right; strongholdAnimation.CrossFade("leftProduce",0.1f); if (Network.isServer) networkView.RPC("RPCLeftProduce", RPCMode.Others); return leftProduceTransform; case UnitFaceDirection.right: nowProduceDirection = UnitFaceDirection.left; strongholdAnimation.CrossFade("rightProduce", 0.1f); if (Network.isServer) networkView.RPC("RPCRightProduce", RPCMode.Others); return rightProduceTransform; default: Debug.LogError("no the direction"); return null; } }
public static int toSerializeNetworkView(UnitFaceDirection pFace) { return pFace == UnitFaceDirection.left ? 0 : 1; }
public static int getValue(UnitFaceDirection type) { if (type == UnitFaceDirection.left) return -1; return 1; }
public void calculateFace(UnitFaceDirection pLastFace) { //if (FaceLeft != FaceRight) //{ // if (FaceLeft && pLastFace == UnitFaceDirection.right) // { // face = UnitFaceDirection.left; // //Debug.Log("Change to left"); // return true; // } // if (FaceRight && pLastFace == UnitFaceDirection.left) // { // face = UnitFaceDirection.right; // //Debug.Log("Change to right"); // return true; // } //} //face = pLastFace; //return false; if (FaceLeft != FaceRight) { if (FaceLeft) { face = UnitFaceDirection.left; return ; } else//if (FaceRight) { face = UnitFaceDirection.right; return ; } } face = pLastFace; }
//������������ķ�����³���,������б���true public bool updateFace() { if (_lastFace == unitActionCommand.face) return false; _lastFace = unitActionCommand.face; return true; }